From: Martin Quinson Date: Mon, 6 Mar 2017 23:29:07 +0000 (+0100) Subject: cosmetics in the energy plugin X-Git-Tag: v3_15~212^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/debf090fa45965e2cdcf537e991996efe15135bf cosmetics in the energy plugin --- diff --git a/examples/java/energy/consumption/energy_consumption.tesh b/examples/java/energy/consumption/energy_consumption.tesh index e957c97729..ef29636f4d 100644 --- a/examples/java/energy/consumption/energy_consumption.tesh +++ b/examples/java/energy/consumption/energy_consumption.tesh @@ -8,10 +8,10 @@ $ java -classpath ${classpath:=.} energy/consumption/Main ${srcdir:=.}/../platfo > [MyHost1:energyConsumer:(1) 0.000000] [jmsg/INFO] Initial peak speed= 1.0E8 flop/s; Energy dissipated = 0.0 J > [MyHost1:energyConsumer:(1) 10.000000] [jmsg/INFO] Currently consumed energy after sleeping 10 sec: 1000.0 > [MyHost1:energyConsumer:(1) 20.000000] [jmsg/INFO] Currently consumed energy after executing 1E9 flops: 2200.0 -> [20.000000] [surf_energy/INFO] Summed energy consumption: 6200.000000 Joules; used hosts consumed: 2200.000000 Joules; unused (idle) hosts consumed: 4000.000000 +> [20.000000] [surf_energy/INFO] Total energy consumption: 6200.000000 Joules (used hosts: 2200.000000 Joules; unused/idle hosts: 4000.000000) > [20.000000] [jmsg/INFO] MSG_main finished; Cleaning up the simulation... > [20.000000] [jmsg/INFO] Total simulation time: 20.0 -> [20.000000] [surf_energy/INFO] Total energy of host MyHost1: 2200.000000 Joules -> [20.000000] [surf_energy/INFO] Total energy of host MyHost2: 2000.000000 Joules -> [20.000000] [surf_energy/INFO] Total energy of host MyHost3: 2000.000000 Joules +> [20.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 2200.000000 Joules +> [20.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 2000.000000 Joules +> [20.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 2000.000000 Joules diff --git a/examples/java/energy/pstate/energy_pstate.tesh b/examples/java/energy/pstate/energy_pstate.tesh index 398458e7fc..f2c91c82c4 100644 --- a/examples/java/energy/pstate/energy_pstate.tesh +++ b/examples/java/energy/pstate/energy_pstate.tesh @@ -18,8 +18,8 @@ $ java -classpath ${classpath:=.} energy/pstate/Main ${srcdir:=.}/../platforms/e > [MyHost2:dvfs_test:(3) 6.000000] [jmsg/INFO] Count of Processor states=3 > [MyHost1:dvfs_test:(2) 6.000000] [jmsg/INFO] Current power peak=2.0E7 > [MyHost2:dvfs_test:(3) 6.000000] [jmsg/INFO] Current power peak=2.0E7 -> [6.000000] [surf_energy/INFO] Summed energy consumption: 1890.000000 Joules; used hosts consumed: 1290.000000 Joules; unused (idle) hosts consumed: 600.000000 +> [6.000000] [surf_energy/INFO] Total energy consumption: 1890.000000 Joules (used hosts: 1290.000000 Joules; unused/idle hosts: 600.000000) > [6.000000] [jmsg/INFO] MSG_main finished; Cleaning up the simulation... -> [6.000000] [surf_energy/INFO] Total energy of host MyHost1: 645.000000 Joules -> [6.000000] [surf_energy/INFO] Total energy of host MyHost2: 645.000000 Joules -> [6.000000] [surf_energy/INFO] Total energy of host MyHost3: 600.000000 Joules +> [6.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 645.000000 Joules +> [6.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 645.000000 Joules +> [6.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 600.000000 Joules diff --git a/examples/java/energy/vm/energy_vm.tesh b/examples/java/energy/vm/energy_vm.tesh index e8db727114..8ad0d481dd 100644 --- a/examples/java/energy/vm/energy_vm.tesh +++ b/examples/java/energy/vm/energy_vm.tesh @@ -14,8 +14,8 @@ $ java -classpath ${classpath:=.} energy/vm/Main ${srcdir:=.}/../platforms/energ > [vmHost1:p11:(2) 6.000000] [jmsg/INFO] This worker is done. > [vmHost3:p31:(6) 6.000000] [jmsg/INFO] This worker is done. > [vmHost3:p312:(7) 6.000000] [jmsg/INFO] This worker is done. -> [10.000000] [surf_energy/INFO] Summed energy consumption: 3360.000000 Joules; used hosts consumed: 3360.000000 Joules; unused (idle) hosts consumed: 0.000000 +> [10.000000] [surf_energy/INFO] Total energy consumption: 3360.000000 Joules (used hosts: 3360.000000 Joules; unused/idle hosts: 0.000000) > [10.000000] [jmsg/INFO] MSG_main finished; Cleaning up the simulation... -> [10.000000] [surf_energy/INFO] Total energy of host MyHost1: 1120.000000 Joules -> [10.000000] [surf_energy/INFO] Total energy of host MyHost2: 1120.000000 Joules -> [10.000000] [surf_energy/INFO] Total energy of host MyHost3: 1120.000000 Joules +> [10.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 1120.000000 Joules +> [10.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 1120.000000 Joules +> [10.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 1120.000000 Joules diff --git a/examples/msg/energy-consumption/energy-consumption.tesh b/examples/msg/energy-consumption/energy-consumption.tesh index cea56575eb..bab32d8993 100644 --- a/examples/msg/energy-consumption/energy-consumption.tesh +++ b/examples/msg/energy-consumption/energy-consumption.tesh @@ -16,8 +16,8 @@ $ ${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 energy consumption: 8005.000000 Joules (used hosts: 5005.000000 Joules; unused/idle hosts: 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 -> [ 30.000000] (0:maestro@) Total energy of host MyHost3: 3000.000000 Joules +> [ 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@) Energy consumption of host MyHost3: 3000.000000 Joules diff --git a/examples/msg/energy-onoff/energy-onoff.tesh b/examples/msg/energy-onoff/energy-onoff.tesh index d51c44adb8..f0c366e8c6 100644 --- a/examples/msg/energy-onoff/energy-onoff.tesh +++ b/examples/msg/energy-onoff/energy-onoff.tesh @@ -18,9 +18,9 @@ $ ${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 energy consumption: 37519.557482 Joules (used hosts: 37519.557482 Joules; unused/idle hosts: 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 +> [176.997893] (0:maestro@) Energy consumption of host MyHost1: 19819.768169 Joules +> [176.997893] (0:maestro@) Energy consumption of host MyHost2: 17699.789313 Joules > [176.997893] (1:onoff_test@MyHost2) Switch back to previously selected pstate 0 > [176.997893] (1:onoff_test@MyHost2) Host1 is now ON again. Current peak speed=1E+08 flop/s; Energy dissipated=19820 J diff --git a/examples/msg/energy-ptask/energy-ptask.tesh b/examples/msg/energy-ptask/energy-ptask.tesh index 7dde4e6b39..260139045c 100644 --- a/examples/msg/energy-ptask/energy-ptask.tesh +++ b/examples/msg/energy-ptask/energy-ptask.tesh @@ -8,8 +8,8 @@ $ ${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@) Total energy consumption: 115160.000000 Joules (used hosts: 115160.000000 Joules; unused/idle hosts: 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 -> [321.000000] (0:maestro@) Total energy of host MyHost3: 38320.000000 Joules +> [321.000000] (0:maestro@) Energy consumption of host MyHost1: 38320.000000 Joules +> [321.000000] (0:maestro@) Energy consumption of host MyHost2: 38520.000000 Joules +> [321.000000] (0:maestro@) Energy consumption of host MyHost3: 38320.000000 Joules diff --git a/examples/msg/energy-vm/energy-vm.tesh b/examples/msg/energy-vm/energy-vm.tesh index 2225e3bafa..c89dd5ddbd 100644 --- a/examples/msg/energy-vm/energy-vm.tesh +++ b/examples/msg/energy-vm/energy-vm.tesh @@ -15,8 +15,8 @@ $ ${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 energy consumption: 3360.000000 Joules (used hosts: 3360.000000 Joules; unused/idle hosts: 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 -> [ 10.000000] (0:maestro@) Total energy of host MyHost3: 1120.000000 Joules +> [ 10.000000] (0:maestro@) Energy consumption of host MyHost1: 1120.000000 Joules +> [ 10.000000] (0:maestro@) Energy consumption of host MyHost2: 1120.000000 Joules +> [ 10.000000] (0:maestro@) Energy consumption of host MyHost3: 1120.000000 Joules diff --git a/examples/smpi/energy/energy.tesh b/examples/smpi/energy/energy.tesh index 3dd7c0d328..c11eef7a78 100644 --- a/examples/smpi/energy/energy.tesh +++ b/examples/smpi/energy/energy.tesh @@ -19,7 +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 +> [80.000000] [surf_energy/INFO] Total energy consumption: 25300.000000 Joules (used hosts: 17300.000000 Joules; unused/idle hosts: 8000.000000) +> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 8650.000000 Joules +> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 8650.000000 Joules +> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 8000.000000 Joules diff --git a/examples/smpi/energy/f77/energy.tesh b/examples/smpi/energy/f77/energy.tesh index 185cbd1f39..ac218590b4 100644 --- a/examples/smpi/energy/f77/energy.tesh +++ b/examples/smpi/energy/f77/energy.tesh @@ -26,7 +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 +> [80.000000] [surf_energy/INFO] Total energy consumption: 25300.000000 Joules (used hosts: 17300.000000 Joules; unused/idle hosts: 8000.000000) +> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 8650.000000 Joules +> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 8650.000000 Joules +> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 8000.000000 Joules diff --git a/examples/smpi/energy/f90/energy.tesh b/examples/smpi/energy/f90/energy.tesh index b1f395aebd..d8ef694daa 100644 --- a/examples/smpi/energy/f90/energy.tesh +++ b/examples/smpi/energy/f90/energy.tesh @@ -26,7 +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 +> [80.000000] [surf_energy/INFO] Total energy consumption: 25300.000000 Joules (used hosts: 17300.000000 Joules; unused/idle hosts: 8000.000000) +> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 8650.000000 Joules +> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 8650.000000 Joules +> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 8000.000000 Joules diff --git a/src/surf/plugins/host_energy.cpp b/src/surf/plugins/host_energy.cpp index aa6af90cee..124d6f21da 100644 --- a/src/surf/plugins/host_energy.cpp +++ b/src/surf/plugins/host_energy.cpp @@ -310,27 +310,26 @@ static void onHostDestruction(simgrid::s4u::Host& host) HostEnergy* host_energy = host.extension(); host_energy->update(); - XBT_INFO("Total energy of host %s: %f Joules", host.cname(), host_energy->getConsumedEnergy()); + XBT_INFO("Energy consumption of host %s: %f Joules", host.cname(), host_energy->getConsumedEnergy()); } static void onSimulationEnd() { sg_host_t* host_list = sg_host_list(); int host_count = sg_host_count(); - double total_energy = 0.0; // Total energy consumption (whole plattform) + double total_energy = 0.0; // Total energy consumption (whole platform) double used_hosts_energy = 0.0; // Energy consumed by hosts that computed something for (int i = 0; i < host_count; i++) { if (dynamic_cast(host_list[i]) == nullptr) { // Ignore virtual machines bool host_was_used = (host_list[i]->extension()->last_updated != 0); - double energy = 0.0; - energy = host_list[i]->extension()->getConsumedEnergy(); + double energy = host_list[i]->extension()->getConsumedEnergy(); total_energy += energy; if (host_was_used) used_hosts_energy += energy; } } - XBT_INFO("Summed energy consumption: %f Joules; used hosts consumed: %f Joules; unused (idle) hosts consumed: %f", + XBT_INFO("Total energy consumption: %f Joules (used hosts: %f Joules; unused/idle hosts: %f)", total_energy, used_hosts_energy, total_energy - used_hosts_energy); }