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

#include <ConstConfigIOGroup.hpp>

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

Public Member Functions

 ConstConfigIOGroup ()
 
 ConstConfigIOGroup (const PlatformTopo &topo, const std::string &user_file_path, const std::string &default_file_path, const std::string &hostname)
 
std::set< std::string > signal_names (void) const override
 Returns the names of all signals provided by the IOGroup. More...
 
std::set< std::string > control_names (void) const override
 
bool is_valid_signal (const std::string &signal_name) const override
 Test if signal_name refers to a signal supported by the group. More...
 
bool is_valid_control (const std::string &control_name) const override
 
int signal_domain_type (const std::string &signal_name) const override
 
int control_domain_type (const std::string &control_name) const override
 
int push_signal (const std::string &signal_name, int domain_type, int domain_idx) override
 Add a signal to the list of signals that is read by read_batch() and sampled by sample(). More...
 
int push_control (const std::string &control_name, int domain_type, int domain_idx) override
 Should not be called; this IOGroup does not provide any controls. More...
 
void read_batch (void) override
 this is essentially a no-op as this IOGroup's signals are constant. More...
 
void write_batch (void) override
 Does nothing; this IOGroup does not provide any controls. More...
 
double sample (int batch_idx) override
 Retrieve signal value from data read by last call to read_batch() for a particular signal previously pushed with push_signal(). More...
 
void adjust (int batch_idx, double setting) override
 Should not be called; this IOGroup does not provide any controls. More...
 
double read_signal (const std::string &signal_name, int domain_type, int domain_idx) override
 Read from platform and interpret into SI units a signal given its name and domain. Does not modify the values stored by calling read_batch(). More...
 
void write_control (const std::string &control_name, int domain_type, int domain_idx, double setting) override
 Should not be called; this IOGroup does not provide any controls. More...
 
void save_control (void) override
 Does nothing; this IOGroup does not provide any controls. More...
 
void restore_control (void) override
 Does nothing; this IOGroup does not provide any controls. More...
 
std::function< double(const std::vector< double > &)> agg_function (const std::string &signal_name) const override
 Return a function that should be used when aggregating the given signal. More...
 
std::function< std::string(double)> format_function (const std::string &signal_name) const override
 Returns a function that can be used to convert a signal of the given name into a printable string. May be one of the IOGroup::format_*() static methods, or another function. More...
 
std::string signal_description (const std::string &signal_name) const override
 Returns a description of the signal. This string can be used by tools to generate help text for users of the IOGroup. More...
 
std::string control_description (const std::string &control_name) const override
 
int signal_behavior (const std::string &signal_name) const override
 
void save_control (const std::string &save_path) override
 Does nothing; this IOGroup does not provide any controls. More...
 
void restore_control (const std::string &save_path) override
 Does nothing; this IOGroup does not provide any controls. More...
 
std::string name (void) const override
 Get the IOGroup name. More...
 
- Public Member Functions inherited from geopm::IOGroup
 IOGroup ()=default
 
virtual ~IOGroup ()=default
 

Static Public Member Functions

static std::string plugin_name (void)
 
static std::unique_ptr< IOGroupmake_plugin (void)
 
- Static Public Member Functions inherited from geopm::IOGroup
static std::vector< std::string > iogroup_names (void)
 
static std::unique_ptr< IOGroupmake_unique (const std::string &iogroup_name)
 
static m_units_e string_to_units (const std::string &str)
 Convert a string to the corresponding m_units_e value. More...
 
static std::string units_to_string (int)
 Convert the m_units_e value to the corresponding string. More...
 
static m_signal_behavior_e string_to_behavior (const std::string &str)
 Convert a string to the corresponding m_signal_behavior_e value. More...
 

Additional Inherited Members

- Public Types inherited from geopm::IOGroup
enum  m_units_e {
  M_UNITS_NONE , M_UNITS_SECONDS , M_UNITS_HERTZ , M_UNITS_WATTS ,
  M_UNITS_JOULES , M_UNITS_CELSIUS , M_UNITS_AMPERES , M_UNITS_VOLTS ,
  M_NUM_UNITS
}
 
enum  m_signal_behavior_e {
  M_SIGNAL_BEHAVIOR_CONSTANT , M_SIGNAL_BEHAVIOR_MONOTONE , M_SIGNAL_BEHAVIOR_VARIABLE , M_SIGNAL_BEHAVIOR_LABEL ,
  M_NUM_SIGNAL_BEHAVIOR
}
 Description of the runtime behavior of a signal. More...
 
