Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : store last visited states during exploration
[simgrid.git] / src / mc / mc_global.c
index a42b115..b382d7a 100644 (file)
@@ -63,6 +63,22 @@ void _mc_cfg_cb_timeout(const char *name, int pos) {
   xbt_cfg_set_int(_surf_cfg_set,"model-check",1);
 }
 
+void _mc_cfg_cb_max_depth(const char *name, int pos) {
+  if (_surf_init_status && !_surf_do_model_check) {
+    xbt_die("You are specifying a max depth value after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
+  }
+  _surf_mc_max_depth= xbt_cfg_get_int(_surf_cfg_set, name);
+  xbt_cfg_set_int(_surf_cfg_set,"model-check",1);
+}
+
+void _mc_cfg_cb_stateful(const char *name, int pos) {
+  if (_surf_init_status && !_surf_do_model_check) {
+    xbt_die("You are trying to change stateful mode after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
+  }
+  _surf_mc_stateful= xbt_cfg_get_int(_surf_cfg_set, name);
+  xbt_cfg_set_int(_surf_cfg_set,"model-check",1);
+}
+
 
 /* MC global data structures */
 
@@ -204,13 +220,6 @@ void MC_init_liveness(){
   MC_get_local_variables(ls_path, libsimgrid_location_list, &mc_local_variables);
 
   initial_state_liveness = xbt_new0(s_mc_global_t, 1);
-  initial_state_liveness->snapshot_comparison_times = xbt_dynar_new(sizeof(double), NULL);
-  initial_state_liveness->chunks_used_comparison_times = xbt_dynar_new(sizeof(double), NULL);
-  initial_state_liveness->stacks_sizes_comparison_times = xbt_dynar_new(sizeof(double), NULL);
-  initial_state_liveness->program_data_segment_comparison_times = xbt_dynar_new(sizeof(double), NULL);
-  initial_state_liveness->libsimgrid_data_segment_comparison_times = xbt_dynar_new(sizeof(double), NULL);
-  initial_state_liveness->heap_comparison_times = xbt_dynar_new(sizeof(double), NULL);
-  initial_state_liveness->stacks_comparison_times = xbt_dynar_new(sizeof(double), NULL);
 
   MC_UNSET_RAW_MEM;
 
@@ -612,6 +621,9 @@ void MC_print_statistics_pairs(mc_stats_pair_t stats)
   //XBT_INFO("Executed transitions = %lu", stats->executed_transitions);
   XBT_INFO("Expanded / Visited = %lf",
            (double) stats->visited_pairs / stats->expanded_pairs);
+
+  if(mmalloc_get_current_heap() == raw_heap)
+    MC_UNSET_RAW_MEM;
 }
 
 void MC_assert(int prop)