Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some cleanup around model description tables.
[simgrid.git] / src / simgrid / sg_config.cpp
index ece3d08..d7e6bdb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -122,12 +122,12 @@ static void _sg_cfg_cb__plugin(const std::string& value)
     return;
 
   if (value == "help") {
-    model_help("plugin", *surf_plugin_description);
+    model_help("plugin", surf_plugin_description());
     exit(0);
   }
 
-  int plugin_id = find_model_description(*surf_plugin_description, value);
-  (*surf_plugin_description)[plugin_id].model_init_preparse();
+  const auto* plugin = find_model_description(surf_plugin_description(), value);
+  plugin->model_init_preparse();
 }
 
 /* callback of the host/model variable */
@@ -184,19 +184,6 @@ static void _sg_cfg_cb__disk_model(const std::string& value)
   find_model_description(surf_disk_model_description, value);
 }
 
-/* callback of the cpu/model variable */
-static void _sg_cfg_cb__storage_model(const std::string& value)
-{
-  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
-
-  if (value == "help") {
-    model_help("storage", surf_storage_model_description);
-    exit(0);
-  }
-
-  find_model_description(surf_storage_model_description, value);
-}
-
 /* callback of the network_model variable */
 static void _sg_cfg_cb__network_model(const std::string& value)
 {
@@ -251,7 +238,7 @@ void sg_config_init(int *argc, char **argv)
   }
 
   /* Plugins configuration */
-  declare_model_flag("plugin", "", &_sg_cfg_cb__plugin, *surf_plugin_description, "plugin", "The plugins");
+  declare_model_flag("plugin", "", &_sg_cfg_cb__plugin, surf_plugin_description(), "plugin", "The plugins");
 
   declare_model_flag("cpu/model", "Cas01", &_sg_cfg_cb__cpu_model, surf_cpu_model_description, "model",
                      "The model to use for the CPU");
@@ -259,9 +246,6 @@ void sg_config_init(int *argc, char **argv)
   declare_model_flag("disk/model", "default", &_sg_cfg_cb__disk_model, surf_disk_model_description, "model",
                      "The model to use for the disk");
 
-  declare_model_flag("storage/model", "default", &_sg_cfg_cb__storage_model, surf_storage_model_description, "model",
-                     "The model to use for the storage");
-
   declare_model_flag("network/model", "LV08", &_sg_cfg_cb__network_model, surf_network_model_description, "model",
                      "The model to use for the network");