X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ceb611208adf5d508d4c111cd542337a4ac906be..8c6bbb14f44b8daed5ea43d80880c6bf2155118b:/src/simgrid/module.cpp diff --git a/src/simgrid/module.cpp b/src/simgrid/module.cpp index 70b857f3f2..5724971873 100644 --- a/src/simgrid/module.cpp +++ b/src/simgrid/module.cpp @@ -6,9 +6,8 @@ #include #include -#include "simgrid/sg_config.hpp" #include "src/simgrid/module.hpp" -#include "src/surf/surf_interface.hpp" +#include "src/simgrid/sg_config.hpp" #include @@ -20,6 +19,7 @@ using namespace simgrid; void ModuleGroup::create_flag(const std::string& opt_name, const std::string& descr, const std::string& default_value, bool init_now) { + opt_name_ = opt_name; std::string description = descr + ". Possible values (other compilation flags may activate more " + get_kind() + "s): " + existing_values() + ".\n (use 'help' as a value to see the long description of each one)"; @@ -42,10 +42,14 @@ void ModuleGroup::create_flag(const std::string& opt_name, const std::string& de by_name(value); // Simply ensure that this value exists, it will be picked up later }); } +void ModuleGroup::init_from_flag_value() const +{ + by_name(simgrid::config::get_value(opt_name_)).init(); +} ModuleGroup& ModuleGroup::add(const char* id, const char* desc, std::function init) { - table_.emplace_back(Module(id, desc, init)); + table_.emplace_back(id, desc, std::move(init)); return *this; } @@ -74,17 +78,3 @@ std::string ModuleGroup::existing_values() const } return ss.str(); } - -/* -------------------------------------------------------------------------------------------------------------- */ -simgrid::ModuleGroup surf_optimization_mode_description("optimization mode"); - -void simgrid_create_models() -{ - surf_optimization_mode_description - .add("Lazy", "Lazy action management (partial invalidation in lmm + heap in action remaining).", nullptr) - .add("TI", - "Trace integration. Highly optimized mode when using availability traces (only available for the Cas01 CPU " - "model for now).", - nullptr) - .add("Full", "Full update of remaining and variables. Slow but may be useful when debugging.", nullptr); -}