geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::PowerBalancerImp Class Reference

#include <PowerBalancerImp.hpp>

Inheritance diagram for geopm::PowerBalancerImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::PowerBalancerImp:
Collaboration graph
[legend]

Public Member Functions

 PowerBalancerImp (double ctl_latency, double trial_delta, int num_sample, double measure_duration)
 Construct a testable PowerBalancerImp object. More...
 
 PowerBalancerImp (double ctl_latency)
 Construct a PowerBalancerImp object. More...
 
virtual ~PowerBalancerImp ()=default
 Destroy a PowerBalancerImp object. More...
 
void power_cap (double cap) override
 Should be called at the start of application execution with the average power cap across compute nodes. Should be called at the end of the second phase of execution to note that the power savings made across all compute nodes has been evenly redistributed. More...
 
double power_cap (void) const override
 The current power cap which cannot be exceeded without breaking contract that the average power budget across all compute nodes is maintained. More...
 
double power_limit (void) const override
 Returns the current power limit prescribed for this node. More...
 
void power_limit_adjusted (double limit) override
 Notify power balancer that a new limit has been set with the governor. More...
 
bool is_runtime_stable (double measured_runtime) override
 Update the object with a runtime measured under the current power limit and test if the current runtime sample is reliable such that a call runtime_sample() can be made. More...
 
double runtime_sample (void) const override
 Return the expected execution time of an application epoch under the current power limit. More...
 
void calculate_runtime_sample (void) override
 Sample the measured runtimes under the current power cap in the first phase of execution. This measurement will be aggregated across all compute nodes to find the largest runtime measured. More...
 
void target_runtime (double largest_runtime) override
 
bool is_target_met (double measured_runtime) override
 During the second phase of execution the power limit is decreased until the epoch runtime on the compute node under management has increased to the runtime of the slowest compute node. This method is used to update the object with a new measurement and also test if the current power limit meets the requirements. If the method returns false, then the value returned by power_limit() may have been updated. The new power limit should be enforced for the next epoch execution. More...
 
double power_slack (void) override
 Query the difference between the last power cap setting and the current power limit. If this method is called and it returns zero then the trial delta used to lower the power limit is reduced by a factor of two. More...
 
- Public Member Functions inherited from geopm::PowerBalancer
 PowerBalancer ()=default
 Construct a IPowerBalancer object. More...
 
virtual ~PowerBalancer ()=default
 Destroy a IPowerBalancer object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::PowerBalancer
static std::unique_ptr< PowerBalancermake_unique (double ctl_latency)
 Returns a unique_ptr to a concrete object constructed using the underlying implementation. More...
 
static std::shared_ptr< PowerBalancermake_shared (double ctl_latency)
 Returns a shared_ptr to a concrete object constructed using the underlying implementation. More...
 

Constructor & Destructor Documentation

◆ PowerBalancerImp() [1/2]

geopm::PowerBalancerImp::PowerBalancerImp ( double  ctl_latency,
double  trial_delta,
int  num_sample,
double  measure_duration 
)

Construct a testable PowerBalancerImp object.

◆ PowerBalancerImp() [2/2]

geopm::PowerBalancerImp::PowerBalancerImp ( double  ctl_latency)

Construct a PowerBalancerImp object.

◆ ~PowerBalancerImp()

virtual geopm::PowerBalancerImp::~PowerBalancerImp ( )
virtualdefault

Destroy a PowerBalancerImp object.

Member Function Documentation

◆ calculate_runtime_sample()

void geopm::PowerBalancerImp::calculate_runtime_sample ( void  )
overridevirtual

Sample the measured runtimes under the current power cap in the first phase of execution. This measurement will be aggregated across all compute nodes to find the largest runtime measured.

Implements geopm::PowerBalancer.

◆ is_runtime_stable()

bool geopm::PowerBalancerImp::is_runtime_stable ( double  measured_runtime)
overridevirtual

Update the object with a runtime measured under the current power limit and test if the current runtime sample is reliable such that a call runtime_sample() can be made.

Parameters
measured_runtimeMost recent measurement of the execution time for an epoch on the node being managed under the current power limit.
Returns
True if a stable measurement of expected runtime for an epoch can be made with the runtime_sample() method, and false otherwise.

m_runtime_vec used as a temporary holder until enough time has passed to determine how many samples are required in the circular buffer.

Implements geopm::PowerBalancer.

◆ is_target_met()

bool geopm::PowerBalancerImp::is_target_met ( double  measured_runtime)
overridevirtual

During the second phase of execution the power limit is decreased until the epoch runtime on the compute node under management has increased to the runtime of the slowest compute node. This method is used to update the object with a new measurement and also test if the current power limit meets the requirements. If the method returns false, then the value returned by power_limit() may have been updated. The new power limit should be enforced for the next epoch execution.

Parameters
measured_runtimeMost recent measurement of the execution time for an epoch on the node being managed under the current power limit.
Returns
True if the current power limit is reliably close to the target runtime and excess power should be sent up to the root to be redistributed, and false if more trials are required.

Implements geopm::PowerBalancer.

◆ power_cap() [1/2]

void geopm::PowerBalancerImp::power_cap ( double  cap)
overridevirtual

Should be called at the start of application execution with the average power cap across compute nodes. Should be called at the end of the second phase of execution to note that the power savings made across all compute nodes has been evenly redistributed.

Parameters
power_capThe new maximum power limit equal to the current power limit plus the amount of power saved that is being redistributed.

Implements geopm::PowerBalancer.

◆ power_cap() [2/2]

double geopm::PowerBalancerImp::power_cap ( void  ) const
overridevirtual

The current power cap which cannot be exceeded without breaking contract that the average power budget across all compute nodes is maintained.

Returns
The current value of the power cap.

Implements geopm::PowerBalancer.

◆ power_limit()

double geopm::PowerBalancerImp::power_limit ( void  ) const
overridevirtual

Returns the current power limit prescribed for this node.

Returns
The current power limit in units of Watts.

Implements geopm::PowerBalancer.

◆ power_limit_adjusted()

void geopm::PowerBalancerImp::power_limit_adjusted ( double  limit)
overridevirtual

Notify power balancer that a new limit has been set with the governor.

Parameters
limitlimit that was set.

Implements geopm::PowerBalancer.

◆ power_slack()

double geopm::PowerBalancerImp::power_slack ( void  )
overridevirtual

Query the difference between the last power cap setting and the current power limit. If this method is called and it returns zero then the trial delta used to lower the power limit is reduced by a factor of two.

Returns
The difference between the last power cap and the current power limit in units of Watts.

Implements geopm::PowerBalancer.

◆ runtime_sample()

double geopm::PowerBalancerImp::runtime_sample ( void  ) const
overridevirtual

Return the expected execution time of an application epoch under the current power limit.

Implements geopm::PowerBalancer.

◆ target_runtime()

void geopm::PowerBalancerImp::target_runtime ( double  largest_runtime)
overridevirtual
Parameters
Setthe target runtime which is the largest epoch execution time measured by any compute node since the application began or the last global increase to the power budget.
largest_runtimeThe largest expected runtime for one epoch across all compute nodes under the current power budget.

Implements geopm::PowerBalancer.


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