- xbt_dynar_t current_power_values = xbt_str_split(xbt_dynar_get_as(all_power_values, i, char*), ":");
- xbt_assert(xbt_dynar_length(current_power_values) == 3,
- "Power properties incorrectly defined - could not retrieve idle, min and max power values for host %s",
- host->cname());
+ std::vector<std::string> current_power_values;
+ boost::split(current_power_values, current_power_values_str, boost::is_any_of(":"));
+ if (host->getCoreCount() == 1) {
+ xbt_assert(current_power_values.size() == 2 || current_power_values.size() == 3,
+ "Power properties incorrectly defined for host %s."
+ "It should be 'Idle:FullSpeed' power values because you have one core only.",
+ host->getCname());
+ if (current_power_values.size() == 2) {
+ // In this case, 1core == AllCores
+ current_power_values.push_back(current_power_values.at(1));
+ } else { // size == 3
+ xbt_assert((current_power_values.at(1)) == (current_power_values.at(2)),
+ "Power properties incorrectly defined for host %s.\n"
+ "The energy profile of mono-cores should be formatted as 'Idle:FullSpeed' only.\n"
+ "If you go for a 'Idle:OneCore:AllCores' power profile on mono-cores, then OneCore and AllCores "
+ "must be equal.",
+ host->getCname());
+ }
+ } else {
+ xbt_assert(current_power_values.size() == 3,
+ "Power properties incorrectly defined for host %s."
+ "It should be 'Idle:OneCore:AllCores' power values because you have more than one core.",
+ host->getCname());
+ }