Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill f2c. Finally. I hope.
[simgrid.git] / src / smpi / smpi_bench.c
index b97f86e..e33d659 100644 (file)
@@ -69,7 +69,6 @@ xbt_dict_t allocs = NULL;          /* Allocated on first use */
 xbt_dict_t allocs_metadata = NULL; /* Allocated on first use */
 xbt_dict_t samples = NULL;         /* Allocated on first use */
 xbt_dict_t calls = NULL;           /* Allocated on first use */
-__thread int smpi_current_rank = 0;      /* Updated after each MPI call */
 
 double smpi_cpu_threshold;
 double smpi_running_power;
@@ -118,7 +117,7 @@ static void* shm_map(int fd, size_t size, shared_data_t* data) {
     xbt_die("Could not map fd %d: %s", fd, strerror(errno));
   }
   if(!allocs_metadata) {
-    allocs_metadata = xbt_dict_new_homogeneous(xbt_free);
+    allocs_metadata = xbt_dict_new_homogeneous(xbt_free_f);
   }
   snprintf(loc, PTR_STRLEN, "%p", mem);
   meta = xbt_new(shared_metadata_t, 1);
@@ -192,7 +191,6 @@ void smpi_bench_begin(void)
 {
   switch_data_segment(smpi_process_index());
   xbt_os_threadtimer_start(smpi_process_timer());
-  smpi_current_rank = smpi_process_index();
 }
 
 void smpi_bench_end(void)
@@ -206,7 +204,10 @@ void smpi_bench_end(void)
     xbt_backtrace_display_current();
     xbt_die("Aborting.");
   }
-  smpi_execute(xbt_os_timer_elapsed(timer));
+  // Simulate the benchmarked computation unless disabled via command-line argument
+  if (sg_cfg_get_boolean("smpi/simulate_computation")) {
+    smpi_execute(xbt_os_timer_elapsed(timer));
+  }
 }
 
 /* Private sleep function used by smpi_sleep() and smpi_usleep() */