6 #ifndef PROFILEIOGROUP_HPP_INCLUDE
7 #define PROFILEIOGROUP_HPP_INCLUDE
14 #include "geopm/IOGroup.hpp"
18 class ApplicationSampler;
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 signal_idx)
override;
39 void adjust(
int control_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;
63 M_SIGNAL_THREAD_PROGRESS,
64 M_SIGNAL_TIME_HINT_UNSET,
65 M_SIGNAL_TIME_HINT_UNKNOWN,
66 M_SIGNAL_TIME_HINT_COMPUTE,
67 M_SIGNAL_TIME_HINT_MEMORY,
68 M_SIGNAL_TIME_HINT_NETWORK,
69 M_SIGNAL_TIME_HINT_IO,
70 M_SIGNAL_TIME_HINT_SERIAL,
71 M_SIGNAL_TIME_HINT_PARALLEL,
72 M_SIGNAL_TIME_HINT_IGNORE,
73 M_SIGNAL_TIME_HINT_SPIN,
76 struct m_signal_config {
85 int check_signal(
const std::string &signal_name,
int domain_type,
int domain_idx)
const;
89 static double hash_to_signal(uint64_t hash);
93 static double hint_to_signal(uint64_t hint);
98 static uint64_t signal_type_to_hint(
int signal_type);
100 ApplicationSampler &m_application_sampler;
102 std::map<std::string, int> m_signal_idx_map;
103 const PlatformTopo &m_platform_topo;
105 std::vector<bool> m_do_read;
106 bool m_is_batch_read;
107 std::vector<struct m_signal_config> m_active_signal;
108 std::array<std::vector<double>, M_NUM_SIGNAL> m_per_cpu_sample;
110 std::map<int, int> m_rid_idx;
Definition: ApplicationSampler.hpp:27
IOGroup that provides signals from the application.
Definition: ProfileIOGroup.hpp:23
std::string name(void) const override
Definition: ProfileIOGroup.cpp:469
void read_batch(void) override
Definition: ProfileIOGroup.cpp:144
ProfileIOGroup()
Definition: ProfileIOGroup.cpp:23
int control_domain_type(const std::string &control_name) const override
Definition: ProfileIOGroup.cpp:106
int push_signal(const std::string &signal_name, int domain_type, int domain_idx) override
Definition: ProfileIOGroup.cpp:111
std::set< std::string > control_names(void) const override
Definition: ProfileIOGroup.cpp:82
bool is_valid_control(const std::string &control_name) const override
Definition: ProfileIOGroup.cpp:92
int signal_behavior(const std::string &signal_name) const override
Definition: ProfileIOGroup.cpp:408
void write_batch(void) override
Definition: ProfileIOGroup.cpp:177
std::function< double(const std::vector< double > &)> agg_function(const std::string &signal_name) const override
Definition: ProfileIOGroup.cpp:321
double sample(int signal_idx) override
Definition: ProfileIOGroup.cpp:222
void save_control(void) override
Definition: ProfileIOGroup.cpp:311
void restore_control(void) override
Definition: ProfileIOGroup.cpp:316
std::function< std::string(double)> format_function(const std::string &signal_name) const override
Definition: ProfileIOGroup.cpp:359
int push_control(const std::string &control_name, int domain_type, int domain_idx) override
Definition: ProfileIOGroup.cpp:138
void connect(void)
Connect to the application via shared memory.
double read_signal(const std::string &signal_name, int domain_type, int domain_idx) override
Definition: ProfileIOGroup.cpp:250
virtual ~ProfileIOGroup()
Definition: ProfileIOGroup.cpp:68
void write_control(const std::string &control_name, int domain_type, int domain_idx, double setting) override
Definition: ProfileIOGroup.cpp:305
int signal_domain_type(const std::string &signal_name) const override
Definition: ProfileIOGroup.cpp:97
std::string control_description(const std::string &control_name) const override
Definition: ProfileIOGroup.cpp:403
void adjust(int control_idx, double setting) override
Definition: ProfileIOGroup.cpp:244
static std::unique_ptr< IOGroup > make_plugin(void)
Definition: ProfileIOGroup.cpp:479
std::string signal_description(const std::string &signal_name) const override
Definition: ProfileIOGroup.cpp:398
static std::string plugin_name(void)
Definition: ProfileIOGroup.cpp:474
std::set< std::string > signal_names(void) const override
Definition: ProfileIOGroup.cpp:73
bool is_valid_signal(const std::string &signal_name) const override
Definition: ProfileIOGroup.cpp:87
Definition: Accumulator.cpp:12