From 16a4f8966d6b4aff3c7bb22c03be71b968e73a7e Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 24 Mar 2018 10:17:36 +0100 Subject: [PATCH] Replace a protected field with a private variable in the child' constructor --- include/simgrid/kernel/resource/Model.hpp | 1 - src/kernel/resource/Model.cpp | 1 - src/surf/cpu_cas01.cpp | 5 ++--- src/surf/network_cm02.cpp | 5 ++--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/simgrid/kernel/resource/Model.hpp b/include/simgrid/kernel/resource/Model.hpp index 3f7d19fbc1..eb4b01783f 100644 --- a/include/simgrid/kernel/resource/Model.hpp +++ b/include/simgrid/kernel/resource/Model.hpp @@ -96,7 +96,6 @@ public: protected: ActionLmmListPtr modifiedSet_; lmm_system_t maxminSystem_ = nullptr; - bool selectiveUpdate_; private: e_UM_t updateMechanism_ = UM_UNDEFINED; diff --git a/src/kernel/resource/Model.cpp b/src/kernel/resource/Model.cpp index c078cbb791..2d70b7ed02 100644 --- a/src/kernel/resource/Model.cpp +++ b/src/kernel/resource/Model.cpp @@ -21,7 +21,6 @@ Model::Model() : maxminSystem_(nullptr) modifiedSet_ = nullptr; updateMechanism_ = UM_UNDEFINED; - selectiveUpdate_ = 0; } Model::~Model() diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 5c6f2dceb7..de2b88e90a 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -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(); diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 68051c7380..05778dca32 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -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) { -- 2.20.1