From fb2b952a7824c012dedfb16911749660f6b3b2e1 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Fri, 24 Mar 2017 08:44:30 +0100 Subject: [PATCH 1/1] no need to test if hard coded value is in a range --- examples/msg/energy-pstate/energy-pstate.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/msg/energy-pstate/energy-pstate.c b/examples/msg/energy-pstate/energy-pstate.c index ae278133dd..9906c1f2b3 100644 --- a/examples/msg/energy-pstate/energy-pstate.c +++ b/examples/msg/energy-pstate/energy-pstate.c @@ -19,7 +19,6 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test"); static int dvfs(int argc, char *argv[]) { double workload = 100E6; - int new_pstate = 2; msg_host_t host = MSG_host_self(); int nb = MSG_host_get_nb_pstates(host); @@ -37,10 +36,7 @@ static int dvfs(int argc, char *argv[]) XBT_INFO("Task1 simulation time: %e", task_time); // Change power peak - if ((new_pstate >= nb) || (new_pstate < 0)) { - XBT_INFO("Cannot set pstate %d, host supports only %d pstates", new_pstate, nb); - return 0; - } + int new_pstate = 2; 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); -- 2.20.1