From f973433226af2e2e3059b62578bb0f3b215380fb Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 15 Nov 2023 16:33:20 +0100 Subject: [PATCH] Fix Host::execute to use *this as a host location, not the this_actor->get_host() --- examples/cpp/battery-energy/s4u-battery-energy.tesh | 12 ++++++------ src/s4u/s4u_Host.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/cpp/battery-energy/s4u-battery-energy.tesh b/examples/cpp/battery-energy/s4u-battery-energy.tesh index a35ff26a63..ee9b4a72c9 100644 --- a/examples/cpp/battery-energy/s4u-battery-energy.tesh +++ b/examples/cpp/battery-energy/s4u-battery-energy.tesh @@ -4,11 +4,11 @@ $ ${bindir:=.}/s4u-battery-energy ${platfdir}/energy_platform.xml > [MyHost1:manager:(1) 0.000000] [battery_energy/INFO] Battery state: SoC: 0.800000 SoH: 1.000000 Energy stored: 28800.000000J Energy provided: 0.000000J Energy consumed 0.000000J > [MyHost1:manager:(1) 0.000000] [battery_energy/INFO] Connecting hosts MyHost1 and MyHost2 to the battery > [MyHost1:manager:(1) 0.000000] [battery_energy/INFO] Host MyHost1 will now execute 1000000000.000000 flops -> [96.209721] [battery_energy/INFO] Handler -> Battery low: SoC: 0.200000 SoH: 0.999700 Energy stored: 7197.839784J Energy provided: 19441.944194J Energy consumed 0.000000J -> [96.209721] [battery_energy/INFO] Disconnecting hosts MyHost1 and MyHost2 -> [96.209721] [battery_energy/INFO] Energy consumed this far by: MyHost1: 9820.972097J, MyHost2: 9620.972097J, MyHost3: 9620.972097J +> [93.709721] [battery_energy/INFO] Handler -> Battery low: SoC: 0.200000 SoH: 0.999700 Energy stored: 7197.839784J Energy provided: 19441.944194J Energy consumed 0.000000J +> [93.709721] [battery_energy/INFO] Disconnecting hosts MyHost1 and MyHost2 +> [93.709721] [battery_energy/INFO] Energy consumed this far by: MyHost1: 9370.972097J, MyHost2: 10370.972097J, MyHost3: 9370.972097J > [MyHost1:manager:(1) 200.000000] [battery_energy/INFO] Battery state: SoC: 0.200000 SoH: 0.999700 Energy stored: 7197.839784J Energy provided: 19441.944194J Energy consumed 0.000000J -> [200.000000] [host_energy/INFO] Total energy consumption: 60200.000000 Joules (used hosts: 20200.000000 Joules; unused/idle hosts: 40000.000000) -> [200.000000] [host_energy/INFO] Energy consumption of host MyHost1: 20200.000000 Joules -> [200.000000] [host_energy/INFO] Energy consumption of host MyHost2: 20000.000000 Joules +> [200.000000] [host_energy/INFO] Total energy consumption: 61000.000000 Joules (used hosts: 21000.000000 Joules; unused/idle hosts: 40000.000000) +> [200.000000] [host_energy/INFO] Energy consumption of host MyHost1: 20000.000000 Joules +> [200.000000] [host_energy/INFO] Energy consumption of host MyHost2: 21000.000000 Joules > [200.000000] [host_energy/INFO] Energy consumption of host MyHost3: 20000.000000 Joules diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index 62b4b121b8..670882c392 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -420,7 +420,7 @@ void Host::execute(double flops) const void Host::execute(double flops, double priority) const { - this_actor::exec_init(flops)->set_priority(1 / priority)->start()->wait(); + Exec::init()->set_flops_amount(flops)->set_host(const_cast(this))->set_priority(1 / priority)->wait(); } Host* Host::seal() -- 2.20.1