Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new option to any SimGrid-based simulator: --cfg=model-check:1 (for now, that's a...
[simgrid.git] / src / surf / surf.c
index b33f395..a963b61 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "surf_private.h"
 #include "xbt/module.h"
 
 #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)");
 
 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
 }
 
 #endif
 }
 
-static double NOW = 0;
+double NOW = 0;
 
 xbt_dynar_t model_list = NULL;
 tmgr_history_t history = NULL;
 
 xbt_dynar_t model_list = NULL;
 tmgr_history_t history = NULL;
@@ -252,6 +253,10 @@ XBT_LOG_EXTERNAL_CATEGORY(surf_network_gtnets);
 
 void surf_init(int *argc, char **argv)
 {
 
 void surf_init(int *argc, char **argv)
 {
+
+  if (_surf_do_model_check)
+    MC_memory_init();
+  
   /* Connect our log channels: that must be done manually under windows */
   XBT_LOG_CONNECT(surf_cpu, surf);
   XBT_LOG_CONNECT(surf_kernel, surf);
   /* Connect our log channels: that must be done manually under windows */
   XBT_LOG_CONNECT(surf_cpu, surf);
   XBT_LOG_CONNECT(surf_kernel, surf);
@@ -337,7 +342,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 */
   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)
 }
 
 void surf_presolve(void)