Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[smpi] Fix typo when fixing memory allocation (again)
[simgrid.git] / src / smpi / smpi_bench.c
index d35c50c..393c850 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>
@@ -190,11 +191,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 +727,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