Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[ENERGY] Assert that 1-core systems are correctly configured.
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 16 Jun 2017 09:30:46 +0000 (11:30 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 16 Jun 2017 09:30:46 +0000 (11:30 +0200)
The values for 1-core and max-core load must be the same. If not, the
assert() will fail and the user will be warned.

examples/msg/energy-consumption/energy-consumption.tesh
examples/msg/energy-onoff/energy-onoff.tesh
examples/msg/energy-onoff/platform_onoff.xml
examples/platforms/energy_cluster.xml
examples/platforms/energy_platform.xml
src/surf/plugins/host_energy.cpp

index b0fde0b..9ed9a15 100644 (file)
@@ -3,12 +3,12 @@
 p Testing the mechanism for computing host energy consumption
 
 $ ${bindir:=.}/energy-consumption/energy-consumption$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0
+> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0
 > [  0.000000] (1:dvfs_test@MyHost1) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:dvfs_test@MyHost1) Sleep for 10 seconds
 > [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=1000.00 J
 > [ 10.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
-> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 200W depending on load; Energy dissipated=1120 J
+> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 120W depending on load; Energy dissipated=1120 J
 > [ 11.000000] (1:dvfs_test@MyHost1) ========= Requesting pstate 2 (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
 > [ 11.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
 > [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1645 J
@@ -23,12 +23,12 @@ $ ${bindir:=.}/energy-consumption/energy-consumption$EXEEXT ${srcdir:=.}/../plat
 > [ 30.000000] (0:maestro@) Energy consumption of host MyHost3: 3000.000000 Joules
 
 $ ${bindir:=.}/energy-consumption/energy-consumption$EXEEXT ${srcdir:=.}/../platforms/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0
+> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0
 > [  0.000000] (1:dvfs_test@MyHost1) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:dvfs_test@MyHost1) Sleep for 10 seconds
 > [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=1000.00 J
 > [ 10.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
-> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 200W depending on load; Energy dissipated=1120 J
+> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 120W depending on load; Energy dissipated=1120 J
 > [ 11.000000] (1:dvfs_test@MyHost1) ========= Requesting pstate 2 (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
 > [ 11.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
 > [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1645 J
index f0c366e..e458bf7 100644 (file)
@@ -4,7 +4,7 @@ p Testing the mechanism for computing host energy consumption
 
 ! output sort 19
 $ ${bindir:=.}/energy-onoff/energy-onoff$EXEEXT ${srcdir:=.}/energy-onoff/platform_onoff.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:onoff_test@MyHost2) Energetic profile: 95.0:120.0:200.0,93.0:110.0:170.0,90.0:100.0:150.0, 120:120:120,110:110:110
+> [  0.000000] (1:onoff_test@MyHost2) Energetic profile: 95.0:120.0:120.0,93.0:110.0:110.0,90.0:100.0:100.0, 120:120:120,110:110:110
 > [  0.000000] (1:onoff_test@MyHost2) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:onoff_test@MyHost2) Sleep for 10 seconds
 > [ 10.000000] (1:onoff_test@MyHost2) Done sleeping. Current peak speed=1E+08; Energy dissipated=950.00 J
index b0423a9..5d7c62b 100644 (file)
       values that are right for you. -->
 
     <host id="MyHost1" speed="100.0Mf,50.0Mf,20.0Mf,                               0.006666667f,0.1429f" pstate="0" >
-      <prop id="watt_per_state" value="95.0:120.0:200.0,93.0:110.0:170.0,90.0:100.0:150.0, 120:120:120,110:110:110" />
+      <prop id="watt_per_state" value="95.0:120.0:120.0,93.0:110.0:110.0,90.0:100.0:100.0, 120:120:120,110:110:110" />
       <prop id="watt_off"       value="10" />
     </host>
     <host id="MyHost2" speed="100.0Mf" >
-      <prop id="watt_per_state" value="100.0:120.0:200.0" />
+      <prop id="watt_per_state" value="100.0:120.0:120.0" />
       <prop id="watt_off"       value="10" />
     </host>
 
index 680a30e..da38f4d 100644 (file)
@@ -5,7 +5,7 @@
            bw="125MBps" lat="50us" bb_bw="2.25GBps"  bb_lat="500us">
     <!--  List of idle_power:min_power:max_power pairs (in Watts) -->
     <!--  The list must contain one speed tupple for each previously defined pstate-->
-    <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
+    <prop id="watt_per_state" value="100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0" />
     <prop id="watt_off" value="10" />
   </cluster>
 </platform>
index 0af3e71..3f0a618 100644 (file)
@@ -5,19 +5,19 @@
     <!-- Multiple pstate processor capacities can be defined as a list of powers specified for a given host -->
     <!-- Attribute 'pstate' specifies the initialy selected pstate (here, the lowest pstate corresponds to the highest
          processor speed) -->
-    <host id="MyHost1" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" >
+    <host id="MyHost1" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" core="1" >
       <!--  List of min_power:max_power pairs (in Watts) corresponding to the speed consumed when the processor is idle
             and when it is fully loaded -->
       <!--  The list must contain one speed pair for each previously defined pstate-->
-      <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
+      <prop id="watt_per_state" value="100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0" />
       <prop id="watt_off" value="10" />
     </host>
     <host id="MyHost2" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" >
-      <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
+      <prop id="watt_per_state" value="100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0" />
       <prop id="watt_off" value="10" />
     </host>
     <host id="MyHost3" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" >
-      <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
+      <prop id="watt_per_state" value="100.0:120.0:120.0, 93.0:110.0:110.0, 90.0:105.0:105.0" />
       <prop id="watt_off" value="10" />
     </host>
 
index f7878d7..79228b0 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "simgrid/s4u/Engine.hpp"
 
+#include <algorithm>
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <string>
@@ -177,6 +178,13 @@ HostEnergy::HostEnergy(simgrid::s4u::Host* ptr) : host(ptr), last_updated(surf_g
     xbt_free(msg);
   }
   /* watts_off is 0 by default */
+
+  if (ptr->coreCount() == 1)
+    xbt_assert(std::all_of(power_range_watts_list.begin(), power_range_watts_list.end(),
+                           [](PowerRange power_range) { return power_range.min == power_range.max; }),
+               "You only have one core in host %s, but the \
+      energy consumption for one core does not match the energy consumption for all (here: 1) cores). This is an error in your platform, please fix it.",
+               host->cname());
 }
 
 HostEnergy::~HostEnergy() = default;