38 const PlatformTopo &topo,
39 std::shared_ptr<Waiter> waiter,
40 std::shared_ptr<PowerGovernor> power_gov,
41 std::shared_ptr<FrequencyGovernor> frequency_gov,
42 std::shared_ptr<SSTClosGovernor> sst_gov,
43 std::vector<std::shared_ptr<FrequencyTimeBalancer> > package_balancers,
44 std::shared_ptr<FrequencyLimitDetector> frequency_limit_detector);
46 void init(
int level,
const std::vector<int> &fan_in,
47 bool is_level_root)
override;
50 std::vector<std::vector<double> > &out_policy)
override;
53 std::vector<double> &out_sample)
override;
58 void wait(
void)
override;
59 std::vector<std::pair<std::string, std::string> >
report_header(
void)
const override;
60 std::vector<std::pair<std::string, std::string> >
report_host(
void)
const override;
61 std::map<uint64_t, std::vector<std::pair<std::string, std::string> > >
63 std::vector<std::string>
trace_names(
void)
const override;
64 std::vector<std::function<std::string(
double)> >
trace_formats(
void)
const override;
66 void enforce_policy(
const std::vector<double> &policy)
const override;
74 void update_policy(
const std::vector<double> &policy);
75 void init_platform_io(
void);
78 void initialize_policies(
const std::vector<double> &in_policy);
81 M_POLICY_POWER_PACKAGE_LIMIT_TOTAL,
82 M_POLICY_USE_FREQUENCY_LIMITS,
87 static constexpr double M_WAIT_SEC = 0.005;
88 PlatformIO &m_platform_io;
89 const PlatformTopo &m_platform_topo;
90 std::shared_ptr<Waiter> m_waiter;
91 geopm_time_s m_update_time;
92 int m_epoch_signal_idx;
93 std::vector<int> m_acnt_signal_idx;
94 std::vector<int> m_mcnt_signal_idx;
95 std::vector<int> m_hash_signal_idx;
96 std::vector<int> m_hint_signal_idx;
97 std::vector<int> m_time_hint_network_idx;
98 std::vector<double> m_last_ctl_frequency;
99 std::vector<double> m_last_ctl_clos;
100 std::vector<double> m_last_epoch_acnt;
101 std::vector<double> m_last_epoch_mcnt;
102 std::vector<double> m_last_sample_acnt;
103 std::vector<double> m_last_sample_mcnt;
104 std::vector<double> m_last_hash;
105 std::vector<std::vector<double> > m_last_epoch_frequency;
106 std::vector<double> m_current_epoch_max_frequency;
107 std::vector<double> m_last_epoch_max_frequency;
108 std::vector<std::vector<double> > m_last_epoch_network_time;
109 std::vector<std::vector<double> > m_last_epoch_non_network_time_diff;
110 std::unordered_map<double, double> m_region_max_observed_frequency;
111 double m_last_epoch_time;
112 double m_last_epoch_count;
114 bool m_is_policy_updated;
115 bool m_do_write_batch;
116 bool m_is_adjust_initialized;
117 bool m_is_real_policy;
120 std::vector<std::vector<size_t> > m_package_core_indices;
121 double m_policy_power_package_limit_total;
122 bool m_policy_use_frequency_limits;
124 double m_min_power_setting;
125 double m_max_power_setting;
126 double m_tdp_power_setting;
127 double m_frequency_min;
128 double m_frequency_sticker;
129 double m_frequency_max;
130 double m_frequency_step;
131 std::shared_ptr<PowerGovernor> m_power_gov;
132 std::shared_ptr<FrequencyGovernor> m_freq_governor;
133 std::shared_ptr<SSTClosGovernor> m_sst_clos_governor;
134 int m_frequency_ctl_domain_type;
135 int m_frequency_control_domain_count;
136 std::vector<long long> m_network_hint_sample_length;
137 std::vector<long long> m_non_network_hint_sample_length;
138 std::vector<size_t> m_last_hp_count;
139 bool m_handle_new_epoch;
140 int m_epoch_wait_count;
142 std::vector<std::shared_ptr<FrequencyTimeBalancer> > m_package_balancers;
143 std::shared_ptr<FrequencyLimitDetector> m_frequency_limit_detector;