Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Introduced smpi/iprobe-cpu-usage option.
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 8 Feb 2017 16:00:25 +0000 (17:00 +0100)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 3 Mar 2017 15:24:23 +0000 (16:24 +0100)
This option allows us to account for lower energy consumption for
Iprobes. The value here must be larger than 0 and at most 1 (with 1 being the default)

doc/doxygen/options.doc
src/simgrid/sg_config.cpp
src/smpi/smpi_base.cpp

index 4b16add..59a5761 100644 (file)
@@ -952,6 +952,18 @@ uses naive version of collective operations). Each collective operation can be m
 The behavior and motivation for this configuration option is identical with \a smpi/test, see
 Section \ref options_model_smpi_test for details.
 
+\subsection options_model_smpi_iprobe_cpu_usage smpi/iprobe-cpu-usage: Reduce speed for iprobe calls
+
+\b Default value: 1 (no change from default behavior)
+
+MPI_Iprobe calls can be heavily used in applications. To account correctly for the energy
+cores spend probing, it is necessary to reduce the load that these calls cause inside
+SimGrid.
+
+For instance, we measured a max power consumption of 220 W for a particular application but 
+only 180 W while this application was probing. Hence, the correct factor that should
+be passed to this option would be 180/220 = 0.81.
+
 \subsection options_model_smpi_init smpi/init: Inject constant times for calls to MPI_Init
 
 \b Default value: 0
@@ -1224,6 +1236,7 @@ It can be done by using XBT. Go to \ref XBT_log for more details.
 - \c smpi/host-speed: \ref options_smpi_bench
 - \c smpi/IB-penalty-factors: \ref options_model_network_coefs
 - \c smpi/iprobe: \ref options_model_smpi_iprobe
+- \c smpi/iprobe-cpu-usage: \ref options_model_smpi_iprobe_cpu_usage
 - \c smpi/init: \ref options_model_smpi_init
 - \c smpi/lat-factor: \ref options_model_smpi_lat_factor
 - \c smpi/ois: \ref options_model_smpi_ois
index d961fbc..900285a 100644 (file)
@@ -572,6 +572,8 @@ void sg_config_init(int *argc, char **argv)
     xbt_cfg_register_string("smpi/ois", "0:0:0:0:0", nullptr, "Small messages timings (MPI_Isend minimum time for small messages)");
     xbt_cfg_register_string("smpi/or", "0:0:0:0:0", nullptr,  "Small messages timings (MPI_Recv minimum time for small messages)");
 
+    xbt_cfg_register_double("smpi/iprobe-cpu-usage", 1, nullptr, "Maximum usage of CPUs by MPI_Iprobe() calls. We've observed that MPI_Iprobes consume significantly less power than the maximum of a specific application. This value is then (Iprobe_Usage/Max_Application_Usage).");
+
     xbt_cfg_register_string("smpi/coll-selector", "default", nullptr, "Which collective selector to use");
     xbt_cfg_register_alias("smpi/coll-selector","smpi/coll_selector");
     xbt_cfg_register_string("smpi/gather",        nullptr, &_check_coll_gather, "Which collective to use for gather");
index f7f3b77..89d3000 100644 (file)
@@ -780,8 +780,12 @@ void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   // (especially when used as a break condition, such as while(MPI_Iprobe(...)) ... )
   // multiplier to the sleeptime, to increase speed of execution, each failed iprobe will increase it
   static int nsleeps = 1;
-  if(smpi_iprobe_sleep > 0)  
-    simcall_process_sleep(nsleeps*smpi_iprobe_sleep);
+  double speed = simgrid::s4u::Actor::self()->getHost()->speed();
+  double maxrate = xbt_cfg_get_double("smpi/iprobe-cpu-usage");
+  if (smpi_iprobe_sleep > 0) {
+    smx_activity_t iprobe_sleep = simcall_execution_start("iprobe", /* flops to executek*/nsleeps*smpi_iprobe_sleep*speed*maxrate, /* priority */1.0, /* performance bound */maxrate*speed);
+    simcall_execution_wait(iprobe_sleep);
+  }
   // behave like a receive, but don't do it
   smx_mailbox_t mailbox;