Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Default is not to use sleep-set to agree with existing tests
[simgrid.git] / src / simgrid / module.cpp
index 45cf4a8..2ed2f70 100644 (file)
@@ -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<std::string>(opt_name_)).init();
+}
 
 ModuleGroup& ModuleGroup::add(const char* id, const char* desc, std::function<void()> 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);
-}