Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix: initialize the model checker memory subsystem after parsing the configuration
[simgrid.git] / src / surf / surf.c
index b33f395..5b60328 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "surf_private.h"
 #include "xbt/module.h"
+#include "mc/mc.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
                                 "Logging specific to SURF (kernel)");
@@ -102,7 +103,7 @@ int __surf_is_absolute_file_path(const char *file_path)
 #endif
 }
 
-static double NOW = 0;
+double NOW = 0;
 
 xbt_dynar_t model_list = NULL;
 tmgr_history_t history = NULL;
@@ -251,7 +252,7 @@ XBT_LOG_EXTERNAL_CATEGORY(surf_network_gtnets);
 #endif
 
 void surf_init(int *argc, char **argv)
-{
+{ 
   /* Connect our log channels: that must be done manually under windows */
   XBT_LOG_CONNECT(surf_cpu, surf);
   XBT_LOG_CONNECT(surf_kernel, surf);
@@ -277,6 +278,9 @@ void surf_init(int *argc, char **argv)
     history = tmgr_history_new();
 
   surf_config_init(argc, argv);
+
+  if (_surf_do_model_check)
+    MC_memory_init();
 }
 
 #ifdef WIN32
@@ -337,7 +341,6 @@ void surf_exit(void)
   surf_parse_free_callbacks();
   xbt_dict_free(&route_table);
   NOW = 0;                      /* Just in case the user plans to restart the simulation afterward */
-  xbt_exit();
 }
 
 void surf_presolve(void)