Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Replay: Cosmetics
[simgrid.git] / src / surf / cpu_cas01.cpp
index bacf715..808b78a 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "cpu_cas01.hpp"
 #include "cpu_ti.hpp"
-#include "simgrid/sg_config.h"
+#include "simgrid/sg_config.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
 #include "xbt/utility.hpp"
 #include <algorithm>
@@ -41,20 +41,20 @@ CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel()
   bool select = xbt_cfg_get_boolean("cpu/maxmin-selective-update");
 
   if (optim == "Full") {
-    setUpdateMechanism(UM_FULL);
+    setUpdateMechanism(Model::UpdateAlgo::Full);
   } else if (optim == "Lazy") {
     xbt_assert(select || xbt_cfg_is_default_value("cpu/maxmin-selective-update"),
                "You cannot disable cpu selective update when using the lazy update mechanism");
+    setUpdateMechanism(Model::UpdateAlgo::Lazy);
     select = true;
-    setUpdateMechanism(UM_LAZY);
   } else {
     xbt_die("Unsupported optimization (%s) for this model", optim.c_str());
   }
 
-  maxmin_system_ = new simgrid::kernel::lmm::System(select);
+  set_maxmin_system(new simgrid::kernel::lmm::System(select));
 
-  if (getUpdateMechanism() == UM_LAZY)
-    maxmin_system_->modified_set_ = new kernel::resource::Action::ModifiedSet();
+  if (getUpdateMechanism() == Model::UpdateAlgo::Lazy)
+    get_maxmin_system()->modified_set_ = new kernel::resource::Action::ModifiedSet();
 }
 
 CpuCas01Model::~CpuCas01Model()
@@ -181,7 +181,7 @@ CpuAction *CpuCas01::sleep(double duration)
   }
 
   model()->get_maxmin_system()->update_variable_weight(action->get_variable(), 0.0);
-  if (model()->getUpdateMechanism() == UM_LAZY) { // remove action from the heap
+  if (model()->getUpdateMechanism() == kernel::resource::Model::UpdateAlgo::Lazy) { // remove action from the heap
     action->heapRemove();
     // this is necessary for a variable with weight 0 since such variables are ignored in lmm and we need to set its
     // max_duration correctly at the next call to share_resources
@@ -201,7 +201,7 @@ CpuCas01Action::CpuCas01Action(kernel::resource::Model* model, double cost, bool
                 model->get_maxmin_system()->variable_new(this, 1.0 / requestedCore, requestedCore * speed, 1))
     , requestedCore_(requestedCore)
 {
-  if (model->getUpdateMechanism() == UM_LAZY) {
+  if (model->getUpdateMechanism() == kernel::resource::Model::UpdateAlgo::Lazy) {
     set_last_update();
     set_last_value(0.0);
   }