From: degomme Date: Mon, 14 Nov 2016 23:04:53 +0000 (-0700) Subject: Add a smpi/grow-injected-times option. X-Git-Tag: v3_14~207^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/81b746a8bf1396a9e957ea63d654f0748a466529 Add a smpi/grow-injected-times option. This is to allow triggering off the default behavior of injected timings growth in MPI_Iprobe and MPI_Test. This behavior allows to simulate faster and avoid looping too much over these calls. But it could also hurt precision of the simulation. --- diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index a56881ac7f..f21667ec54 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -595,6 +595,8 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register_boolean("smpi/privatize-global-variables", "no", nullptr, "Whether we should privatize global variable at runtime."); xbt_cfg_register_alias("smpi/privatize-global-variables", "smpi/privatize_global_variables"); + xbt_cfg_register_boolean("smpi/grow-injected-times", "yes", nullptr, "Whether we want to make the injected time in MPI_Iprobe and MPI_Test grow, to allow faster simulation. This can make simulation less precise, though."); + #if HAVE_PAPI xbt_cfg_register_string("smpi/papi-events", nullptr, nullptr, "This switch enables tracking the specified counters with PAPI"); #endif diff --git a/src/smpi/smpi_base.cpp b/src/smpi/smpi_base.cpp index 453d854592..b7af99977a 100644 --- a/src/smpi/smpi_base.cpp +++ b/src/smpi/smpi_base.cpp @@ -686,7 +686,7 @@ int smpi_mpi_test(MPI_Request * request, MPI_Status * status) { nsleeps=1;//reset the number of sleeps we will do next time if (*request != MPI_REQUEST_NULL && ((*request)->flags & PERSISTENT)==0) *request = MPI_REQUEST_NULL; - }else{ + } else if (xbt_cfg_get_boolean("smpi/grow-injected-times")){ nsleeps++; } } @@ -812,7 +812,8 @@ void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* } else { *flag = 0; - nsleeps++; + if (xbt_cfg_get_boolean("smpi/grow-injected-times")) + nsleeps++; } smpi_mpi_request_free(&request);