// If it's a VM, take the corresponding PM
simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
if (vm) // If it's a VM, take the corresponding PM
- host = vm->pimpl_vm_->getPm();
+ host = vm->getPm();
// Get the host_energy extension for the relevant host
HostEnergy* host_energy = host->extension<HostEnergy>();
if (dynamic_cast<simgrid::s4u::VirtualMachine*>(&host)) // Ignore virtual machines
return;
- HostEnergy* host_energy = host.extension<HostEnergy>();
- host_energy->update();
- XBT_INFO("Energy consumption of host %s: %f Joules", host.getCname(), host_energy->getConsumedEnergy());
+ XBT_INFO("Energy consumption of host %s: %f Joules", host.getCname(),
+ host.extension<HostEnergy>()->getConsumedEnergy());
}
static void onSimulationEnd()