Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace a protected field with a private variable in the child' constructor
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 24 Mar 2018 09:17:36 +0000 (10:17 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 24 Mar 2018 09:17:36 +0000 (10:17 +0100)
include/simgrid/kernel/resource/Model.hpp
src/kernel/resource/Model.cpp
src/surf/cpu_cas01.cpp
src/surf/network_cm02.cpp

index 3f7d19f..eb4b017 100644 (file)
@@ -96,7 +96,6 @@ public:
 protected:
   ActionLmmListPtr modifiedSet_;
   lmm_system_t maxminSystem_ = nullptr;
-  bool selectiveUpdate_;
 
 private:
   e_UM_t updateMechanism_ = UM_UNDEFINED;
index c078cbb..2d70b7e 100644 (file)
@@ -21,7 +21,6 @@ Model::Model() : maxminSystem_(nullptr)
 
   modifiedSet_     = nullptr;
   updateMechanism_ = UM_UNDEFINED;
-  selectiveUpdate_ = 0;
 }
 
 Model::~Model()
index 5c6f2dc..de2b88e 100644 (file)
@@ -42,17 +42,16 @@ CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel()
 
   if (optim == "Full") {
     setUpdateMechanism(UM_FULL);
-    selectiveUpdate_ = select;
   } else if (optim == "Lazy") {
     setUpdateMechanism(UM_LAZY);
-    selectiveUpdate_ = true;
+    select = true;
     xbt_assert(select || (xbt_cfg_is_default_value("cpu/maxmin-selective-update")),
                "Disabling selective update while using the lazy update mechanism is dumb!");
   } else {
     xbt_die("Unsupported optimization (%s) for this model", optim.c_str());
   }
 
-  maxminSystem_ = new simgrid::kernel::lmm::System(selectiveUpdate_);
+  maxminSystem_ = new simgrid::kernel::lmm::System(select);
 
   if (getUpdateMechanism() == UM_LAZY) {
     modifiedSet_              = new kernel::resource::ActionLmmList();
index 68051c7..05778dc 100644 (file)
@@ -142,17 +142,16 @@ NetworkCm02Model::NetworkCm02Model()
 
   if (optim == "Full") {
     setUpdateMechanism(UM_FULL);
-    selectiveUpdate_ = select;
   } else if (optim == "Lazy") {
+    select = true;
     setUpdateMechanism(UM_LAZY);
-    selectiveUpdate_ = true;
     xbt_assert(select || (xbt_cfg_is_default_value("network/maxmin-selective-update")),
                "You cannot disable selective update when using the lazy update mechanism");
   } else {
     xbt_die("Unsupported optimization (%s) for this model. Accepted: Full, Lazy.", optim.c_str());
   }
 
-  maxminSystem_ = new simgrid::kernel::lmm::System(selectiveUpdate_);
+  maxminSystem_ = new simgrid::kernel::lmm::System(select);
   loopback_     = NetworkCm02Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
 
   if (getUpdateMechanism() == UM_LAZY) {