X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d0b9afc4d105022cc05b5b13ec06af6479dda020..8372ae97612f27b84e8d75aeeed9de0ba6d2ba6a:/src/surf/network_cm02.cpp diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 72bce2129b..aa9df6d85e 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -7,7 +7,7 @@ #include "network_cm02.hpp" #include "simgrid/s4u/Host.hpp" -#include "simgrid/sg_config.h" +#include "simgrid/sg_config.hpp" #include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals #include "src/kernel/lmm/maxmin.hpp" @@ -134,27 +134,21 @@ void surf_network_model_init_Vegas() namespace simgrid { namespace surf { -NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(bool)) : NetworkModel() +NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(bool)) + : NetworkModel(xbt_cfg_get_string("network/optim") == "Full" ? kernel::resource::Model::UpdateAlgo::Full + : kernel::resource::Model::UpdateAlgo::Lazy) { std::string optim = xbt_cfg_get_string("network/optim"); bool select = xbt_cfg_get_boolean("network/maxmin-selective-update"); - if (optim == "Full") { - setUpdateMechanism(kernel::resource::Model::UpdateAlgo::Full); - } else if (optim == "Lazy") { + if (optim == "Lazy") { xbt_assert(select || xbt_cfg_is_default_value("network/maxmin-selective-update"), "You cannot disable network selective update when using the lazy update mechanism"); select = true; - setUpdateMechanism(kernel::resource::Model::UpdateAlgo::Lazy); - } else { - xbt_die("Unsupported optimization (%s) for this model. Accepted: Full, Lazy.", optim.c_str()); } set_maxmin_system(make_new_lmm_system(select)); loopback_ = NetworkCm02Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE); - - if (getUpdateMechanism() == kernel::resource::Model::UpdateAlgo::Lazy) - get_maxmin_system()->modified_set_ = new kernel::resource::Action::ModifiedSet(); } LinkImpl* NetworkCm02Model::createLink(const std::string& name, double bandwidth, double latency,