Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added a --cfg="smpi/simulation_computation" to smpirun. The default
authorHenri Casanova <henric@hawaii.edu>
Fri, 9 May 2014 01:17:37 +0000 (15:17 -1000)
committerHenri Casanova <henric@hawaii.edu>
Fri, 9 May 2014 01:17:37 +0000 (15:17 -1000)
value is "yes", meaning that SMPI will benchmark computational parts
of the simulation application and simulate them using smpi_execute(), as
it's always been done in the past.

Disabling the simulation of computation is useful when smpirunning an "application"
that is in fact doing a "live replay" of another MPI app (e.g., ScalaTrace's replay tool, various on-line simulators that run an app at scale). In this case the computation due to the replay logic
should be be simulated by SMPI.

For the time being, for smpirunning such an "application", the approach is:
1. use --cfg="smpi/simulation_computation:no"
2. add calls to smpi_execute() in the "application"

src/simgrid/sg_config.c
src/smpi/smpi_bench.c

index bd6c7e2..8e456dc 100644 (file)
@@ -765,6 +765,11 @@ void sg_config_init(int *argc, char **argv)
                      xbt_cfgelm_boolean, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/display_timing", "no");
 
+    xbt_cfg_register(&_sg_cfg_set, "smpi/simulate_computation",
+                     "Boolean indicating whether the computational part of the simulated application should be simulated.",
+                     xbt_cfgelm_boolean, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/simulate_computation", "yes");
+
     xbt_cfg_register(&_sg_cfg_set, "smpi/use_shared_malloc",
                      "Boolean indicating whether we should use shared memory when using SMPI_SHARED_MALLOC. Allows user to disable it for debug purposes.",
                      xbt_cfgelm_boolean, 1, 1, NULL, NULL);
@@ -819,10 +824,12 @@ void sg_config_init(int *argc, char **argv)
                      "Small messages timings (MPI_Recv minimum time for small messages)",
                      xbt_cfgelm_string, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/or", "1:0:0:0:0");
+
     xbt_cfg_register(&_sg_cfg_set, "smpi/iprobe",
                      "Minimum time to inject inside a call to MPI_Iprobe",
                      xbt_cfgelm_double, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/iprobe", 1e-4);
+
     xbt_cfg_register(&_sg_cfg_set, "smpi/coll_selector",
                      "Which collective selector to use",
                      xbt_cfgelm_string, 1, 1, NULL, NULL);
index b97f86e..8b37cab 100644 (file)
@@ -206,7 +206,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() */