6 #ifndef DCGMIOGROUP_HPP_INCLUDE
7 #define DCGMIOGROUP_HPP_INCLUDE
34 int push_signal(
const std::string &signal_name,
int domain_type,
int domain_idx)
override;
35 int push_control(
const std::string &control_name,
int domain_type,
int domain_idx)
override;
38 double sample(
int batch_idx)
override;
39 void adjust(
int batch_idx,
double setting)
override;
40 double read_signal(
const std::string &signal_name,
int domain_type,
int domain_idx)
override;
41 void write_control(
const std::string &control_name,
int domain_type,
int domain_idx,
double setting)
override;
44 std::function<double(
const std::vector<double> &)>
agg_function(
const std::string &signal_name)
const override;
45 std::function<std::string(
double)>
format_function(
const std::string &signal_name)
const override;
49 void save_control(
const std::string &save_path)
override;
51 std::string
name(
void)
const override;
53 static std::unique_ptr<geopm::IOGroup>
make_plugin(
void);
55 void register_signal_alias(
const std::string &alias_name,
const std::string &signal_name);
56 void register_control_alias(
const std::string &alias_name,
const std::string &control_name);
75 std::string m_description;
76 std::vector<std::shared_ptr<signal_s> > m_signals;
77 std::function<double (
unsigned int)> m_devpool_func;
78 std::function<double(
const std::vector<double> &)> m_agg_function;
79 std::function<std::string(
double)> m_format_function;
83 std::string m_description;
84 std::vector<std::shared_ptr<control_s> > m_controls;
85 std::function<double(
const std::vector<double> &)> m_agg_function;
86 std::function<std::string(
double)> m_format_function;
89 std::map<std::string, signal_info> m_signal_available;
90 std::map<std::string, control_info> m_control_available;
91 std::vector<std::shared_ptr<signal_s> > m_signal_pushed;
92 std::vector<std::shared_ptr<control_s> > m_control_pushed;
Definition: DCGMDevicePool.hpp:17
IOGroup that provides signals and controls for DCGM GPUs.
Definition: DCGMIOGroup.hpp:23
int control_domain_type(const std::string &control_name) const override
Query the domain for a named control.
Definition: DCGMIOGroup.cpp:163
void adjust(int batch_idx, double setting) override
Adjust a setting for a particular control that was previously pushed with push_control()....
Definition: DCGMIOGroup.cpp:305
bool is_valid_control(const std::string &control_name) const override
Test if control_name refers to a control supported by the group.
Definition: DCGMIOGroup.cpp:151
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...
Definition: DCGMIOGroup.cpp:351
bool is_valid_signal(const std::string &signal_name) const override
Test if signal_name refers to a signal supported by the group.
Definition: DCGMIOGroup.cpp:145
std::string name(void) const override
Get the IOGroup name.
Definition: DCGMIOGroup.cpp:464
~DCGMIOGroup()
Definition: DCGMIOGroup.cpp:120
void restore_control(void) override
Restore all controls to values recorded in previous call to the save() method.
Definition: DCGMIOGroup.cpp:396
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.
Definition: DCGMIOGroup.cpp:413
void save_control(void) override
Save the state of all controls so that any subsequent changes made through the IOGroup can be undone ...
Definition: DCGMIOGroup.cpp:387
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().
Definition: DCGMIOGroup.cpp:169
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 user...
Definition: DCGMIOGroup.cpp:448
int push_control(const std::string &control_name, int domain_type, int domain_idx) override
Add a control to the list of controls that is written by write_batch() and configured with adjust().
Definition: DCGMIOGroup.cpp:213
DCGMIOGroup()
Definition: DCGMIOGroup.cpp:26
double sample(int batch_idx) override
Retrieve signal value from data read by last call to read_batch() for a particular signal previously ...
Definition: DCGMIOGroup.cpp:289
int signal_behavior(const std::string &signal_name) const override
Returns a hint about how a signal will change as a function of time.
Definition: DCGMIOGroup.cpp:459
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....
Definition: DCGMIOGroup.cpp:317
std::set< std::string > signal_names(void) const override
Returns the names of all signals provided by the IOGroup.
Definition: DCGMIOGroup.cpp:125
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....
Definition: DCGMIOGroup.cpp:425
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...
Definition: DCGMIOGroup.cpp:437
static std::unique_ptr< geopm::IOGroup > make_plugin(void)
Definition: DCGMIOGroup.cpp:476
void read_batch(void) override
Read all pushed signals from the platform so that the next call to sample() will reflect the updated ...
Definition: DCGMIOGroup.cpp:252
static std::string plugin_name(void)
Definition: DCGMIOGroup.cpp:470
int signal_domain_type(const std::string &signal_name) const override
Query the domain for a named signal.
Definition: DCGMIOGroup.cpp:157
std::set< std::string > control_names(void) const override
Returns the names of all controls provided by the IOGroup.
Definition: DCGMIOGroup.cpp:135
void write_batch(void) override
Write all of the pushed controls so that values previously given to adjust() are written to the platf...
Definition: DCGMIOGroup.cpp:276
Definition: IOGroup.hpp:21
const PlatformTopo & platform_topo(void)
Definition: PlatformTopo.cpp:81