X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b3b24aba0295501c73c2e057fda75108808cdad4..3fafdab4bb94b48cb16c80690408a18f472e202b:/src/simgrid/module.cpp diff --git a/src/simgrid/module.cpp b/src/simgrid/module.cpp index 45cf4a8f54..2ed2f70beb 100644 --- a/src/simgrid/module.cpp +++ b/src/simgrid/module.cpp @@ -20,6 +20,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,6 +43,10 @@ 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() +{ + by_name(simgrid::config::get_value(opt_name_)).init(); +} ModuleGroup& ModuleGroup::add(const char* id, const char* desc, std::function init) { @@ -74,30 +79,3 @@ std::string ModuleGroup::existing_values() const } return ss.str(); } - -/* -------------------------------------------------------------------------------------------------------------- */ -simgrid::ModuleGroup surf_optimization_mode_description("optimization mode"); -simgrid::ModuleGroup surf_disk_model_description("disk model"); -simgrid::ModuleGroup surf_host_model_description("host model"); - -void simgrid_create_models() -{ - surf_disk_model_description.add("S19", "Simplistic disk model.", &surf_disk_model_init_S19); - - surf_host_model_description - .add("default", - "Default host model. Currently, CPU:Cas01, network:LV08 (with cross traffic enabled), and disk:S19", - &surf_host_model_init_current_default) - .add("compound", "Host model that is automatically chosen if you change the CPU, network, and disk models", - &surf_host_model_init_compound) - .add("ptask_L07", "Host model somehow similar to Cas01+CM02+S19 but allowing parallel tasks", - &surf_host_model_init_ptask_L07); - - 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); -}