- Static Public Attributes inherited from geopm::IOGroup
static const std::string M_PLUGIN_PREFIX = "libgeopmiogroup_"
 

Constructor & Destructor Documentation

◆ ConstConfigIOGroup() [1/2]

geopm::ConstConfigIOGroup::ConstConfigIOGroup ( )

◆ ConstConfigIOGroup() [2/2]

geopm::ConstConfigIOGroup::ConstConfigIOGroup ( const PlatformTopo topo,
const std::string &  user_file_path,
const std::string &  default_file_path,
const std::string &  hostname 
)

Member Function Documentation

◆ adjust()

void geopm::ConstConfigIOGroup::adjust ( int  batch_idx,
double  setting 
)
overridevirtual

Should not be called; this IOGroup does not provide any controls.

Exceptions
geopm::Exceptionthere are no controls supported by the ConstConfigIOGroup

Implements geopm::IOGroup.

◆ agg_function()

std::function< double(const std::vector< double > &)> geopm::ConstConfigIOGroup::agg_function ( const std::string &  signal_name) const
overridevirtual

Return a function that should be used when aggregating the given signal.

Parameters
[in]signal_nameName of the signal.

Implements geopm::IOGroup.

◆ control_description()

std::string geopm::ConstConfigIOGroup::control_description ( const std::string &  control_name) const
overridevirtual
Exceptions
geopm::Exceptionthere are no controls supported by the ConstConfigIOGroup

Implements geopm::IOGroup.

◆ control_domain_type()

int geopm::ConstConfigIOGroup::control_domain_type ( const std::string &  control_name) const
overridevirtual
Returns
GEOPM_DOMAIN_INVALID; this IOGroup does not provide any controls.

Implements geopm::IOGroup.

◆ control_names()

std::set< std::string > geopm::ConstConfigIOGroup::control_names ( void  ) const
overridevirtual
Returns
empty set; this IOGroup does not provide any controls.

Implements geopm::IOGroup.

◆ format_function()

std::function< std::string(double)> geopm::ConstConfigIOGroup::format_function ( const std::string &  signal_name) const
overridevirtual

Returns a function that can be used to convert a signal of the given name into a printable string. May be one of the IOGroup::format_*() static methods, or another function.

Reimplemented from geopm::IOGroup.

◆ is_valid_control()

bool geopm::ConstConfigIOGroup::is_valid_control ( const std::string &  control_name) const
overridevirtual
Returns
false; this IOGroup does not provide any controls.

Implements geopm::IOGroup.

◆ is_valid_signal()

bool geopm::ConstConfigIOGroup::is_valid_signal ( const std::string &  signal_name) const
overridevirtual

Test if signal_name refers to a signal supported by the group.

Parameters
[in]signal_nameName of signal to test.
Returns
True if signal is supported, false otherwise.

Implements geopm::IOGroup.

◆ make_plugin()

std::unique_ptr< IOGroup > geopm::ConstConfigIOGroup::make_plugin ( void  )
static

◆ name()

std::string geopm::ConstConfigIOGroup::name ( void  ) const
overridevirtual

Get the IOGroup name.

By convention this name is given in all capital letters. This string provides a namespace for the IOGroup since all IOGroups loaded by PlatformIO must have distinct names. This unique namespace may be used in any context to distinguish IOGroups.

One important use case is that the IOGroup name prefixes all low level signal and control names in conjunction with "::". This name prefix may be used to distinguish between the high level signals and controls (i.e. aliases like CPU_FREQUENCY_MAX_CONTROL) that do not contain the IOGroup prefix, and the low level signals and controls that do (e.g. "MSR::PERF_CTL:FREQ").

Returns
The name of the IOGroup in all caps.

Implements geopm::IOGroup.

◆ plugin_name()

std::string geopm::ConstConfigIOGroup::plugin_name ( void  )
static

◆ push_control()

int geopm::ConstConfigIOGroup::push_control ( const std::string &  control_name,
int  domain_type,
int  domain_idx 
)
overridevirtual

Should not be called; this IOGroup does not provide any controls.

Exceptions
geopm::Exceptionthere are no controls supported by the ConstConfigIOGroup

