geopm 3.1.1.dev410+g40bf96ed
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
geopm::EndpointImp Class Reference

#include <EndpointImp.hpp>

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

Public Member Functions

 EndpointImp ()=delete
 
 EndpointImp (const EndpointImp &other)=delete
 
EndpointImpoperator= (const EndpointImp &other)=delete
 
 EndpointImp (const std::string &data_path)
 
 EndpointImp (const std::string &data_path, std::shared_ptr< SharedMemory > policy_shmem, std::shared_ptr< SharedMemory > sample_shmem, size_t num_policy, size_t num_sample)
 
virtual ~EndpointImp ()
 
void open (void) override
 Create the shared memory regions belonging to the Endpoint.
 
void close (void) override
 Unlink the shared memory regions belonging to the Endpoint.
 
void write_policy (const std::vector< double > &policy) override
 Write a set of policy values for the Agent.
 
double read_sample (std::vector< double > &sample) override
 Read a set of samples from the Agent.
 
std::string get_agent (void) override
 Returns the Agent name, or empty string if no Agent is attached.
 
void wait_for_agent_attach (double timeout) override
 Blocks until an agent attaches to the endpoint, a timeout is reached, or the operation is canceled with stop_wait_loop(). Throws an exception if the given timeout is reached before an agent attaches. The name of the attached agent can be read with get_agent().
 
void wait_for_agent_detach (double timeout) override
 Blocks as long as the same agent is still attached to the endpoint, a timeout is reached, or the operation is canceled with stop_wait_loop(). The name of the attached agent can be read with get_agent().
 
void stop_wait_loop (void) override
 Cancels any current wait loops in this Endpoint.
 
void reset_wait_loop (void) override
 Re-enables wait loops occurring after this call.
 
std::string get_profile_name (void) override
 Returns the profile name associated with the attached application, or empty if no controller is attached.
 
std::set< std::string > get_hostnames (void) override
 Returns the list of hostnames used by the attached application, or empty if no controller is attached.
 
- Public Member Functions inherited from geopm::Endpoint
virtual ~Endpoint ()=default
 

Static Public Member Functions

static std::string shm_policy_postfix (void)
 
static std::string shm_sample_postfix (void)
 
- Static Public Member Functions inherited from geopm::Endpoint
static std::unique_ptr< Endpointmake_unique (const std::string &data_path)
 Factory method for the Endpoint used to set the policy.
 

Constructor & Destructor Documentation

◆ EndpointImp() [1/4]

geopm::EndpointImp::EndpointImp ( )
delete

◆ EndpointImp() [2/4]

geopm::EndpointImp::EndpointImp ( const EndpointImp other)
delete

◆ EndpointImp() [3/4]

geopm::EndpointImp::EndpointImp ( const std::string &  data_path)

◆ EndpointImp() [4/4]

geopm::EndpointImp::EndpointImp ( const std::string &  data_path,
std::shared_ptr< SharedMemory >  policy_shmem,
std::shared_ptr< SharedMemory >  sample_shmem,
size_t  num_policy,
size_t  num_sample 
)

◆ ~EndpointImp()

geopm::EndpointImp::~EndpointImp ( )
virtual

Member Function Documentation

◆ close()

void geopm::EndpointImp::close ( void  )
overridevirtual

Unlink the shared memory regions belonging to the Endpoint.

Implements geopm::Endpoint.

◆ get_agent()

std::string geopm::EndpointImp::get_agent ( void  )
overridevirtual

Returns the Agent name, or empty string if no Agent is attached.

Implements geopm::Endpoint.

◆ get_hostnames()

std::set< std::string > geopm::EndpointImp::get_hostnames ( void  )
overridevirtual

Returns the list of hostnames used by the attached application, or empty if no controller is attached.

Implements geopm::Endpoint.

◆ get_profile_name()

std::string geopm::EndpointImp::get_profile_name ( void  )
overridevirtual

Returns the profile name associated with the attached application, or empty if no controller is attached.

Implements geopm::Endpoint.

◆ open()

void geopm::EndpointImp::open ( void  )
overridevirtual

Create the shared memory regions belonging to the Endpoint.

Implements geopm::Endpoint.

◆ operator=()

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

◆ read_sample()

double geopm::EndpointImp::read_sample ( std::vector< double > &  sample)
overridevirtual

Read a set of samples from the Agent.

Parameters
[out]sampleThe sample values. The order is specified by the Agent.
Returns
The age of the sample in seconds.

Implements geopm::Endpoint.

◆ reset_wait_loop()

void geopm::EndpointImp::reset_wait_loop ( void  )
overridevirtual

Re-enables wait loops occurring after this call.

Implements geopm::Endpoint.

◆ shm_policy_postfix()

std::string geopm::EndpointImp::shm_policy_postfix ( void  )
static

◆ shm_sample_postfix()

std::string geopm::EndpointImp::shm_sample_postfix ( void  )
static

◆ stop_wait_loop()

void geopm::EndpointImp::stop_wait_loop ( void  )
overridevirtual

Cancels any current wait loops in this Endpoint.

Implements geopm::Endpoint.

◆ wait_for_agent_attach()

void geopm::EndpointImp::wait_for_agent_attach ( double  timeout)
overridevirtual

Blocks until an agent attaches to the endpoint, a timeout is reached, or the operation is canceled with stop_wait_loop(). Throws an exception if the given timeout is reached before an agent attaches. The name of the attached agent can be read with get_agent().

Implements geopm::Endpoint.

◆ wait_for_agent_detach()

void geopm::EndpointImp::wait_for_agent_detach ( double  timeout)
overridevirtual

Blocks as long as the same agent is still attached to the endpoint, a timeout is reached, or the operation is canceled with stop_wait_loop(). The name of the attached agent can be read with get_agent().

Implements geopm::Endpoint.

◆ write_policy()

void geopm::EndpointImp::write_policy ( const std::vector< double > &  policy)
overridevirtual

Write a set of policy values for the Agent.

Parameters
[in]policyThe policy values. The order is specified by the Agent.

Implements geopm::Endpoint.


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