From 8454c4dde25913b0c430ceff82aabab70ff0b1a6 Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Thu, 8 May 2014 15:17:37 -1000 Subject: [PATCH 1/1] Added a --cfg="smpi/simulation_computation" to smpirun. The default 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 | 7 +++++++ src/smpi/smpi_bench.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index bd6c7e2ef1..8e456dcc29 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -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); diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index b97f86e4e8..8b37cab4ae 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -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() */ -- 2.20.1