* under the terms of the license (GNU LGPL) which comes with this package. */
#include <utility>
-#include <vector>
#include "simgrid/plugins/energy.h"
#include "simgrid/simix.hpp"
double HostEnergy::getConsumedEnergy()
{
if (last_updated < surf_get_clock()) // We need to simcall this as it modifies the environment
- simgrid::simix::kernel(std::bind(&HostEnergy::update, this));
+ simgrid::simix::kernelImmediate(std::bind(&HostEnergy::update, this));
return total_energy;
}
if (vm) // If it's a VM, take the corresponding PM
host = vm->getPm()->extension<simgrid::surf::HostImpl>();
- HostEnergy *host_energy = host->p_host->extension<HostEnergy>();
+ HostEnergy *host_energy = host->piface->extension<HostEnergy>();
if(host_energy->last_updated < surf_get_clock())
host_energy->update();