Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
unused variable
[simgrid.git] / src / surf / plugins / energy.cpp
index d1d871f..a8e9398 100644 (file)
@@ -46,7 +46,6 @@ To simulate the energy-related elements, first call the #sg_energy_plugin_init()
 and then use the following function to retrieve the consumption of a given host: #MSG_host_get_consumed_energy().
  */
 
-XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_energy, surf,
                                 "Logging specific to the SURF energy plugin");
 
@@ -87,9 +86,8 @@ static void energyCpuDestructedCallback(Cpu *cpu){
   CpuEnergy *cpu_energy = cpu_energy_it->second;
   update_consumption(cpu, cpu_energy);
 
-  // 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){
+  // Do nothing if that's a virtual CPU, only act for physical CPUs
+  if(cpu->getPhysicalCPU() == 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);