Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug a memleak
[simgrid.git] / src / surf / plugins / energy.cpp
index bbbb065..a2d14c2 100644 (file)
@@ -46,10 +46,10 @@ It starts at pstate 0 (ie, at 100 Mflop/s). In this case, you have to specify on
 In this example, the idle consumption is 95 Watts, 93 Watts and 90 Watts in each pstate while the CPU burn consumption are at 200 Watts,
 170 Watts and 150 Watts respectively.
 
-To change the pstate of a given CPU, use the following functions: #MSG_host_get_nb_pstates(), #MSG_host_set_pstate(), #MSG_host_get_power_peak_at().
+To change the pstate of a given CPU, use the following functions: #MSG_host_get_nb_pstates(), simgrid#s4u#Host#set_pstate(), #MSG_host_get_power_peak_at().
 
-To simulate the energy-related elements, first call the #sg_energy_plugin_init() before your #MSG_init(),
-and then use the following function to retrieve the consumption of a given host: #MSG_host_get_consumed_energy().
+To simulate the energy-related elements, first call the simgrid#energy#sg_energy_plugin_init() before your #MSG_init(),
+and then use the following function to retrieve the consumption of a given host: MSG_host_get_consumed_energy().
  */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_energy, surf,
@@ -186,6 +186,8 @@ void HostEnergy::initWattsRangeList()
       atof(xbt_dynar_get_as(current_power_values, 0, char*)),
       atof(xbt_dynar_get_as(current_power_values, 1, char*))
     ));
+
+    xbt_dynar_free(&current_power_values);
        }
        xbt_dynar_free(&all_power_values);
 }
@@ -201,8 +203,7 @@ static void onCreation(simgrid::s4u::Host& host) {
   host.extension_set(new HostEnergy(&host));
 }
 
-static void onActionStateChange(simgrid::surf::CpuAction *action,
-    e_surf_action_state_t old, e_surf_action_state_t cur) {
+static void onActionStateChange(simgrid::surf::CpuAction *action, e_surf_action_state_t previous) {
   const char *name = getActionCpu(action)->getName();
   simgrid::surf::Host *host = sg_host_by_name(name)->extension<simgrid::surf::Host>();
   simgrid::surf::VirtualMachine *vm = dynamic_cast<simgrid::surf::VirtualMachine*>(host);