Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
attempt to get everything properly cleaned when only using --help and friends
[simgrid.git] / src / surf / surf_config.c
index 32b361a..e74032a 100644 (file)
@@ -20,6 +20,12 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf,
 
 xbt_cfg_t _surf_cfg_set = NULL;
 
+int _surf_init_status = 0;      /* 0: beginning of time (config cannot be changed yet);
+                                   1: initialized: cfg_set created (config can now be changed);
+                                   2: configured: command line parsed and config part of platform file was integrated also, platform construction ongoing or done.
+                                      (Config cannot be changed anymore!) */
+
+
 /* Parse the command line, looking for options */
 static void surf_config_cmd_line(int *argc, char **argv)
 {
@@ -81,16 +87,13 @@ static void surf_config_cmd_line(int *argc, char **argv)
     argv[j] = NULL;
     *argc = j;
   }
-  if (shall_exit)
+  if (shall_exit) {
+    _surf_init_status=1; // get everything cleanly cleaned on exit
     exit(0);
+  }
 }
 
 
-int _surf_init_status = 0;      /* 0: beginning of time (config cannot be changed yet);
-                                   1: initialized: cfg_set created (config can now be changed);
-                                   2: configured: command line parsed and config part of platform file was integrated also, platform construction ongoing or done.
-                                      (Config cannot be changed anymore!) */
-
 /* callback of the workstation/model variable */
 static void _surf_cfg_cb__workstation_model(const char *name, int pos)
 {
@@ -533,9 +536,9 @@ void surf_config_init(int *argc, char **argv)
                      _mc_cfg_cb_max_depth, NULL);
 
     /* Set number of visited state stored in stateful mode */
-    default_value_int = 10;
+    default_value_int = 0;
     xbt_cfg_register(&_surf_cfg_set, "model-check/stateful",
-                     "Specify the number of visited state stored in stateful mode. The default value is 10 which means that we only keep in memory the last 10 visited states",
+                     "Specify the number of visited state stored in stateful mode. If value=5, the last 5 visited states are stored",
                      xbt_cfgelm_int, &default_value, 0, 1,
                      _mc_cfg_cb_stateful, NULL);
 #endif