Implements geopm::IOGroup.

◆ push_signal()

int geopm::ConstConfigIOGroup::push_signal ( const std::string &  signal_name,
int  domain_type,
int  domain_idx 
)
overridevirtual

Add a signal to the list of signals that is read by read_batch() and sampled by sample().

Parameters
[in]signal_nameName of the signal requested.
[in]domain_typeOne of the values from the PlatformTopo::m_domain_e enum described in PlatformTopo.hpp.
[in]domain_idxThe index of the domain within the set of domains of the same type on the platform.
Returns
Index of signal when sample() method is called.

Implements geopm::IOGroup.

◆ read_batch()

void geopm::ConstConfigIOGroup::read_batch ( void  )
overridevirtual

this is essentially a no-op as this IOGroup's signals are constant.

Implements geopm::IOGroup.

◆ read_signal()

double geopm::ConstConfigIOGroup::read_signal ( const std::string &  signal_name,
int  domain_type,
int  domain_idx 
)
overridevirtual

Read from platform and interpret into SI units a signal given its name and domain. Does not modify the values stored by calling read_batch().

Parameters
[in]signal_nameName of the signal requested.
[in]domain_typeOne of the values from the PlatformTopo::m_domain_e enum described in PlatformTopo.hpp.
[in]domain_idxThe index of the domain within the set of domains of the same type on the platform.
Returns
The value in SI units of the signal.

Implements geopm::IOGroup.

◆ restore_control() [1/2]

void geopm::ConstConfigIOGroup::restore_control ( const std::string &  save_path)
overridevirtual

Does nothing; this IOGroup does not provide any controls.

Parameters
save_paththis argument is ignored

Implements geopm::IOGroup.

◆ restore_control() [2/2]

void geopm::ConstConfigIOGroup::restore_control ( void  )
overridevirtual

Does nothing; this IOGroup does not provide any controls.

Implements geopm::IOGroup.

◆ sample()

double geopm::ConstConfigIOGroup::sample ( int  sample_idx)
overridevirtual

Retrieve signal value from data read by last call to read_batch() for a particular signal previously pushed with push_signal().

Parameters
[in]sample_idxThe index returned by previous call to push_signal().
Returns
Value of signal in SI units.

Implements geopm::IOGroup.

◆ save_control() [1/2]

void geopm::ConstConfigIOGroup::save_control ( const std::string &  save_path)
overridevirtual

Does nothing; this IOGroup does not provide any controls.

Parameters
save_paththis argument is ignored

Implements geopm::IOGroup.

◆ save_control() [2/2]

void geopm::ConstConfigIOGroup::save_control ( void  )
overridevirtual

Does nothing; this IOGroup does not provide any controls.

Implements geopm::IOGroup.

◆ signal_behavior()

int geopm::ConstConfigIOGroup::signal_behavior ( const std::string &  signal_name) const
overridevirtual
Returns
M_SIGNAL_BEHAVIOR_CONSTANT

Implements geopm::IOGroup.

◆ signal_description()

std::string geopm::ConstConfigIOGroup::signal_description ( const std::string &  signal_name) const
overridevirtual

Returns a description of the signal. This string can be used by tools to generate help text for users of the IOGroup.

Implements geopm::IOGroup.

◆ signal_domain_type()

int geopm::ConstConfigIOGroup::signal_domain_type ( const std::string &  signal_name) const
overridevirtual
Returns
the domain for the provided signal if the signal is valid for this IOGroup, otherwise GEOPM_DOMAIN_INVALID.

Implements geopm::IOGroup.

◆ signal_names()

std::set< std::string > geopm::ConstConfigIOGroup::signal_names ( void  ) const
overridevirtual

Returns the names of all signals provided by the IOGroup.

Implements geopm::IOGroup.

◆ write_batch()

void geopm::ConstConfigIOGroup::write_batch ( void  )
overridevirtual

Does nothing; this IOGroup does not provide any controls.

Implements geopm::IOGroup.

◆ write_control()

void geopm::ConstConfigIOGroup::write_control ( const std::string &  control_name,
int  domain_type,
int  domain_idx,
double  setting 
)
overridevirtual

Should not be called; this IOGroup does not provide any controls.

Exceptions
geopm::Exceptionthere are no controls supported by the ConstConfigIOGroup

Implements geopm::IOGroup.


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