Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a smpi/grow-injected-times option.
authordegomme <augustin.degomme@unibas.ch>
Mon, 14 Nov 2016 23:04:53 +0000 (16:04 -0700)
committerdegomme <augustin.degomme@unibas.ch>
Mon, 14 Nov 2016 23:04:53 +0000 (16:04 -0700)
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.

src/simgrid/sg_config.cpp
src/smpi/smpi_base.cpp

index a56881a..f21667e 100644 (file)
@@ -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
index 453d854..b7af999 100644 (file)
@@ -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);