From a10acf1eeceb5945d636e9210f2e0d39b235d49b Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Mon, 6 Mar 2017 13:09:28 +0100 Subject: [PATCH] [Energy] Fix broken commit c6fc463d75e4daa67ddf9c460cbc473b1aa9d6ba This fixes compilation errors but also updated failing tests --- .../energy-consumption.tesh | 1 + examples/msg/energy-onoff/energy-onoff.tesh | 1 + examples/msg/energy-ptask/energy-ptask.tesh | 1 + examples/msg/energy-vm/energy-vm.tesh | 1 + examples/smpi/energy/energy.tesh | 1 + examples/smpi/energy/f77/energy.tesh | 1 + examples/smpi/energy/f90/energy.tesh | 1 + src/surf/plugins/host_energy.cpp | 23 +------------------ 8 files changed, 8 insertions(+), 22 deletions(-) diff --git a/examples/msg/energy-consumption/energy-consumption.tesh b/examples/msg/energy-consumption/energy-consumption.tesh index ae07b57352..cea56575eb 100644 --- a/examples/msg/energy-consumption/energy-consumption.tesh +++ b/examples/msg/energy-consumption/energy-consumption.tesh @@ -16,6 +16,7 @@ $ ${bindir:=.}/energy-consumption/energy-consumption$EXEEXT ${srcdir:=.}/../plat > [ 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@) Summed energy consumption: 8005.000000 Joules; used hosts consumed: 5005.000000 Joules; unused (idle) hosts consumed: 3000.000000 > [ 30.000000] (0:maestro@) Total simulation time: 30.00 > [ 30.000000] (0:maestro@) Total energy of host MyHost1: 2905.000000 Joules > [ 30.000000] (0:maestro@) Total energy of host MyHost2: 2100.000000 Joules diff --git a/examples/msg/energy-onoff/energy-onoff.tesh b/examples/msg/energy-onoff/energy-onoff.tesh index 1dc58bb17a..d51c44adb8 100644 --- a/examples/msg/energy-onoff/energy-onoff.tesh +++ b/examples/msg/energy-onoff/energy-onoff.tesh @@ -18,6 +18,7 @@ $ ${bindir:=.}/energy-onoff/energy-onoff$EXEEXT ${srcdir:=.}/energy-onoff/platfo > [ 26.997901] (1:onoff_test@MyHost2) Switch to virtual pstate 3, that encodes the shutting down state in the XML file of that example > [ 26.997901] (1:onoff_test@MyHost2) Actually start the host > [ 26.997901] (1:onoff_test@MyHost2) Simulate the boot up by executing one flop on that host +> [176.997893] (0:maestro@) Summed energy consumption: 37519.557482 Joules; used hosts consumed: 37519.557482 Joules; unused (idle) hosts consumed: 0.000000 > [176.997893] (0:maestro@) Total simulation time: 177.00 > [176.997893] (0:maestro@) Total energy of host MyHost1: 19819.768169 Joules > [176.997893] (0:maestro@) Total energy of host MyHost2: 17699.789313 Joules diff --git a/examples/msg/energy-ptask/energy-ptask.tesh b/examples/msg/energy-ptask/energy-ptask.tesh index 19069e7f57..7dde4e6b39 100644 --- a/examples/msg/energy-ptask/energy-ptask.tesh +++ b/examples/msg/energy-ptask/energy-ptask.tesh @@ -8,6 +8,7 @@ $ ${bindir:=.}/energy-ptask/energy-ptask$EXEEXT ${srcdir:=.}/../platforms/energy > [311.000000] (1:test@MyHost1) Then, build a parallel task with no computation nor communication (synchro only) > [311.000000] (1:test@MyHost1) Finally, trick the ptask to do a 'remote execution', on host MyHost2 > [321.000000] (1:test@MyHost1) Goodbye now! +> [321.000000] (0:maestro@) Summed energy consumption: 115160.000000 Joules; used hosts consumed: 115160.000000 Joules; unused (idle) hosts consumed: 0.000000 > [321.000000] (0:maestro@) Simulation done. > [321.000000] (0:maestro@) Total energy of host MyHost1: 38320.000000 Joules > [321.000000] (0:maestro@) Total energy of host MyHost2: 38520.000000 Joules diff --git a/examples/msg/energy-vm/energy-vm.tesh b/examples/msg/energy-vm/energy-vm.tesh index 3d829543bd..2225e3bafa 100644 --- a/examples/msg/energy-vm/energy-vm.tesh +++ b/examples/msg/energy-vm/energy-vm.tesh @@ -15,6 +15,7 @@ $ ${bindir:=.}/energy-vm/energy-vm$EXEEXT ${srcdir:=.}/../platforms/energy_platf > [ 6.000000] (2:p11@vm_host1) This worker is done. > [ 6.000000] (6:p31@vm_host3) This worker is done. > [ 6.000000] (7:p32@vm_host3) This worker is done. +> [ 10.000000] (0:maestro@) Summed energy consumption: 3360.000000 Joules; used hosts consumed: 3360.000000 Joules; unused (idle) hosts consumed: 0.000000 > [ 10.000000] (0:maestro@) Total simulation time: 10.00; All hosts must have the exact same energy consumption. > [ 10.000000] (0:maestro@) Total energy of host MyHost1: 1120.000000 Joules > [ 10.000000] (0:maestro@) Total energy of host MyHost2: 1120.000000 Joules diff --git a/examples/smpi/energy/energy.tesh b/examples/smpi/energy/energy.tesh index b54624685a..3dd7c0d328 100644 --- a/examples/smpi/energy/energy.tesh +++ b/examples/smpi/energy/energy.tesh @@ -19,6 +19,7 @@ $ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platf > [30.000000] [rank 1] Current pstate: 2; Current power: 20000000 > [80.000000] [rank 0] Energy consumed: 8650 Joules. > [80.000000] [rank 1] Energy consumed: 8650 Joules. +> [80.000000] [surf_energy/INFO] Summed energy consumption: 25300.000000 Joules; used hosts consumed: 17300.000000 Joules; unused (idle) hosts consumed: 8000.000000 > [80.000000] [surf_energy/INFO] Total energy of host MyHost1: 8650.000000 Joules > [80.000000] [surf_energy/INFO] Total energy of host MyHost2: 8650.000000 Joules > [80.000000] [surf_energy/INFO] Total energy of host MyHost3: 8000.000000 Joules diff --git a/examples/smpi/energy/f77/energy.tesh b/examples/smpi/energy/f77/energy.tesh index e6a588faf9..185cbd1f39 100644 --- a/examples/smpi/energy/f77/energy.tesh +++ b/examples/smpi/energy/f77/energy.tesh @@ -26,6 +26,7 @@ $ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platf > [ 30.000000000000000 ] [rank 1 ] Current pstate: 2 ; Current power: 20000000.000000000 > [ 80.000000000000000 ] [rank 0 ] Energy consumed (Joules): 8650.0000000000000 > [ 80.000000000000000 ] [rank 1 ] Energy consumed (Joules): 8650.0000000000000 +> [80.000000] [surf_energy/INFO] Summed energy consumption: 25300.000000 Joules; used hosts consumed: 17300.000000 Joules; unused (idle) hosts consumed: 8000.000000 > [80.000000] [surf_energy/INFO] Total energy of host MyHost1: 8650.000000 Joules > [80.000000] [surf_energy/INFO] Total energy of host MyHost2: 8650.000000 Joules > [80.000000] [surf_energy/INFO] Total energy of host MyHost3: 8000.000000 Joules diff --git a/examples/smpi/energy/f90/energy.tesh b/examples/smpi/energy/f90/energy.tesh index 14b02750d5..b1f395aebd 100644 --- a/examples/smpi/energy/f90/energy.tesh +++ b/examples/smpi/energy/f90/energy.tesh @@ -26,6 +26,7 @@ $ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platf > [ 30.000000000000000 ] [rank 1 ] Current pstate: 2 ; Current power: 20000000.000000000 > [ 80.000000000000000 ] [rank 0 ] Energy consumed (Joules): 8650.0000000000000 > [ 80.000000000000000 ] [rank 1 ] Energy consumed (Joules): 8650.0000000000000 +> [80.000000] [surf_energy/INFO] Summed energy consumption: 25300.000000 Joules; used hosts consumed: 17300.000000 Joules; unused (idle) hosts consumed: 8000.000000 > [80.000000] [surf_energy/INFO] Total energy of host MyHost1: 8650.000000 Joules > [80.000000] [surf_energy/INFO] Total energy of host MyHost2: 8650.000000 Joules > [80.000000] [surf_energy/INFO] Total energy of host MyHost3: 8000.000000 Joules diff --git a/src/surf/plugins/host_energy.cpp b/src/surf/plugins/host_energy.cpp index e3e4977249..08ab4df26f 100644 --- a/src/surf/plugins/host_energy.cpp +++ b/src/surf/plugins/host_energy.cpp @@ -3,11 +3,11 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include #include "simgrid/plugins/energy.h" #include "simgrid/simix.hpp" #include "src/plugins/vm/VirtualMachineImpl.hpp" #include "src/surf/cpu_interface.hpp" +#include #include /** @addtogroup SURF_plugin_energy @@ -326,26 +326,6 @@ static void onSimulationEnd() total_energy, used_hosts_energy, total_energy - used_hosts_energy); } -static int monitor_DVFS(int argc, char **argv); -static int monitor_DVFS(int argc, char **argv) -{ - while (1) { - MSG_process_sleep(5); - } - - return 0; -} - -static void onPlatformCreated() -{ - sg_host_t* host_list = sg_host_list(); - int host_count = sg_host_count(); - for (int i = 0; i < host_count; i++) { - MSG_process_create("dvfs", &monitor_DVFS, NULL, host_list[i]); - XBT_INFO("Created new MSG processes!"); - } -} - /* **************************** Public interface *************************** */ SG_BEGIN_DECL() @@ -364,7 +344,6 @@ void sg_host_energy_plugin_init() simgrid::s4u::Host::onStateChange.connect(&onHostChange); simgrid::s4u::Host::onSpeedChange.connect(&onHostChange); simgrid::s4u::Host::onDestruction.connect(&onHostDestruction); - simgrid::s4u::onPlatformCreated.connect(&onPlatformCreated); simgrid::s4u::onSimulationEnd.connect(&onSimulationEnd); simgrid::surf::CpuAction::onStateChange.connect(&onActionStateChange); } -- 2.20.1