6 #ifndef CONTROLLER_HPP_INCLUDE
7 #define CONTROLLER_HPP_INCLUDE
26 class EndpointPolicyTracer;
30 class ApplicationSampler;
46 const std::string &agent_name,
49 std::unique_ptr<TreeComm> tree_comm,
51 std::shared_ptr<ApplicationIO> application_io,
52 std::unique_ptr<Reporter> reporter,
53 std::unique_ptr<Tracer> tracer,
54 std::unique_ptr<EndpointPolicyTracer> policy_tracer,
55 std::shared_ptr<ProfileTracer> profile_tracer,
56 std::vector<std::unique_ptr<Agent> > level_agent,
57 std::vector<std::string> policy_names,
58 const std::string &policy_path,
60 std::unique_ptr<EndpointUser> endpoint,
61 const std::string &endpoint_path,
63 std::shared_ptr<InitControl> init_control,
64 bool do_init_control);
114 void pthread(
const pthread_attr_t *attr, pthread_t *thread);
129 std::set<std::string>
get_hostnames(
const std::string &hostname);
134 void create_agents(
void);
137 void init_agents(
void);
139 std::shared_ptr<Comm> m_comm;
140 PlatformIO &m_platform_io;
141 std::string m_agent_name;
142 const int m_num_send_down;
143 const int m_num_send_up;
144 std::unique_ptr<TreeComm> m_tree_comm;
145 const int m_num_level_ctl;
146 const int m_max_level;
147 const int m_root_level;
149 std::shared_ptr<ApplicationIO> m_application_io;
150 std::unique_ptr<Reporter> m_reporter;
151 std::unique_ptr<Tracer> m_tracer;
152 std::unique_ptr<EndpointPolicyTracer> m_policy_tracer;
153 std::shared_ptr<ProfileTracer> m_profile_tracer;
154 std::vector<std::unique_ptr<Agent> > m_agent;
155 const bool m_is_root;
156 std::vector<double> m_in_policy;
157 std::vector<double> m_last_policy;
158 std::vector<std::vector<std::vector<double> > > m_out_policy;
159 std::vector<std::vector<std::vector<double> > > m_in_sample;
160 std::vector<double> m_out_sample;
161 std::vector<double> m_trace_sample;
163 std::unique_ptr<EndpointUser> m_endpoint;
165 std::unique_ptr<FilePolicy> m_file_policy;
168 std::vector<std::string> m_agent_policy_names;
169 std::vector<std::string> m_agent_sample_names;
170 std::string m_shm_key;
172 std::shared_ptr<InitControl> m_init_control;
173 bool m_do_init_control;
Definition: ApplicationSampler.hpp:27
Definition: Controller.hpp:34
Controller()
Definition: Controller.cpp:175
Controller & operator=(const Controller &other)=delete
void abort(void)
Called upon failure to facilitate graceful destruction of the Controller and notify application.
Definition: Controller.cpp:536
void step(void)
Run a single step of the control algorithm.
Definition: Controller.cpp:425
Controller(const Controller &other)=delete
void generate(void)
Write the report file and finalize the trace.
Definition: Controller.cpp:406
std::set< std::string > get_hostnames(const std::string &hostname)
Return the names of hosts active in the current job. Must be called by all controllers in the tree or...
Definition: Controller.cpp:347
virtual ~Controller()
Definition: Controller.cpp:302
void run(void)
Run control algorithm.
Definition: Controller.cpp:370
void walk_up(void)
Read hardware telemetry and application data and send the combined data up the tree to the resource m...
Definition: Controller.cpp:481
void pthread(const pthread_attr_t *attr, pthread_t *thread)
Run control algorithm as a separate thread.
Definition: Controller.cpp:516
void setup_trace(void)
Configure the trace with custom columns from the Agent.
Definition: Controller.cpp:525
void walk_down(void)
Propagate policy information from the resource manager at the root of the tree down to the controller...
Definition: Controller.cpp:432
Definition: Accumulator.cpp:12