From: Christian Heinrich Date: Wed, 28 Feb 2018 15:09:08 +0000 (+0100) Subject: [DVFS] Use sg_host_get_avg_load() & reset the load X-Git-Tag: v3.19~161 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1f5e5441d9d3963583b2c682b9819d968fa891c6?ds=sidebyside [DVFS] Use sg_host_get_avg_load() & reset the load --- diff --git a/src/surf/plugins/host_dvfs.cpp b/src/surf/plugins/host_dvfs.cpp index 7aa225fcd8..c21f839344 100644 --- a/src/surf/plugins/host_dvfs.cpp +++ b/src/surf/plugins/host_dvfs.cpp @@ -119,7 +119,8 @@ public: std::string getName() override { return "OnDemand"; } void update() override { - double load = sg_host_get_current_load(host); + double load = host->getCoreCount() * sg_host_get_avg_load(host); + sg_host_load_reset(host); // Only consider the period between two calls to this method! // FIXME I don't like that we multiply with the getCoreCount() just here... if (load*host->getCoreCount() > freq_up_threshold) { @@ -164,8 +165,9 @@ public: virtual std::string getName() override { return "Conservative"; } virtual void update() override { - double load = sg_host_get_current_load(host)*host->getCoreCount(); + double load = host->getCoreCount() * sg_host_get_avg_load(host); int pstate = host->getPstate(); + sg_host_load_reset(host); // Only consider the period between two calls to this method! if (load > freq_up_threshold) { if (pstate != 0) {