To make it optional (as parse_factor is used for actual factors and not only seconds on some occasions), remove the warning in surf if a unit-less value is used.
#include "xbt/log.h"
#include "xbt/sysdep.h"
#include <boost/tokenizer.hpp>
#include "xbt/log.h"
#include "xbt/sysdep.h"
#include <boost/tokenizer.hpp>
+#include "src/surf/xml/platf_private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (utils)");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (utils)");
- fact.values.push_back(std::stod(*factor_iter));
+ fact.values.push_back(surf_parse_get_time((*factor_iter).c_str(), "smpi factor", std::to_string(smpi_factor.size() + 1) + ": " + *factor_iter));
} catch (std::invalid_argument& ia) {
throw std::invalid_argument(std::string("Invalid factor value ") + std::to_string(iteration) + " in chunk " +
std::to_string(smpi_factor.size() + 1) + ": " + *factor_iter);
} catch (std::invalid_argument& ia) {
throw std::invalid_argument(std::string("Invalid factor value ") + std::to_string(iteration) + " in chunk " +
std::to_string(smpi_factor.size() + 1) + ": " + *factor_iter);
if (ptr == string)
surf_parse_error(std::string("cannot parse number:") + string);
if (ptr[0] == '\0') {
if (ptr == string)
surf_parse_error(std::string("cannot parse number:") + string);
if (ptr[0] == '\0') {
- if (res == 0)
- return res; // Ok, 0 can be unit-less
-
- XBT_WARN("Deprecated unit-less value '%s' for %s %s. %s", string, entity_kind, name.c_str(), error_msg);
ptr = (char*)default_unit;
}
auto u = units.find(ptr);
ptr = (char*)default_unit;
}
auto u = units.find(ptr);