/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <simgrid/s4u/engine.hpp>
#include "simgrid/plugins/energy.h"
#include "simgrid/simix.hpp"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/surf/cpu_interface.hpp"
+#include <simgrid/s4u/engine.hpp>
#include <utility>
/** @addtogroup SURF_plugin_energy
{
xbt_assert(!power_range_watts_list.empty(), "No power range properties specified for host %s", host->cname());
- /* min_power corresponds to the idle power (cpu load = 0) */
+ /* min_power corresponds to the power consumed when only one core is active */
/* max_power is the power consumed at 100% cpu load */
auto range = power_range_watts_list.at(host->pstate());
double current_power = 0;
XBT_INFO("Summed energy consumption: %f Joules; used hosts consumed: %f Joules; unused (idle) hosts consumed: %f",
total_energy, used_hosts_energy, total_energy - used_hosts_energy);
}
- sg_host_t* host_list = sg_host_list();
- int host_count = sg_host_count();
- double energy = 0.0;
- for (int i = 0; i < host_count; i++) {
- energy += host_list[i]->extension<HostEnergy>()->getConsumedEnergy();
- }
- XBT_INFO("Summed energy consumption: %f Joules", energy);
-}
/* **************************** Public interface *************************** */
SG_BEGIN_DECL()