12#ifndef SST_CORE_UTIL_BASIC_PERF_H
13#define SST_CORE_UTIL_BASIC_PERF_H
31 double begin_time = 0.0;
32 double end_time = 0.0;
33 uint64_t begin_mem = 0;
36 bool last_of_level =
true;
37 bool has_child =
false;
45 std::vector<double> rollup_duration;
48 int rollup_max_duration_rank = -1;
55 std::vector<uint64_t> rollup_begin_mem;
58 int rollup_begin_mem_max_rank = -1;
65 std::vector<uint64_t> rollup_end_mem;
68 int rollup_end_mem_max_rank = -1;
70 RegionPerfInfo(
const std::string& tag,
size_t level) :
103 void initialize(
int rank,
int num_ranks);
189 void addMetric(
const std::string& name, uint64_t value);
190 void addMetric(
const std::string& name, int64_t value);
191 void addMetric(
const std::string& name,
double value);
193 uint64_t getMetricUnsigned(
const std::string& name);
194 int64_t getMetricSigned(
const std::string& name);
195 double getMetricFloat(
const std::string& name);
197 void setReportRegionInfo(
Output& output,
size_t verbose);
198 void outputRegionData(
size_t verbose,
PerfReporter* reporter);
211 Output* output_ =
nullptr;
216 double start_time_ = 0.0;
221 std::vector<RegionPerfInfo> regions_;
226 std::stack<size_t> current_regions_;
233 RegionPerfInfo& getRegion(
const std::string& tag,
const std::string& function_name,
bool must_be_ended =
true);
237 std::map<std::string, uint64_t> scalars_unsigned;
238 std::map<std::string, int64_t> scalars_signed;
239 std::map<std::string, double> scalars_float;
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file.
Definition output.h:58
Class used to track various performance data during simulation execution.
Definition basicPerf.h:100
double getRegionDuration(const std::string &tag)
Get the local duration for the specified region.
Definition basicPerf.cc:204
uint64_t getLocalRegionBeginMemSize(const std::string &tag)
Get the local memory size at begin for the specified region.
Definition basicPerf.cc:221
double getRegionEndTime(const std::string &tag)
Get the local ending time for the specified region.
Definition basicPerf.cc:197
void beginRegion(const std::string &tag)
Begin a new code region.
Definition basicPerf.cc:66
uint64_t getGlobalTotalRegionEndMemSize(const std::string &tag)
Get the global total memory size at end for the specified region.
Definition basicPerf.cc:250
uint64_t getLocalRegionEndMemSize(const std::string &tag)
Get the local memory size at end for the specified region.
Definition basicPerf.cc:243
std::pair< uint64_t, int > getGlobalMaxRegionBeginMemSize(const std::string &tag)
Get the global max memory size at begin for the specified region.
Definition basicPerf.cc:235
std::pair< uint64_t, int > getGlobalMaxRegionEndMemSize(const std::string &tag)
Get the global max memory size at end for the specified region.
Definition basicPerf.cc:257
void endRegion(const std::string &tag)
End the named region.
Definition basicPerf.cc:118
double getRegionGlobalDuration(const std::string &tag)
Get the global duration for the specified region.
Definition basicPerf.cc:212
double getRegionBeginTime(const std::string &tag)
Get the local begin time for the specified region.
Definition basicPerf.cc:190
uint64_t getGlobalTotalRegionBeginMemSize(const std::string &tag)
Get the global total memory size at begin for the specified region.
Definition basicPerf.cc:228
Definition perfReporter.h:97
Definition basicPerf.h:30