- XBT_INFO("Total energy of host %s: %f Joules", cpu->getName(), cpu_energy->getConsumedEnergy());
- delete cpu_energy_it->second;
- surf_energy->erase(cpu_energy_it);
+ // Adrien - October 2015, Changes related to VM energy extensions
+ // Only report/delete and erase if the cpu_energy is related to a physical one
+ if(cpu->isVirtual() == NULL){
+ XBT_INFO("Total energy of host %s: %f Joules", cpu->getName(), cpu_energy->getConsumedEnergy());
+ delete cpu_energy_it->second;
+ surf_energy->erase(cpu_energy_it);
+ }
+