From 1f5e5441d9d3963583b2c682b9819d968fa891c6 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Wed, 28 Feb 2018 16:09:08 +0100 Subject: [PATCH] [DVFS] Use sg_host_get_avg_load() & reset the load --- src/surf/plugins/host_dvfs.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) { -- 2.20.1