From cba941895d9d4ebfa7db99954d8585039dc9b88a Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Wed, 8 Feb 2017 17:00:25 +0100 Subject: [PATCH] [SMPI] Introduced smpi/iprobe-cpu-usage option. 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 | 13 +++++++++++++ src/simgrid/sg_config.cpp | 2 ++ src/smpi/smpi_base.cpp | 8 ++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/doc/doxygen/options.doc b/doc/doxygen/options.doc index 4b16add364..59a5761bd4 100644 --- a/doc/doxygen/options.doc +++ b/doc/doxygen/options.doc @@ -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 diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index d961fbc51e..900285aca8 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -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"); diff --git a/src/smpi/smpi_base.cpp b/src/smpi/smpi_base.cpp index f7f3b7728b..89d3000bf8 100644 --- a/src/smpi/smpi_base.cpp +++ b/src/smpi/smpi_base.cpp @@ -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; -- 2.20.1