Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[smpi] Restore privatisation mapping smpi_execute()
[simgrid.git] / src / smpi / smpi_bench.c
index d35c50c..7207e64 100644 (file)
@@ -12,6 +12,7 @@
 #include "xbt/hash.h"
 #include "surf/surf.h"
 #include "simgrid/sg_config.h"
+#include "simgrid/modelchecker.h"
 
 #ifndef WIN32
 #include <sys/mman.h>
@@ -159,6 +160,7 @@ void smpi_execute_flops(double flops) {
   simcall_set_category (action, TRACE_internal_smpi_get_category());
 #endif
   simcall_host_execution_wait(action);
+  smpi_switch_data_segment(smpi_process_index());
 }
 
 void smpi_execute(double duration)
@@ -190,11 +192,19 @@ void smpi_switch_data_segment(int dest);
 void smpi_bench_begin(void)
 {
   smpi_switch_data_segment(smpi_process_index());
+
+  if(MC_is_active())
+    return;
+
   xbt_os_threadtimer_start(smpi_process_timer());
 }
 
 void smpi_bench_end(void)
 {
+
+  if(MC_is_active())
+    return;
+
   xbt_os_timer_t timer = smpi_process_timer();
   xbt_os_threadtimer_stop(timer);
 //  smpi_switch_data_segment(smpi_process_count());
@@ -718,7 +728,7 @@ void smpi_initialize_global_memory_segments(){
   }
 
   smpi_privatisation_regions = (smpi_privatisation_region_t) malloc(
-    sizeof(struct s_smpi_privatisation_region) * sizeof(int));
+    smpi_process_count() * sizeof(struct s_smpi_privatisation_region));
 
   for (i=0; i< SIMIX_process_count(); i++){
       //create SIMIX_process_count() mappings of this size with the same data inside