Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
restore a check ensuring that this example is not used on an inadapted platform
[simgrid.git] / examples / msg / energy-pstate / energy-pstate.c
index 9906c1f..227c1da 100644 (file)
@@ -37,6 +37,8 @@ static int dvfs(int argc, char *argv[])
 
   // Change power peak
   int new_pstate = 2;
+  xbt_assert(new_pstate < nb, "Cannot set the host %s at pstate %d because it only provides %d pstates.",
+             MSG_host_get_name(host), new_pstate, nb);
 
   double peak_at = MSG_host_get_power_peak_at(host, new_pstate);
   XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_pstate);