geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::Controller Class Reference

#include <Controller.hpp>

Public Member Functions

 Controller ()
 
 Controller (std::shared_ptr< Comm > ppn1_comm)
 Standard constructor for the Controller. More...
 
 Controller (std::shared_ptr< Comm > comm, PlatformIO &plat_io, const std::string &agent_name, int num_send_down, int num_send_up, std::unique_ptr< TreeComm > tree_comm, ApplicationSampler &application_sampler, std::shared_ptr< ApplicationIO > application_io, std::unique_ptr< Reporter > reporter, std::unique_ptr< Tracer > tracer, std::unique_ptr< EndpointPolicyTracer > policy_tracer, std::shared_ptr< ProfileTracer > profile_tracer, std::vector< std::unique_ptr< Agent > > level_agent, std::vector< std::string > policy_names, const std::string &policy_path, bool do_policy, std::unique_ptr< EndpointUser > endpoint, const std::string &endpoint_path, bool do_endpoint, std::shared_ptr< InitControl > init_control, bool do_init_control)
 Constructor for testing that allows injecting mocked versions of internal objects. More...
 
 Controller (const Controller &other)=delete
 
Controlleroperator= (const Controller &other)=delete
 
virtual ~Controller ()
 
void run (void)
 Run control algorithm. More...
 
void step (void)
 Run a single step of the control algorithm. More...
 
void walk_down (void)
 Propagate policy information from the resource manager at the root of the tree down to the controllers on every node. More...
 
void walk_up (void)
 Read hardware telemetry and application data and send the combined data up the tree to the resource manager. More...
 
void generate (void)
 Write the report file and finalize the trace. More...
 
void pthread (const pthread_attr_t *attr, pthread_t *thread)
 Run control algorithm as a separate thread. More...
 
void setup_trace (void)
 Configure the trace with custom columns from the Agent. More...
 
void abort (void)
 Called upon failure to facilitate graceful destruction of the Controller and notify application. More...
 
std::set< std::string > get_hostnames (const std::string &hostname)
 Return the names of hosts active in the current job. Must be called by all controllers in the tree or else a hang will occur. More...
 

Constructor & Destructor Documentation

◆ Controller() [1/4]

geopm::Controller::Controller ( )

◆ Controller() [2/4]

geopm::Controller::Controller ( std::shared_ptr< Comm ppn1_comm)

Standard constructor for the Controller.

Parameters
[in]ppn1_commThe MPI communicator that supports the control messages.

◆ Controller() [3/4]

geopm::Controller::Controller ( std::shared_ptr< Comm comm,
PlatformIO &  plat_io,
const std::string &  agent_name,
int  num_send_down,
int  num_send_up,
std::unique_ptr< TreeComm tree_comm,
ApplicationSampler application_sampler,
std::shared_ptr< ApplicationIO application_io,
std::unique_ptr< Reporter reporter,
std::unique_ptr< Tracer tracer,
std::unique_ptr< EndpointPolicyTracer policy_tracer,
std::shared_ptr< ProfileTracer profile_tracer,
std::vector< std::unique_ptr< Agent > >  level_agent,
std::vector< std::string >  policy_names,
const std::string &  policy_path,
bool  do_policy,
std::unique_ptr< EndpointUser endpoint,
const std::string &  endpoint_path,
bool  do_endpoint,
std::shared_ptr< InitControl init_control,
bool  do_init_control 
)

Constructor for testing that allows injecting mocked versions of internal objects.

◆ Controller() [4/4]

geopm::Controller::Controller ( const Controller other)
delete

◆ ~Controller()

geopm::Controller::~Controller ( )
virtual

Member Function Documentation

◆ abort()

void geopm::Controller::abort ( void  )

Called upon failure to facilitate graceful destruction of the Controller and notify application.

◆ generate()

void geopm::Controller::generate ( void  )

Write the report file and finalize the trace.

◆ get_hostnames()

std::set< std::string > geopm::Controller::get_hostnames ( const std::string &  hostname)

Return the names of hosts active in the current job. Must be called by all controllers in the tree or else a hang will occur.

Parameters
[in]hostnameHostname of the calling Controller.
Returns
Returns set of hostnames of all connected controllers if the calling controller is at the root of the tree, otherwise returns an empty set.

◆ operator=()

Controller& geopm::Controller::operator= ( const Controller other)
delete

◆ pthread()

void geopm::Controller::pthread ( const pthread_attr_t *  attr,
pthread_t *  thread 
)

Run control algorithm as a separate thread.

Creates a POSIX thread running the control algorithm continuously until the shutdown signal is received. This is intended to be called by the application under control. With this method of launch the supporting MPI implementation must be enabled for MPI_THREAD_MULTIPLE using MPI_Init_thread().

Parameters
[in]attrThe POSIX thread attributes applied when thread is created.
[out]threadPointer to the POSIX thread that is created.

◆ run()

void geopm::Controller::run ( void  )

Run control algorithm.

Steps the control algorithm continuously until the shutdown signal is received. Since this is a blocking call that never returns, it is intended that profiling information is provided through POSIX shared memory.

◆ setup_trace()

void geopm::Controller::setup_trace ( void  )

Configure the trace with custom columns from the Agent.

◆ step()

void geopm::Controller::step ( void  )

Run a single step of the control algorithm.

One step consists of receiving policy information from the resource manager, sending them to every other controller that the node is a parent of, and reading hardware telemetry.

◆ walk_down()

void geopm::Controller::walk_down ( void  )

Propagate policy information from the resource manager at the root of the tree down to the controllers on every node.

At each level of the tree, Agents may modify policies before sending them to their children.

◆ walk_up()

void geopm::Controller::walk_up ( void  )

Read hardware telemetry and application data and send the combined data up the tree to the resource manager.

At each level of the tree, Agents may modify and aggregate samples before sending them up up to their parents.


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