6 #ifndef REPORTER_HPP_INCLUDE
7 #define REPORTER_HPP_INCLUDE
39 virtual void init(
void) = 0;
65 virtual void generate(
const std::string &agent_name,
66 const std::vector<std::pair<std::string, std::string> > &agent_report_header,
67 const std::vector<std::pair<std::string, std::string> > &agent_host_report,
68 const std::map<uint64_t, std::vector<std::pair<std::string, std::string> > > &agent_region_report,
70 std::shared_ptr<Comm> comm,
72 virtual std::string
generate(
const std::string &profile_name,
73 const std::string &agent_name,
74 const std::vector<std::pair<std::string, std::string> > &agent_report_header,
75 const std::vector<std::pair<std::string, std::string> > &agent_host_report,
76 const std::map<uint64_t, std::vector<std::pair<std::string, std::string> > > &agent_region_report) = 0;
78 virtual void overhead(
double overhead_sec,
double sample_delay) = 0;
90 PlatformIO &platform_io,
91 const PlatformTopo &platform_topo,
94 PlatformIO &platform_io,
95 const PlatformTopo &platform_topo,
97 std::shared_ptr<SampleAggregator> sample_agg,
98 std::shared_ptr<ProcessRegionAggregator> proc_agg,
99 const std::string &report_name,
100 const std::vector<std::pair<std::string, int> > &env_signal,
101 const std::string &policy_path,
103 const std::string &profile_name,
106 void init(
void)
override;
107 void update(
void)
override;
108 void generate(
const std::string &agent_name,
109 const std::vector<std::pair<std::string, std::string> > &agent_report_header,
110 const std::vector<std::pair<std::string, std::string> > &agent_host_report,
111 const std::map<uint64_t, std::vector<std::pair<std::string, std::string> > > &agent_region_report,
113 std::shared_ptr<Comm> comm,
114 const TreeComm &tree_comm)
override;
115 std::string
generate(
const std::string &profile_name,
116 const std::string &agent_name,
117 const std::vector<std::pair<std::string, std::string> > &agent_report_header,
118 const std::vector<std::pair<std::string, std::string> > &agent_host_report,
119 const std::map<uint64_t, std::vector<std::pair<std::string, std::string> > > &agent_region_report)
override;
121 void overhead(
double overhead_sec,
double sample_delay)
override;
125 static constexpr
int M_SPACES_INDENT = 2;
127 static constexpr
int M_INDENT_HEADER = 0;
128 static constexpr
int M_INDENT_HOST = 0;
129 static constexpr
int M_INDENT_HOST_NAME = M_INDENT_HOST + 1;
130 static constexpr
int M_INDENT_HOST_AGENT = M_INDENT_HOST_NAME + 1;
131 static constexpr
int M_INDENT_REGION = M_INDENT_HOST_NAME + 1;
132 static constexpr
int M_INDENT_REGION_FIELD = M_INDENT_REGION + 1;
133 static constexpr
int M_INDENT_UNMARKED = M_INDENT_HOST_NAME + 1;
134 static constexpr
int M_INDENT_UNMARKED_FIELD = M_INDENT_UNMARKED + 1;
135 static constexpr
int M_INDENT_EPOCH = M_INDENT_HOST_NAME + 1;
136 static constexpr
int M_INDENT_EPOCH_FIELD = M_INDENT_EPOCH + 1;
137 static constexpr
int M_INDENT_TOTALS = M_INDENT_HOST_NAME + 1;
138 static constexpr
int M_INDENT_TOTALS_FIELD = M_INDENT_TOTALS + 1;
141 void init_sync_fields(
void);
143 void init_environment_signals(
void);
148 std::vector<std::pair<std::string, double> > get_region_data(uint64_t region_hash);
151 double get_max_memory(
void);
152 static void yaml_write(std::ostream &os,
int indent_level,
153 const std::string &val);
154 static void yaml_write(std::ostream &os,
int indent_level,
155 const std::vector<std::pair<std::string, std::string> > &data);
156 static void yaml_write(std::ostream &os,
int indent_level,
157 const std::vector<std::pair<std::string, double> > &data);
159 std::string create_header(
const std::string &agent_name,
160 const std::string &profile_name,
161 const std::vector<std::pair<std::string, std::string> > &agent_report_header);
162 std::string create_report(
const std::set<std::string> ®ion_name_set,
double max_memory,
double comm_overhead,
163 const std::vector<std::pair<std::string, std::string> > &agent_host_report,
164 const std::map<uint64_t, std::vector<std::pair<std::string, std::string> > > &agent_region_report);
165 std::string gather_report(
const std::string &host_report, std::shared_ptr<Comm> comm);
167 std::string m_start_time;
168 std::string m_report_name;
169 PlatformIO &m_platform_io;
170 const PlatformTopo &m_platform_topo;
171 std::shared_ptr<SampleAggregator> m_sample_agg;
172 std::shared_ptr<ProcessRegionAggregator> m_proc_region_agg;
173 const std::vector<std::pair<std::string, int> > m_env_signals;
174 const std::string m_policy_path;
177 double m_sticker_freq;
178 int m_epoch_count_idx;
181 std::map<std::string, int> m_sync_signal_idx;
185 struct m_sync_field_s
187 std::string field_label;
188 std::vector<std::string> supporting_signals;
189 std::function<double(uint64_t,
const std::vector<std::string>&)> func;
192 std::vector<m_sync_field_s> m_sync_fields;
195 std::vector<std::pair<std::string, int> > m_env_signal_name_idx;
198 double m_overhead_time;
199 double m_sample_delay;
200 const std::string m_profile_name;
Definition: ApplicationIO.hpp:27
Class responsible for reading records from the ApplicationSampler and calculating the per-process run...
Definition: ProcessRegionAggregator.hpp:20
A class used by the Controller to format the report at the end of a run. Most of the information for ...
Definition: Reporter.hpp:32
virtual void update(void)=0
Read values from PlatformIO to update aggregated samples.
virtual ~Reporter()=default
virtual void init(void)=0
Handle any initialization that must take place after the Controller has connected to the application.
virtual void total_time(double total)=0
virtual void generate(const std::string &agent_name, const std::vector< std::pair< std::string, std::string > > &agent_report_header, const std::vector< std::pair< std::string, std::string > > &agent_host_report, const std::map< uint64_t, std::vector< std::pair< std::string, std::string > > > &agent_region_report, const ApplicationIO &application_io, std::shared_ptr< Comm > comm, const TreeComm &tree_comm)=0
Create a report for this node. If the node is the root controller, format the header,...
virtual void overhead(double overhead_sec, double sample_delay)=0
virtual std::string generate(const std::string &profile_name, const std::string &agent_name, const std::vector< std::pair< std::string, std::string > > &agent_report_header, const std::vector< std::pair< std::string, std::string > > &agent_host_report, const std::map< uint64_t, std::vector< std::pair< std::string, std::string > > > &agent_region_report)=0
Definition: Reporter.hpp:87
void total_time(double total) override
Definition: Reporter.cpp:140
void update(void) override
Read values from PlatformIO to update aggregated samples.
Definition: Reporter.cpp:132
ReporterImp(const std::string &start_time, PlatformIO &platform_io, const PlatformTopo &platform_topo, int rank)
Definition: Reporter.cpp:40
void init(void) override
Handle any initialization that must take place after the Controller has connected to the application.
Definition: Reporter.cpp:117
void generate(const std::string &agent_name, const std::vector< std::pair< std::string, std::string > > &agent_report_header, const std::vector< std::pair< std::string, std::string > > &agent_host_report, const std::map< uint64_t, std::vector< std::pair< std::string, std::string > > > &agent_region_report, const ApplicationIO &application_io, std::shared_ptr< Comm > comm, const TreeComm &tree_comm) override
Create a report for this node. If the node is the root controller, format the header,...
Definition: Reporter.cpp:151
void overhead(double overhead_sec, double sample_delay) override
Definition: Reporter.cpp:145
virtual ~ReporterImp()=default
Definition: SampleAggregator.hpp:19
Definition: TreeComm.hpp:19
Definition: Accumulator.cpp:12