When a pstate is changed, the energy plugin will update a timestamp for that
host even if that host is never used; this means that we cannot rely on this
to determine if a host has been idle or not. The HostLoad plugin allows
us to do that.
This commit also updates several tesh files as some hosts were reported
as active in the past although they have not computed anything. These
hosts were hence idle and should be reported as such; a machine that
only boots or shuts down is in this case also regarded as unused.
> [ 27.000000] (1:Boot Monitor@MyHost2) Wait 150s to simulate the boot time.
> [177.000000] (1:Boot Monitor@MyHost2) The host is now up and running. Switch back to previous pstate 0
> [177.000000] (1:Boot Monitor@MyHost2) Host1 is now ON again. Current pstate: 0; Energy dissipated so far: 19820.00 J
> [ 27.000000] (1:Boot Monitor@MyHost2) Wait 150s to simulate the boot time.
> [177.000000] (1:Boot Monitor@MyHost2) The host is now up and running. Switch back to previous pstate 0
> [177.000000] (1:Boot Monitor@MyHost2) Host1 is now ON again. Current pstate: 0; Energy dissipated so far: 19820.00 J
-> [177.000000] (0:maestro@) Total energy consumption: 37520.000000 Joules (used hosts: 37520.000000 Joules; unused/idle hosts: 0.000000)
+> [177.000000] (0:maestro@) Total energy consumption: 37520.000000 Joules (used hosts: 0.000000 Joules; unused/idle hosts: 37520.000000)
> [177.000000] (0:maestro@) End of simulation.
> [177.000000] (0:maestro@) Energy consumption of host MyHost1: 19820.000000 Joules
> [177.000000] (0:maestro@) Energy consumption of host MyHost2: 17700.000000 Joules
> [177.000000] (0:maestro@) End of simulation.
> [177.000000] (0:maestro@) Energy consumption of host MyHost1: 19820.000000 Joules
> [177.000000] (0:maestro@) Energy consumption of host MyHost2: 17700.000000 Joules
> [ 27.000000] (1:Boot Monitor@MyHost2) Wait 150s to simulate the boot time.
> [177.000000] (1:Boot Monitor@MyHost2) The host is now up and running. Switch back to previous pstate 0
> [177.000000] (1:Boot Monitor@MyHost2) Host1 is now ON again. Current pstate: 0; Energy dissipated so far: 19820.00 J
> [ 27.000000] (1:Boot Monitor@MyHost2) Wait 150s to simulate the boot time.
> [177.000000] (1:Boot Monitor@MyHost2) The host is now up and running. Switch back to previous pstate 0
> [177.000000] (1:Boot Monitor@MyHost2) Host1 is now ON again. Current pstate: 0; Energy dissipated so far: 19820.00 J
-> [177.000000] (0:maestro@) Total energy consumption: 37520.000000 Joules (used hosts: 37520.000000 Joules; unused/idle hosts: 0.000000)
+> [177.000000] (0:maestro@) Total energy consumption: 37520.000000 Joules (used hosts: 0.000000 Joules; unused/idle hosts: 37520.000000)
> [177.000000] (0:maestro@) End of simulation.
> [177.000000] (0:maestro@) Energy consumption of host MyHost1: 19820.000000 Joules
> [177.000000] (0:maestro@) Energy consumption of host MyHost2: 17700.000000 Joules
> [177.000000] (0:maestro@) End of simulation.
> [177.000000] (0:maestro@) Energy consumption of host MyHost1: 19820.000000 Joules
> [177.000000] (0:maestro@) Energy consumption of host MyHost2: 17700.000000 Joules
> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2005 J
> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far.
> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2905 J
> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2005 J
> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far.
> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2905 J
-> [ 30.000000] (0:maestro@) Total energy consumption: 8005.000000 Joules (used hosts: 5005.000000 Joules; unused/idle hosts: 3000.000000)
+> [ 30.000000] (0:maestro@) Total energy consumption: 8005.000000 Joules (used hosts: 2905.000000 Joules; unused/idle hosts: 5100.000000)
> [ 30.000000] (0:maestro@) End of simulation.
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost1: 2905.000000 Joules
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules
> [ 30.000000] (0:maestro@) End of simulation.
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost1: 2905.000000 Joules
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules
> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2005 J
> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far.
> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2905 J
> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2005 J
> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far.
> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2905 J
-> [ 30.000000] (0:maestro@) Total energy consumption: 5005.000000 Joules (used hosts: 5005.000000 Joules; unused/idle hosts: 0.000000)
+> [ 30.000000] (0:maestro@) Total energy consumption: 5005.000000 Joules (used hosts: 2905.000000 Joules; unused/idle hosts: 2100.000000)
> [ 30.000000] (0:maestro@) End of simulation.
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost1: 2905.000000 Joules
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules
> [ 30.000000] (0:maestro@) End of simulation.
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost1: 2905.000000 Joules
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid/plugins/energy.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid/plugins/energy.h"
+#include "simgrid/plugins/load.h"
#include "simgrid/simix.hpp"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/surf/cpu_interface.hpp"
#include "simgrid/simix.hpp"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/surf/cpu_interface.hpp"
for (int i = 0; i < host_count; i++) {
if (dynamic_cast<simgrid::s4u::VirtualMachine*>(host_list[i]) == nullptr) { // Ignore virtual machines
for (int i = 0; i < host_count; i++) {
if (dynamic_cast<simgrid::s4u::VirtualMachine*>(host_list[i]) == nullptr) { // Ignore virtual machines
- bool host_was_used = (host_list[i]->extension<HostEnergy>()->last_updated != 0);
+ bool host_was_used = (sg_host_get_computed_flops(host_list[i]) != 0);
double energy = host_list[i]->extension<HostEnergy>()->getConsumedEnergy();
total_energy += energy;
if (host_was_used)
double energy = host_list[i]->extension<HostEnergy>()->getConsumedEnergy();
total_energy += energy;
if (host_was_used)
if (HostEnergy::EXTENSION_ID.valid())
return;
if (HostEnergy::EXTENSION_ID.valid())
return;
+ sg_host_load_plugin_init();
+
HostEnergy::EXTENSION_ID = simgrid::s4u::Host::extension_create<HostEnergy>();
simgrid::s4u::Host::onCreation.connect(&onCreation);
HostEnergy::EXTENSION_ID = simgrid::s4u::Host::extension_create<HostEnergy>();
simgrid::s4u::Host::onCreation.connect(&onCreation);
> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2005 J
> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far.
> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2905 J
> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2005 J
> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far.
> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2905 J
-> [ 30.000000] (0:maestro@) Total energy consumption: 8005.000000 Joules (used hosts: 5005.000000 Joules; unused/idle hosts: 3000.000000)
+> [ 30.000000] (0:maestro@) Total energy consumption: 8005.000000 Joules (used hosts: 2905.000000 Joules; unused/idle hosts: 5100.000000)
> [ 30.000000] (0:maestro@) Total simulation time: 30.00
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost1: 2905.000000 Joules
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules
> [ 30.000000] (0:maestro@) Total simulation time: 30.00
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost1: 2905.000000 Joules
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules
> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2005 J
> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far.
> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2905 J
> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2005 J
> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far.
> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2905 J
-> [ 30.000000] (0:maestro@) Total energy consumption: 5005.000000 Joules (used hosts: 5005.000000 Joules; unused/idle hosts: 0.000000)
+> [ 30.000000] (0:maestro@) Total energy consumption: 5005.000000 Joules (used hosts: 2905.000000 Joules; unused/idle hosts: 2100.000000)
> [ 30.000000] (0:maestro@) Total simulation time: 30.00
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost1: 2905.000000 Joules
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules
> [ 30.000000] (0:maestro@) Total simulation time: 30.00
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost1: 2905.000000 Joules
> [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules