Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
restore a check ensuring that this example is not used on an inadapted platform
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Mar 2017 12:14:45 +0000 (13:14 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Mar 2017 12:14:45 +0000 (13:14 +0100)
examples/msg/energy-pstate/energy-pstate.c

index 9906c1f2b30357879f48c50118799cba1cb407f1..227c1dafa32d1747db9cab5f7f065ff3f67f1edc 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);