Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make the energy plugin usable with ptask (but not DVFS) (fix #27)
[simgrid.git] / src / surf / cpu_cas01.hpp
index fb1d02b..294b8d7 100644 (file)
 /***********
  * Classes *
  ***********/
+
+namespace simgrid {
+namespace surf {
+
 class XBT_PRIVATE CpuCas01Model;
 class XBT_PRIVATE CpuCas01;
 class XBT_PRIVATE CpuCas01Action;
@@ -18,7 +22,8 @@ class XBT_PRIVATE CpuCas01Action;
 /*********
  * Model *
  *********/
-class CpuCas01Model : public CpuModel {
+
+class CpuCas01Model : public simgrid::surf::CpuModel {
 public:
   CpuCas01Model();
   ~CpuCas01Model();
@@ -26,12 +31,11 @@ public:
   double (CpuCas01Model::*shareResources)(double now);
   void (CpuCas01Model::*updateActionsState)(double now, double delta);
 
-  Cpu *createCpu(const char *name, xbt_dynar_t speedPeak, int pstate,
+  Cpu *createCpu(simgrid::Host *host, xbt_dynar_t speedPeak, int pstate,
                    double speedScale,
                           tmgr_trace_t speedTrace, int core,
                           e_surf_resource_state_t state_initial,
-                          tmgr_trace_t state_trace,
-                          xbt_dict_t cpu_properties);
+                          tmgr_trace_t state_trace);
   double shareResourcesFull(double now);
   void addTraces();
   ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
@@ -43,32 +47,23 @@ public:
 
 class CpuCas01 : public Cpu {
 public:
-  CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t speedPeak,
+  CpuCas01(CpuCas01Model *model, simgrid::Host *host, xbt_dynar_t speedPeak,
         int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
-        e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
-       xbt_dict_t properties) ;
+        e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace) ;
   ~CpuCas01();
   void updateState(tmgr_trace_event_t event_type, double value, double date);
   CpuAction *execute(double size);
   CpuAction *sleep(double duration);
 
   double getCurrentPowerPeak();
-  double getPowerPeakAt(int pstate_index);
-  int getNbPstates();
-  void setPstate(int pstate_index);
-  int  getPstate();
-  bool isUsed();
+  bool isUsed() override;
   void setStateEvent(tmgr_trace_event_t stateEvent);
   void setPowerEvent(tmgr_trace_event_t stateEvent);
   xbt_dynar_t getSpeedPeakList();
 
-  int getPState();
-
 private:
   tmgr_trace_event_t p_stateEvent;
   tmgr_trace_event_t p_speedEvent;
-  xbt_dynar_t p_speedPeakList;       /*< List of supported CPU capacities (pstate related) */
-  int m_pstate;                      /*< Current pstate (index in the speedPeakList)*/
 };
 
 /**********
@@ -83,3 +78,6 @@ public:
 
   ~CpuCas01Action() {};
 };
+
+}
+}