Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Add support of privatized global variables in per-page snapshot
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 24 Jun 2014 12:51:10 +0000 (14:51 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 24 Jun 2014 13:57:31 +0000 (15:57 +0200)
Not very useful because state comparison does not work with SMPI
privatisation yet.

src/mc/mc_checkpoint.c
src/mc/mc_compare.cpp

index c07f666..abb2dee 100644 (file)
@@ -166,9 +166,10 @@ static void MC_get_memory_regions(mc_snapshot_t snapshot)
     snapshot->privatization_regions =
         xbt_new(mc_mem_region_t, SIMIX_process_count());
     for (i = 0; i < SIMIX_process_count(); i++) {
     snapshot->privatization_regions =
         xbt_new(mc_mem_region_t, SIMIX_process_count());
     for (i = 0; i < SIMIX_process_count(); i++) {
-      // TODO, add support for sparse snapshot
+      mc_mem_region_t ref_reg =
+        mc_model_checker->parent_snapshot ? mc_model_checker->parent_snapshot->privatization_regions[i] : NULL;
       snapshot->privatization_regions[i] =
       snapshot->privatization_regions[i] =
-        MC_region_new(-1, mappings[i], size_data_exe, NULL);
+        MC_region_new(-1, mappings[i], size_data_exe, ref_reg);
     }
     snapshot->privatization_index = loaded_page;
   }
     }
     snapshot->privatization_index = loaded_page;
   }
index 6eaa3bf..ada39e6 100644 (file)
@@ -246,6 +246,8 @@ static int compare_global_variables(int region_type, mc_mem_region_t r1,
                                     mc_mem_region_t r2, mc_snapshot_t snapshot1,
                                     mc_snapshot_t snapshot2)
 {
                                     mc_mem_region_t r2, mc_snapshot_t snapshot1,
                                     mc_snapshot_t snapshot2)
 {
+  xbt_assert(r1 && r2,
+    "Missing region. Did you enable SMPI privatisation? It is not compatible with state comparison.");
   struct mc_compare_state state;
 
   xbt_dynar_t variables;
   struct mc_compare_state state;
 
   xbt_dynar_t variables;