Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove a redundant parameter to the Cpu constructor
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 19 Mar 2016 22:23:50 +0000 (23:23 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 20 Mar 2016 00:01:28 +0000 (01:01 +0100)
src/surf/cpu_cas01.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/ptask_L07.cpp

index 0a7f391..271dce4 100644 (file)
@@ -101,7 +101,7 @@ double CpuCas01Model::next_occuring_event_full(double /*now*/)
 CpuCas01::CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core)
 : Cpu(model, host,
     lmm_constraint_new(model->getMaxminSystem(), this, core * xbt_dynar_get_as(speedPerPstate, 0/*pstate*/, double)),
-    speedPerPstate, core, xbt_dynar_get_as(speedPerPstate, 0/*pstate*/, double))
+    speedPerPstate, core)
 {
   XBT_DEBUG("CPU create: peak=%f, pstate=%d", speed_.peak, pstate_);
 
index 6da354f..72ab8bc 100644 (file)
@@ -134,18 +134,18 @@ void CpuModel::updateActionsStateFull(double now, double delta)
  * Resource *
  ************/
 Cpu::Cpu(Model *model, simgrid::s4u::Host *host,
-    xbt_dynar_t speedPerPstate, int core, double speedPeak)
- : Cpu(model, host, NULL/*constraint*/, speedPerPstate, core, speedPeak)
+    xbt_dynar_t speedPerPstate, int core)
+ : Cpu(model, host, NULL/*constraint*/, speedPerPstate, core)
 {
 }
 
 Cpu::Cpu(Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint,
-    xbt_dynar_t speedPerPstate, int core, double speedPeak)
+    xbt_dynar_t speedPerPstate, int core)
  : Resource(model, host->name().c_str(), constraint)
  , coresAmount_(core)
  , host_(host)
 {
-  speed_.peak = speedPeak;
+  speed_.peak = xbt_dynar_get_as(speedPerPstate, 0/*pstate*/, double);
   speed_.scale = 1;
   host->pimpl_cpu = this;
   xbt_assert(speed_.scale > 0, "Available speed has to be >0");
index 2de8e3a..f8c4092 100644 (file)
@@ -69,12 +69,10 @@ public:
    * @param model The CpuModel associated to this Cpu
    * @param host The host in which this Cpu should be plugged
    * @param constraint The lmm constraint associated to this Cpu if it is part of a LMM component
-   * @param speedList [TODO]
+   * @param speedPerPstate Processor speed (in flop per second) for each pstate
    * @param core The number of core of this Cpu
-   * @param speedPeak The speed peak of this Cpu in flops (max speed)
    */
-  Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host,
-    lmm_constraint_t constraint, xbt_dynar_t speedPeakList, int core, double speedPeak);
+  Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint, xbt_dynar_t speedPerPstate, int core);
 
   /**
    * @brief Cpu constructor
@@ -83,10 +81,8 @@ public:
    * @param host The host in which this Cpu should be plugged
    * @param speedPerPstate Processor speed (in flop per second) for each pstate
    * @param core The number of core of this Cpu
-   * @param speedPeak The speed peak of this Cpu in flops (max speed)
    */
-  Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host,
-      xbt_dynar_t speedPerPstate, int core, double speedPeak);
+  Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core);
 
   ~Cpu();
 
index d094a12..b846e20 100644 (file)
@@ -462,7 +462,7 @@ void CpuTiModel::updateActionsState(double now, double /*delta*/)
  * Resource *
  ************/
 CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core)
-  : Cpu(model, host, NULL, core, 0)
+  : Cpu(model, host, speedPerPstate, core)
 {
   xbt_assert(core==1,"Multi-core not handled by this model yet");
   coresAmount_ = core;
index a5f9339..be2a600 100644 (file)
@@ -287,7 +287,7 @@ Link* NetworkL07Model::createLink(const char *name, double bandwidth, double lat
  ************/
 
 CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core)
- : Cpu(model, host, speedPerPstate, core, xbt_dynar_get_as(speedPerPstate,0,double))
+ : Cpu(model, host, speedPerPstate, core)
 {
   p_constraint = lmm_constraint_new(model->getMaxminSystem(), this, xbt_dynar_get_as(speedPerPstate,0,double));
 }