SimGrid  3.21
Versatile Simulation of Distributed Systems
simgrid::plugin::HostEnergy Class Reference

Public Member Functions

 HostEnergy (simgrid::s4u::Host *ptr)
 
 ~HostEnergy ()
 
double get_current_watts_value ()
 Computes the power consumed by the host according to the current situation. More...
 
double get_current_watts_value (double cpu_load)
 Computes the power that the host would consume at the provided processor load. More...
 
double get_consumed_energy ()
 
double get_idle_consumption ()
 
double get_watt_min_at (int pstate)
 
double get_watt_max_at (int pstate)
 
void update ()
 

Public Attributes

double watts_off_ = 0.0
 
double total_energy_ = 0.0
 
double last_updated_
 

Static Public Attributes

static simgrid::xbt::Extension< simgrid::s4u::Host, HostEnergyEXTENSION_ID
 

Constructor & Destructor Documentation

◆ HostEnergy()

simgrid::plugin::HostEnergy::HostEnergy ( simgrid::s4u::Host ptr)
explicit

◆ ~HostEnergy()

simgrid::plugin::HostEnergy::~HostEnergy ( )
default

Member Function Documentation

◆ get_current_watts_value() [1/2]

double simgrid::plugin::HostEnergy::get_current_watts_value ( )

Computes the power consumed by the host according to the current situation.

  • If the host is off, that's the watts_off value
  • if it's on, take the current pstate and the current processor load into account

Divide by the number of cores here

◆ get_current_watts_value() [2/2]

double simgrid::plugin::HostEnergy::get_current_watts_value ( double  cpu_load)

Computes the power that the host would consume at the provided processor load.

Whether the host is ON or OFF is not taken into account.

The min_power states how much we consume when only one single core is working. This means that when cpu_load == 1/coreCount, then current_power == min_power.

The maximum must be reached when all cores are working (but 1 core was already accounted for by min_power) i.e., we need min_power + (maxCpuLoad-1/coreCount)*power_slope == max_power (maxCpuLoad is by definition 1)

◆ get_consumed_energy()

double simgrid::plugin::HostEnergy::get_consumed_energy ( )

◆ get_idle_consumption()

double simgrid::plugin::HostEnergy::get_idle_consumption ( )

◆ get_watt_min_at()

double simgrid::plugin::HostEnergy::get_watt_min_at ( int  pstate)

◆ get_watt_max_at()

double simgrid::plugin::HostEnergy::get_watt_max_at ( int  pstate)

◆ update()

void simgrid::plugin::HostEnergy::update ( )

Member Data Documentation

◆ EXTENSION_ID

simgrid::xbt::Extension< simgrid::s4u::Host, HostEnergy > simgrid::plugin::HostEnergy::EXTENSION_ID
static

◆ watts_off_

double simgrid::plugin::HostEnergy::watts_off_ = 0.0

◆ total_energy_

double simgrid::plugin::HostEnergy::total_energy_ = 0.0

◆ last_updated_

double simgrid::plugin::HostEnergy::last_updated_

The documentation for this class was generated from the following file: