Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix bug in timing injection. Smallest value were ignored...
authordegomme <augustin.degomme@unibas.ch>
Mon, 20 Jun 2016 16:35:18 +0000 (18:35 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Mon, 20 Jun 2016 22:57:13 +0000 (00:57 +0200)
src/simgrid/sg_config.cpp
src/smpi/smpi_base.cpp

index 5047a27..29a8cba 100644 (file)
@@ -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");
index fb4314d..9b09b82 100644 (file)
@@ -117,6 +117,7 @@ static std::vector<s_smpi_factor_multival_t> 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;
 }