From: Christian Heinrich Date: Wed, 8 Aug 2018 12:41:48 +0000 (+0200) Subject: [DVFS] Make sure pstate is never smaller than minimum X-Git-Tag: v3_21~266^2~3 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5fbcc8187930f5aa9b86216d40c7abe9acfef1a1?hp=62a05c9884fc879aac3dfc0d11caaf7fb929e6f3 [DVFS] Make sure pstate is never smaller than minimum --- diff --git a/src/plugins/host_dvfs.cpp b/src/plugins/host_dvfs.cpp index c4d4d70fe4..ab8d054b4b 100644 --- a/src/plugins/host_dvfs.cpp +++ b/src/plugins/host_dvfs.cpp @@ -192,7 +192,9 @@ public: */ // Load is now < freq_up_threshold; exclude pstate 0 (the fastest) // because pstate 0 can only be selected if load > freq_up_threshold_ - int new_pstate = max_pstate - load * (max_pstate + 1); + int new_pstate = get_max_pstate() - load * (get_max_pstate() + 1); + if (new_pstate < get_min_pstate()) + new_pstate = get_min_pstate(); get_host()->set_pstate(new_pstate); XBT_DEBUG("Load: %f < threshold: %f --> changed to pstate %i", load, freq_up_threshold_, new_pstate);