X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3aa62b6a4755ba871847a5f86473c0e651c9d661..ed26e84f533a3dc510abdc384aee02506ab9798b:/src/surf/plugins/host_energy.cpp?ds=sidebyside diff --git a/src/surf/plugins/host_energy.cpp b/src/surf/plugins/host_energy.cpp index 8d701b7493..d64ed6f12a 100644 --- a/src/surf/plugins/host_energy.cpp +++ b/src/surf/plugins/host_energy.cpp @@ -282,19 +282,19 @@ static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf: { for (simgrid::surf::Cpu* cpu : action->cpus()) { simgrid::s4u::Host* host = cpu->getHost(); - if (host == nullptr) - continue; + if (host != nullptr) { - // If it's a VM, take the corresponding PM - simgrid::s4u::VirtualMachine* vm = dynamic_cast(host); - if (vm) // If it's a VM, take the corresponding PM - host = vm->pimpl_vm_->getPm(); + // If it's a VM, take the corresponding PM + simgrid::s4u::VirtualMachine* vm = dynamic_cast(host); + if (vm) // If it's a VM, take the corresponding PM + host = vm->pimpl_vm_->getPm(); - // Get the host_energy extension for the relevant host - HostEnergy* host_energy = host->extension(); + // Get the host_energy extension for the relevant host + HostEnergy* host_energy = host->extension(); - if (host_energy->last_updated < surf_get_clock()) - host_energy->update(); + if (host_energy->last_updated < surf_get_clock()) + host_energy->update(); + } } }