X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/299c52751d8bf7ed4f9fc40f668025a5cb425901..08668c93eec47c236766aae49bc39e3c772180f9:/src/plugins/host_energy.cpp diff --git a/src/plugins/host_energy.cpp b/src/plugins/host_energy.cpp index 4e695cd2bc..92a6b5c157 100644 --- a/src/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -498,8 +498,8 @@ void sg_host_energy_plugin_init() // during the recv call. By updating at the beginning of a compute, we can // fix that. (If the cpu is not idle, this is not required.) simgrid::kernel::activity::ExecImpl::on_creation.connect([](simgrid::kernel::activity::ExecImpl const& activity) { - if (activity.host_ != nullptr) { // We only run on one host - simgrid::s4u::Host* host = activity.host_; + if (activity.get_host_number() == 1) { // We only run on one host + simgrid::s4u::Host* host = activity.get_host(); simgrid::s4u::VirtualMachine* vm = dynamic_cast(host); if (vm != nullptr) host = vm->get_pm();