From 766da6343971d93f860c3b336ab3813f2e0ba404 Mon Sep 17 00:00:00 2001 From: degomme Date: Mon, 20 Jun 2016 18:35:18 +0200 Subject: [PATCH] Fix bug in timing injection. Smallest value were ignored... --- src/simgrid/sg_config.cpp | 6 +++--- src/smpi/smpi_base.cpp | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 5047a27c0f..29a8cba1e2 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -591,9 +591,9 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register_string("smpi/papi-events", nullptr, nullptr, "This switch enables tracking the specified counters with PAPI"); #endif xbt_cfg_register_string("smpi/comp-adjustment-file", nullptr, nullptr, "A file containing speedups or slowdowns for some parts of the code."); - xbt_cfg_register_string("smpi/os", "1:0:0:0:0", nullptr, "Small messages timings (MPI_Send minimum time for small messages)"); - xbt_cfg_register_string("smpi/ois", "1:0:0:0:0", nullptr, "Small messages timings (MPI_Isend minimum time for small messages)"); - xbt_cfg_register_string("smpi/or", "1:0:0:0:0", nullptr, "Small messages timings (MPI_Recv minimum time for small messages)"); + xbt_cfg_register_string("smpi/os", "0:0:0:0:0", nullptr, "Small messages timings (MPI_Send minimum time for small messages)"); + 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_string("smpi/coll-selector", "default", nullptr, "Which collective selector to use"); xbt_cfg_register_alias("smpi/coll-selector","smpi/coll_selector"); diff --git a/src/smpi/smpi_base.cpp b/src/smpi/smpi_base.cpp index fb4314d342..9b09b82a21 100644 --- a/src/smpi/smpi_base.cpp +++ b/src/smpi/smpi_base.cpp @@ -117,6 +117,7 @@ static std::vector parse_factor(const char *smpi_coef_ */ for (Tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); token_iter++) { +XBT_DEBUG("token : %s", token_iter->c_str()); Tokenizer factor_values(*token_iter, factor_separator); if (factor_values.begin() == factor_values.end()) { @@ -154,7 +155,7 @@ static double smpi_os(size_t size) if (smpi_os_values.empty()) { smpi_os_values = parse_factor(xbt_cfg_get_string("smpi/os")); } - double current=0.0; + double current=smpi_os_values.empty()?0.0:smpi_os_values[0].values[0]+smpi_os_values[0].values[1]*size; // Iterate over all the sections that were specified and find the right // value. (fact.factor represents the interval sizes; we want to find the // section that has fact.factor <= size and no other such fact.factor <= size) @@ -170,7 +171,7 @@ static double smpi_os(size_t size) current = fact.values[0]+fact.values[1]*size; } } - XBT_DEBUG("Searching for smpi/os: %zu is larger than the largest boundary, return %f", size, current); + XBT_DEBUG("Searching for smpi/os: %zu is larger than the largest boundary, return %.10f", size, current); return current; } @@ -180,7 +181,7 @@ static double smpi_ois(size_t size) if (smpi_ois_values.empty()) { smpi_ois_values = parse_factor(xbt_cfg_get_string("smpi/ois")); } - double current=0.0; + double current=smpi_ois_values.empty()?0.0:smpi_ois_values[0].values[0]+smpi_ois_values[0].values[1]*size; // Iterate over all the sections that were specified and find the right value. (fact.factor represents the interval // sizes; we want to find the section that has fact.factor <= size and no other such fact.factor <= size) // Note: parse_factor() (used before) already sorts the dynar we iterate over! @@ -194,7 +195,7 @@ static double smpi_ois(size_t size) current = fact.values[0]+fact.values[1]*size; } } - XBT_DEBUG("Searching for smpi/ois: %zu is larger than the largest boundary, return %f", size, current); + XBT_DEBUG("Searching for smpi/ois: %zu is larger than the largest boundary, return %.10f", size, current); return current; } @@ -204,7 +205,8 @@ static double smpi_or(size_t size) if (smpi_or_values.empty()) { smpi_or_values = parse_factor(xbt_cfg_get_string("smpi/or")); } - double current=0.0; + + double current=smpi_or_values.empty()?0.0:smpi_or_values[0].values[0]+smpi_or_values[0].values[1]*size; // Iterate over all the sections that were specified and find the right value. (fact.factor represents the interval // sizes; we want to find the section that has fact.factor <= size and no other such fact.factor <= size) // Note: parse_factor() (used before) already sorts the dynar we iterate over! @@ -219,7 +221,7 @@ static double smpi_or(size_t size) current=fact.values[0]+fact.values[1]*size; } } - XBT_DEBUG("smpi_or: %zu is larger than largest boundary, return %f", size, current); + XBT_DEBUG("smpi_or: %zu is larger than largest boundary, return %.10f", size, current); return current; } -- 2.20.1