-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=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)
- // Note: parse_factor() (used before) already sorts the vector we iterate over!
- for (auto& fact : smpi_os_values) {
- if (size <= fact.factor) { // Values already too large, use the previously computed value of current!
- XBT_DEBUG("os : %zu <= %zu return %.10f", size, fact.factor, current);
- return current;
- }else{
- // If the next section is too large, the current section must be used.
- // Hence, save the cost, as we might have to use it.
- current = fact.values[0]+fact.values[1]*size;
- }
- }
- XBT_DEBUG("Searching for smpi/os: %zu is larger than the largest boundary, return %.10f", size, current);
-
- return current;
-}
-
-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=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 vector we iterate over!
- for (auto& fact : smpi_ois_values) {
- if (size <= fact.factor) { // Values already too large, use the previously computed value of current!
- XBT_DEBUG("ois : %zu <= %zu return %.10f", size, fact.factor, current);
- return current;
- }else{
- // If the next section is too large, the current section must be used.
- // Hence, save the cost, as we might have to use it.
- current = fact.values[0]+fact.values[1]*size;
- }
- }
- XBT_DEBUG("Searching for smpi/ois: %zu is larger than the largest boundary, return %.10f", size, current);
-
- return current;
-}
-
-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=smpi_or_values.empty()?0.0:smpi_or_values.front().values[0]+smpi_or_values.front().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 vector we iterate over!
- for (auto fact : smpi_or_values) {
- if (size <= fact.factor) { // Values already too large, use the previously computed value of current!
- XBT_DEBUG("or : %zu <= %zu return %.10f", size, fact.factor, current);
- return current;
- } else {
- // If the next section is too large, the current section must be used.
- // Hence, save the cost, as we might have to use it.
- current=fact.values[0]+fact.values[1]*size;
- }
- }
- XBT_DEBUG("smpi_or: %zu is larger than largest boundary, return %.10f", size, current);
-
- return current;
-}
-