Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
this should allow the tracing of resource usage with this model
[simgrid.git] / src / surf / cpu_interface.hpp
index 375c1d7..e92c133 100644 (file)
@@ -10,6 +10,7 @@
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
+#include "src/surf/trace_mgr.hpp"
 
 #include <list>
 
@@ -26,6 +27,8 @@ namespace surf {
  */
 class XBT_PUBLIC CpuModel : public kernel::resource::Model {
 public:
+  explicit CpuModel(kernel::resource::Model::UpdateAlgo algo) : Model(algo) {}
+
   /**
    * @brief Create a Cpu
    *
@@ -111,7 +114,7 @@ protected:
 
 public:
   /** @brief Get the available speed of the current Cpu */
-  virtual double getAvailableSpeed();
+  virtual double get_available_speed();
 
   /** @brief Get the current Cpu computational speed */
   virtual double getPstateSpeed(int pstate_index);
@@ -129,7 +132,9 @@ public:
   int pstate_ = 0;                     /*< Current pstate (index in the speedPeakList)*/
 
   virtual void setStateTrace(tmgr_trace_t trace); /*< setup the trace file with states events (ON or OFF). Trace must contain boolean values (0 or 1). */
-  virtual void setSpeedTrace(tmgr_trace_t trace); /*< setup the trace file with availability events (peak speed changes due to external load). Trace must contain relative values (ratio between 0 and 1) */
+  virtual void
+  set_speed_trace(tmgr_trace_t trace); /*< setup the trace file with availability events (peak speed changes due to
+                                          external load). Trace must contain relative values (ratio between 0 and 1) */
 
   tmgr_trace_event_t stateEvent_ = nullptr;
   Metric speed_                  = {1.0, 0, nullptr};
@@ -165,7 +170,7 @@ public:
 
   void update_remains_lazy(double now) override;
   std::list<Cpu*> cpus();
-  
+
   void suspend() override;
   void resume() override;
 };