Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Cross-process xbt_swag_size(simix_global->process_list)
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 7 Apr 2015 08:56:13 +0000 (10:56 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 7 Apr 2015 09:01:11 +0000 (11:01 +0200)
src/mc/mc_visited.c

index 281eb58..cf37ea6 100644 (file)
@@ -64,7 +64,8 @@ static mc_visited_state_t visited_state_new()
     new_state->nb_processes = xbt_swag_size(simix_global->process_list);
   } else {
     MC_process_smx_refresh(&mc_model_checker->process);
-    new_state->nb_processes = xbt_dynar_length(mc_model_checker->process.smx_process_infos);
+    new_state->nb_processes = xbt_dynar_length(
+      mc_model_checker->process.smx_process_infos);
   }
 
   new_state->system_state = MC_take_snapshot(mc_stats->expanded_states);
@@ -84,7 +85,13 @@ mc_visited_pair_t MC_visited_pair_new(int pair_num, xbt_automaton_state_t automa
   pair->heap_bytes_used = mmalloc_get_bytes_used_remote(
     MC_process_get_heap(process)->heaplimit,
     MC_process_get_malloc_info(process));
-  pair->nb_processes = xbt_swag_size(simix_global->process_list);
+  if (MC_process_is_self(&mc_model_checker->process)) {
+    pair->nb_processes = xbt_swag_size(simix_global->process_list);
+  } else {
+    MC_process_smx_refresh(&mc_model_checker->process);
+    pair->nb_processes = xbt_dynar_length(
+      mc_model_checker->process.smx_process_infos);
+  }
   pair->automaton_state = automaton_state;
   pair->num = pair_num;
   pair->other_num = -1;