6 #ifndef CPUACTIVITYAGENT_HPP_INCLUDE
7 #define CPUACTIVITYAGENT_HPP_INCLUDE
17 class FrequencyGovernor;
26 const PlatformTopo &topo,
27 std::shared_ptr<FrequencyGovernor> gov,
28 std::shared_ptr<Waiter> waiter);
30 void init(
int level,
const std::vector<int> &fan_in,
bool is_level_root)
override;
33 std::vector<std::vector<double> > &out_policy)
override;
36 std::vector<double> &out_sample)
override;
41 void wait(
void)
override;
42 std::vector<std::pair<std::string, std::string> >
report_header(
void)
const override;
43 std::vector<std::pair<std::string, std::string> >
report_host(
void)
const override;
44 std::map<uint64_t, std::vector<std::pair<std::string, std::string> > >
report_region(
void)
const override;
45 std::vector<std::string>
trace_names(
void)
const override;
47 void enforce_policy(
const std::vector<double> &policy)
const override;
48 std::vector<std::function<std::string(
double)> >
trace_formats(
void)
const override;
55 PlatformIO &m_platform_io;
56 const PlatformTopo &m_platform_topo;
57 static constexpr
double M_WAIT_SEC = 0.010;
58 const double M_POLICY_PHI_DEFAULT;
59 const int M_NUM_PACKAGE;
60 bool m_do_write_batch;
61 bool m_do_send_policy;
62 std::shared_ptr<FrequencyGovernor> m_freq_governor;
63 int m_freq_ctl_domain_type;
64 int m_num_freq_ctl_domain;
65 double m_core_batch_writes;
66 double m_uncore_frequency_requests;
67 double m_uncore_frequency_clamped;
68 double m_resolved_f_uncore_efficient;
69 double m_resolved_f_uncore_max;
70 double m_resolved_f_core_efficient;
71 double m_resolved_f_core_max;
72 double m_freq_uncore_min;
73 double m_freq_uncore_max;
74 double m_freq_uncore_efficient;
75 double m_freq_core_min;
76 double m_freq_core_max;
77 double m_freq_core_efficient;
102 std::map<std::string, double> m_policy_available;
105 std::map<double, double> m_qm_max_rate;
107 std::vector<signal> m_core_scal;
108 std::vector<control> m_core_freq_control;
110 std::vector<signal> m_qm_rate;
111 std::vector<signal> m_uncore_freq_status;
112 std::vector<control> m_uncore_freq_min_control;
113 std::vector<control> m_uncore_freq_max_control;
114 std::shared_ptr<Waiter> m_waiter;
116 void init_platform_io(
void);
117 void init_constconfig_io(
void);
Agent.
Definition: CPUActivityAgent.hpp:22
bool do_write_batch(void) const override
Called by the Controller to decide whether to call write_batch() to update platform controls.
Definition: CPUActivityAgent.cpp:411
bool do_send_policy(void) const override
Called by Controller to determine if new policy values should be sent down the tree to the Agent's ch...
Definition: CPUActivityAgent.cpp:246
std::vector< std::pair< std::string, std::string > > report_host(void) const override
Custom fields for the host section of the report.
Definition: CPUActivityAgent.cpp:453
std::vector< std::pair< std::string, std::string > > report_header(void) const override
Custom fields that will be added to the report header when this agent is used.
Definition: CPUActivityAgent.cpp:447
std::vector< std::string > trace_names(void) const override
Column headers to be added to the trace.
Definition: CPUActivityAgent.cpp:487
void wait(void) override
Called by Controller to wait for sample period to elapse. This controls the cadence of the Controller...
Definition: CPUActivityAgent.cpp:441
static std::vector< std::string > policy_names(void)
Definition: CPUActivityAgent.cpp:520
void validate_policy(std::vector< double > &in_policy) const override
Called by Controller to validate incoming policy values and configure defaults requested in incoming ...
Definition: CPUActivityAgent.cpp:213
bool do_send_sample(void) const override
Definition: CPUActivityAgent.cpp:258
void init(int level, const std::vector< int > &fan_in, bool is_level_root) override
Set the level where this Agent is active and push signals/controls for that level.
Definition: CPUActivityAgent.cpp:69
std::map< uint64_t, std::vector< std::pair< std::string, std::string > > > report_region(void) const override
Custom fields for each region in the report.
Definition: CPUActivityAgent.cpp:481
void enforce_policy(const std::vector< double > &policy) const override
Enforce the policy one time with PlatformIO::write_control(). Called to enforce static policies in th...
Definition: CPUActivityAgent.cpp:497
void sample_platform(std::vector< double > &out_sample) override
Read signals from the platform and interpret/aggregate these signals to create a sample which can be ...
Definition: CPUActivityAgent.cpp:417
void aggregate_sample(const std::vector< std::vector< double > > &in_sample, std::vector< double > &out_sample) override
Aggregate samples from children for the next level up the tree.
Definition: CPUActivityAgent.cpp:251
static std::vector< std::string > sample_names(void)
Definition: CPUActivityAgent.cpp:527
static std::string plugin_name(void)
Definition: CPUActivityAgent.cpp:508
CPUActivityAgent()
Definition: CPUActivityAgent.cpp:30
static std::unique_ptr< Agent > make_plugin(void)
Definition: CPUActivityAgent.cpp:514
void split_policy(const std::vector< double > &in_policy, std::vector< std::vector< double > > &out_policy) override
Called by Controller to split policy for children at next level down the tree.
Definition: CPUActivityAgent.cpp:237
std::vector< std::function< std::string(double)> > trace_formats(void) const override
Returns format string for each column added to the trace.
Definition: CPUActivityAgent.cpp:502
void trace_values(std::vector< double > &values) override
Called by Controller to get latest values to be added to the trace.
Definition: CPUActivityAgent.cpp:493
virtual ~CPUActivityAgent()=default
void adjust_platform(const std::vector< double > &in_policy) override
Adjust the platform settings based the policy from above.
Definition: CPUActivityAgent.cpp:263
Definition: Accumulator.cpp:12