geopm
3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
|
#include <PlatformIOImp.hpp>
Public Member Functions | |
PlatformIOImp () | |
PlatformIOImp (std::list< std::shared_ptr< IOGroup > > iogroup_list, const PlatformTopo &topo) | |
PlatformIOImp (const PlatformIOImp &other)=delete | |
PlatformIOImp & | operator= (const PlatformIOImp &other)=delete |
virtual | ~PlatformIOImp ()=default |
void | register_iogroup (std::shared_ptr< IOGroup > iogroup) override |
Registers an IOGroup with the PlatformIO so that its signals and controls are available through the PlatformIO interface. More... | |
std::set< std::string > | signal_names (void) const override |
Returns the names of all available signals. This includes all signals and aliases provided by IOGroups as well as signals provided by PlatformIO itself. More... | |
std::set< std::string > | control_names (void) const override |
Returns the names of all available controls. This includes all controls and aliases provided by IOGroups as well as controls provided by PlatformIO itself. More... | |
int | signal_domain_type (const std::string &signal_name) const override |
Query the domain for a named signal. More... | |
int | control_domain_type (const std::string &control_name) const override |
Query the domain for a named control. More... | |
int | push_signal (const std::string &signal_name, int domain_type, int domain_idx) override |
Push a signal onto the end of the vector that can be sampled. More... | |
int | push_control (const std::string &control_name, int domain_type, int domain_idx) override |
Push a control onto the end of the vector that can be adjusted. More... | |
double | sample (int signal_idx) override |
Sample a single signal that has been pushed on to the signal stack. Must be called after a call to read_batch(void) method which updates the state of all signals. More... | |
void | adjust (int control_idx, double setting) override |
Adjust a single control that has been pushed on to the control stack. This control will not take effect until the next call to write_batch(void). More... | |
void | read_batch (void) override |
Read all pushed signals so that the next call to sample() will reflect the updated data. More... | |
void | write_batch (void) override |
Write all of the pushed controls so that values previously given to adjust() are written to the platform. 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 |
Interpret the setting and write setting to the platform. Does not modify the values stored by calling adjust(). More... | |
void | save_control (void) override |
Save the state of all controls so that any subsequent changes made through PlatformIO can be undone with a call to the restore_control() method. More... | |
void | restore_control (void) override |
Restore all controls to values recorded in previous call to the save_control() method. More... | |
std::function< double(const std::vector< double > &)> | agg_function (const std::string &signal_name) const override |
Returns a function appropriate for aggregating multiple values of the given signal into a single value. 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. 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 PlatformIO. More... | |
std::string | control_description (const std::string &control_name) const override |
Returns a description of the control. This string can be used by tools to generate help text for users of PlatformIO. More... | |
int | signal_behavior (const std::string &signal_name) const override |
Returns a hint about how a signal will change as a function of time. More... | |
void | save_control (const std::string &save_dir) override |
Save the state of all controls so that any subsequent changes made through PlatformIO can be undone with a call to the restore_control() method. Each IOGroup that supports controls will populate one file in the save directory that contains the saved state and name the file after the IOGroup name. More... | |
void | restore_control (const std::string &save_dir) override |
Restore all controls to values recorded in previous call to the save_control(save_dir) method. The directory provided contains the result of the previous saved state. More... | |
void | start_batch_server (int client_pid, const std::vector< geopm_request_s > &signal_config, const std::vector< geopm_request_s > &control_config, int &server_pid, std::string &server_key) override |
void | stop_batch_server (int server_pid) override |
int | num_signal_pushed (void) const |
int | num_control_pushed (void) const |
Public Member Functions inherited from geopm::PlatformIO | |
PlatformIO ()=default | |
virtual | ~PlatformIO ()=default |
Additional Inherited Members | |
Static Public Member Functions inherited from geopm::PlatformIO | |
static bool | is_valid_value (double value) |
geopm::PlatformIOImp::PlatformIOImp | ( | ) |
geopm::PlatformIOImp::PlatformIOImp | ( | std::list< std::shared_ptr< IOGroup > > | iogroup_list, |
const PlatformTopo & | topo | ||
) |
|
delete |
|
virtualdefault |
|
overridevirtual |
Adjust a single control that has been pushed on to the control stack. This control will not take effect until the next call to write_batch(void).
[in] | control_idx | Index of control to be adjusted returned by a previous call to the push_control() method. |
[in] | setting | Value of control parameter in SI units. |
Implements geopm::PlatformIO.
|
overridevirtual |
Returns a function appropriate for aggregating multiple values of the given signal into a single value.
[in] | signal_name | Name of the signal. |
Implements geopm::PlatformIO.
|
overridevirtual |
Returns a description of the control. This string can be used by tools to generate help text for users of PlatformIO.
Implements geopm::PlatformIO.
|
overridevirtual |
Query the domain for a named control.
[in] | control_name | The name of the control. |
Implements geopm::PlatformIO.
|
overridevirtual |
Returns the names of all available controls. This includes all controls and aliases provided by IOGroups as well as controls provided by PlatformIO itself.
Implements geopm::PlatformIO.
|
overridevirtual |
Returns a function that can be used to convert a signal of the given name into a printable string.
[in] | signal_name | Name of the signal. |
Implements geopm::PlatformIO.
int geopm::PlatformIOImp::num_control_pushed | ( | void | ) | const |
int geopm::PlatformIOImp::num_signal_pushed | ( | void | ) | const |
|
delete |
|
overridevirtual |
Push a control onto the end of the vector that can be adjusted.
[in] | control_name | Name of the control requested. |
[in] | domain_type | One of the values from the geopm_domain_e enum described in geopm_topo.h |
[in] | domain_idx | The index of the domain within the set of domains of the same type on the platform. |
Implements geopm::PlatformIO.
|
overridevirtual |
Push a signal onto the end of the vector that can be sampled.
[in] | signal_name | Name of the signal requested. |
[in] | domain_type | One of the values from the geopm_domain_e enum described in geopm_topo.h |
[in] | domain_idx | The index of the domain within the set of domains of the same type on the platform. |
Implements geopm::PlatformIO.
|
overridevirtual |
Read all pushed signals so that the next call to sample() will reflect the updated data.
Implements geopm::PlatformIO.
|
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().
[in] | signal_name | Name of the signal requested. |
[in] | domain_type | One of the values from the geopm_domain_e enum described in geopm_topo.h |
[in] | domain_idx | The index of the domain within the set of domains of the same type on the platform. |
Implements geopm::PlatformIO.
|
overridevirtual |
Registers an IOGroup with the PlatformIO so that its signals and controls are available through the PlatformIO interface.
This method provides the mechanism for extending the PlatformIO interface at runtime.
[in] | iogroup | Shared pointer to the IOGroup object. |
Implements geopm::PlatformIO.
|
overridevirtual |
Restore all controls to values recorded in previous call to the save_control(save_dir) method. The directory provided contains the result of the previous saved state.
[in] | save_dir | Directory populated with save files. |
Implements geopm::PlatformIO.
|
overridevirtual |
Restore all controls to values recorded in previous call to the save_control() method.
Implements geopm::PlatformIO.
|
overridevirtual |
Sample a single signal that has been pushed on to the signal stack. Must be called after a call to read_batch(void) method which updates the state of all signals.
[in] | signal_idx | index returned by a previous call to the push_signal() method. |
Implements geopm::PlatformIO.
|
overridevirtual |
Save the state of all controls so that any subsequent changes made through PlatformIO can be undone with a call to the restore_control() method. Each IOGroup that supports controls will populate one file in the save directory that contains the saved state and name the file after the IOGroup name.
[in] | save_dir | Directory to be populated with save files. |
Implements geopm::PlatformIO.
|
overridevirtual |
Save the state of all controls so that any subsequent changes made through PlatformIO can be undone with a call to the restore_control() method.
Implements geopm::PlatformIO.
|
overridevirtual |
Returns a hint about how a signal will change as a function of time.
This can be used when generating reports to decide how to summarize a signal's value for the entire application run.
[in] | signal_name | Name of the signal. |
Implements geopm::PlatformIO.
|
overridevirtual |
Returns a description of the signal. This string can be used by tools to generate help text for users of PlatformIO.
Implements geopm::PlatformIO.
|
overridevirtual |
Query the domain for a named signal.
[in] | signal_name | The name of the signal. |
Implements geopm::PlatformIO.
|
overridevirtual |
Returns the names of all available signals. This includes all signals and aliases provided by IOGroups as well as signals provided by PlatformIO itself.
Implements geopm::PlatformIO.
|
overridevirtual |
Implements geopm::PlatformIO.
|
overridevirtual |
Implements geopm::PlatformIO.
|
overridevirtual |
Write all of the pushed controls so that values previously given to adjust() are written to the platform.
Implements geopm::PlatformIO.
|
overridevirtual |
Interpret the setting and write setting to the platform. Does not modify the values stored by calling adjust().
[in] | control_name | Name of the control requested. |
[in] | domain_type | One of the values from the geopm_domain_e enum described in geopm_topo.h |
[in] | domain_idx | The index of the domain within the set of domains of the same type on the platform. |
[in] | setting | Value in SI units of the setting for the control. |
Implements geopm::PlatformIO.