geopm
3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
|
Class which is a collection of all valid control and signal objects for a platform. More...
#include <PlatformIO.hpp>
Public Member Functions | |
PlatformIO ()=default | |
virtual | ~PlatformIO ()=default |
virtual void | register_iogroup (std::shared_ptr< IOGroup > iogroup)=0 |
Registers an IOGroup with the PlatformIO so that its signals and controls are available through the PlatformIO interface. More... | |
virtual std::set< std::string > | signal_names (void) const =0 |
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... | |
virtual std::set< std::string > | control_names (void) const =0 |
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... | |
virtual int | signal_domain_type (const std::string &signal_name) const =0 |
Query the domain for a named signal. More... | |
virtual int | control_domain_type (const std::string &control_name) const =0 |
Query the domain for a named control. More... | |
virtual int | push_signal (const std::string &signal_name, int domain_type, int domain_idx)=0 |
Push a signal onto the end of the vector that can be sampled. More... | |
virtual int | push_control (const std::string &control_name, int domain_type, int domain_idx)=0 |
Push a control onto the end of the vector that can be adjusted. More... | |
virtual double | sample (int signal_idx)=0 |
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... | |
virtual void | adjust (int control_idx, double setting)=0 |
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... | |
virtual void | read_batch (void)=0 |
Read all pushed signals so that the next call to sample() will reflect the updated data. More... | |
virtual void | write_batch (void)=0 |
Write all of the pushed controls so that values previously given to adjust() are written to the platform. More... | |
virtual double | read_signal (const std::string &signal_name, int domain_type, int domain_idx)=0 |
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... | |
virtual void | write_control (const std::string &control_name, int domain_type, int domain_idx, double setting)=0 |
Interpret the setting and write setting to the platform. Does not modify the values stored by calling adjust(). More... | |
virtual void | save_control (void)=0 |
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... | |
virtual void | restore_control (void)=0 |
Restore all controls to values recorded in previous call to the save_control() method. More... | |
virtual std::function< double(const std::vector< double > &)> | agg_function (const std::string &signal_name) const =0 |
Returns a function appropriate for aggregating multiple values of the given signal into a single value. More... | |
virtual std::function< std::string(double)> | format_function (const std::string &signal_name) const =0 |
Returns a function that can be used to convert a signal of the given name into a printable string. More... | |
virtual std::string | signal_description (const std::string &signal_name) const =0 |
Returns a description of the signal. This string can be used by tools to generate help text for users of PlatformIO. More... | |
virtual std::string | control_description (const std::string &control_name) const =0 |
Returns a description of the control. This string can be used by tools to generate help text for users of PlatformIO. More... | |
virtual int | signal_behavior (const std::string &signal_name) const =0 |
Returns a hint about how a signal will change as a function of time. More... | |
virtual void | save_control (const std::string &save_dir)=0 |
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... | |
virtual void | restore_control (const std::string &save_dir)=0 |
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... | |
virtual 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)=0 |
virtual void | stop_batch_server (int server_pid)=0 |
Static Public Member Functions | |
static bool | is_valid_value (double value) |
Class which is a collection of all valid control and signal objects for a platform.
|
default |
|
virtualdefault |
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Returns a function appropriate for aggregating multiple values of the given signal into a single value.
[in] | signal_name | Name of the signal. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Returns a description of the control. This string can be used by tools to generate help text for users of PlatformIO.
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Query the domain for a named control.
[in] | control_name | The name of the control. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Returns the names of all available controls. This includes all controls and aliases provided by IOGroups as well as controls provided by PlatformIO itself.
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
static |
[in] | value | Check if the given parameter is a valid value. |
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Read all pushed signals so that the next call to sample() will reflect the updated data.
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Restore all controls to values recorded in previous call to the save_control() method.
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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.
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Returns a description of the signal. This string can be used by tools to generate help text for users of PlatformIO.
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Query the domain for a named signal.
[in] | signal_name | The name of the signal. |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Returns the names of all available signals. This includes all signals and aliases provided by IOGroups as well as signals provided by PlatformIO itself.
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Implemented in geopm::PlatformIOImp.
|
pure virtual |
Write all of the pushed controls so that values previously given to adjust() are written to the platform.
Implemented in geopm::PlatformIOImp.
|
pure virtual |
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. |
Implemented in geopm::PlatformIOImp.