Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fixed energy plugin: getCurrentWattsValue was not returning watts_off when host is off
authorCARASTAN DOS SANTOS Danilo <danilo.carastan-dos-santos@inria.fr>
Thu, 23 Nov 2017 17:18:28 +0000 (18:18 +0100)
committerCARASTAN DOS SANTOS Danilo <danilo.carastan-dos-santos@inria.fr>
Thu, 23 Nov 2017 17:18:28 +0000 (18:18 +0100)
src/surf/plugins/host_energy.cpp

index a66839f..7b9c025 100644 (file)
@@ -250,6 +250,14 @@ double HostEnergy::getCurrentWattsValue(double cpu_load)
 {
   xbt_assert(not power_range_watts_list.empty(), "No power range properties specified for host %s", host->getCname());
 
 {
   xbt_assert(not power_range_watts_list.empty(), "No power range properties specified for host %s", host->getCname());
 
+ /*
+  *    * Return watts_off if pstate == pstate_off
+  *       * this happens when host is off
+  */
+  if (this->pstate == pstate_off) {
+    return watts_off;
+  }
+
   /* min_power corresponds to the power consumed when only one core is active */
   /* max_power is the power consumed at 100% cpu load       */
   auto range           = power_range_watts_list.at(this->pstate);
   /* min_power corresponds to the power consumed when only one core is active */
   /* max_power is the power consumed at 100% cpu load       */
   auto range           = power_range_watts_list.at(this->pstate);