-double surf_parse_get_size(const char* string, const char* entity_kind, const std::string& name)
-{
- static const unit_scale units{std::make_tuple("b", 0.125, 2, true), std::make_tuple("b", 0.125, 10, true),
- std::make_tuple("B", 1.0, 2, true), std::make_tuple("B", 1.0, 10, true)};
- return surf_parse_get_value_with_unit(string, units, entity_kind, name,
- "Append 'B' to get bytes (or 'b' for bits but 1B = 8b).", "B");
-}
-
-double surf_parse_get_bandwidth(const char* string, const char* entity_kind, const std::string& name)
-{
- static const unit_scale units{std::make_tuple("bps", 0.125, 2, true), std::make_tuple("bps", 0.125, 10, true),
- std::make_tuple("Bps", 1.0, 2, true), std::make_tuple("Bps", 1.0, 10, true)};
- return surf_parse_get_value_with_unit(string, units, entity_kind, name,
- "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps");
-}
-
-std::vector<double> surf_parse_get_bandwidths(const char* string, const char* entity_kind, const std::string& name)
-{
- static const unit_scale units{std::make_tuple("bps", 0.125, 2, true), std::make_tuple("bps", 0.125, 10, true),
- std::make_tuple("Bps", 1.0, 2, true), std::make_tuple("Bps", 1.0, 10, true)};
-
- std::vector<double> bandwidths;
- std::vector<std::string> tokens;
- boost::split(tokens, string, boost::is_any_of(";"));
- for (auto token : tokens) {
- bandwidths.push_back(surf_parse_get_value_with_unit(
- token.c_str(), units, entity_kind, name,
- "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps"));
- }
-
- return bandwidths;
-}
-
-double surf_parse_get_speed(const char* string, const char* entity_kind, const std::string& name)
-{
- static const unit_scale units{std::make_tuple("f", 1.0, 10, true), std::make_tuple("flops", 1.0, 10, false)};
- return surf_parse_get_value_with_unit(string, units, entity_kind, name,
- "Append 'f' or 'flops' to your speed to get flop per second", "f");
-}
-
-static std::vector<double> surf_parse_get_all_speeds(char* speeds, const char* entity_kind, const std::string& id)
-{
-
- std::vector<double> speed_per_pstate;
-
- if (strchr(speeds, ',') == nullptr){
- double speed = surf_parse_get_speed(speeds, entity_kind, id);
- speed_per_pstate.push_back(speed);
- } else {
- std::vector<std::string> pstate_list;
- boost::split(pstate_list, speeds, boost::is_any_of(","));
- for (auto speed_str : pstate_list) {
- boost::trim(speed_str);
- double speed = surf_parse_get_speed(speed_str.c_str(), entity_kind, id);
- speed_per_pstate.push_back(speed);
- XBT_DEBUG("Speed value: %f", speed);
- }
- }
- return speed_per_pstate;
-}