12 #ifndef SST_CORE_UTIL_BASIC_PERF_H 13 #define SST_CORE_UTIL_BASIC_PERF_H 30 double begin_time = 0.0;
31 double end_time = 0.0;
32 uint64_t begin_mem = 0;
35 bool last_of_level =
true;
36 bool has_child =
false;
44 std::vector<double> rollup_duration;
47 int rollup_max_duration_rank = -1;
54 std::vector<uint64_t> rollup_begin_mem;
57 int rollup_begin_mem_max_rank = -1;
64 std::vector<uint64_t> rollup_end_mem;
67 int rollup_end_mem_max_rank = -1;
102 void initialize(
int rank,
int num_ranks);
188 void addMetric(
const std::string& name, uint64_t value);
189 void addMetric(
const std::string& name, int64_t value);
190 void addMetric(
const std::string& name,
double value);
192 uint64_t getMetricUnsigned(
const std::string& name);
193 int64_t getMetricSigned(
const std::string& name);
194 double getMetricFloat(
const std::string& name);
196 void outputRegionData(
Output& out,
size_t verbose);
203 std::vector<RegionPerfInfo> regions_;
208 std::stack<size_t> current_regions_;
215 RegionPerfInfo& getRegion(
const std::string& tag,
const std::string& function_name,
bool must_be_ended =
true);
219 std::map<std::string, uint64_t> scalars_unsigned;
220 std::map<std::string, int64_t> scalars_signed;
221 std::map<std::string, double> scalars_float;
233 #endif // SST_CORE_UTIL_BASIC_PERF_H uint64_t getGlobalTotalRegionBeginMemSize(const std::string &tag)
Get the global total memory size at begin for the specified region.
Definition: basicPerf.cc:220
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:57
double getRegionBeginTime(const std::string &tag)
Get the local begin time for the specified region.
Definition: basicPerf.cc:182
double getRegionGlobalDuration(const std::string &tag)
Get the global duration for the specified region.
Definition: basicPerf.cc:204
double getRegionDuration(const std::string &tag)
Get the local duration for the specified region.
Definition: basicPerf.cc:196
uint64_t getGlobalTotalRegionEndMemSize(const std::string &tag)
Get the global total memory size at end for the specified region.
Definition: basicPerf.cc:242
Definition: basicPerf.h:28
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:227
uint64_t getLocalRegionBeginMemSize(const std::string &tag)
Get the local memory size at begin for the specified region.
Definition: basicPerf.cc:213
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:249
double getRegionEndTime(const std::string &tag)
Get the local ending time for the specified region.
Definition: basicPerf.cc:189
void beginRegion(const std::string &tag)
Begin a new code region.
Definition: basicPerf.cc:64
void endRegion(const std::string &tag)
End the named region.
Definition: basicPerf.cc:110
uint64_t getLocalRegionEndMemSize(const std::string &tag)
Get the local memory size at end for the specified region.
Definition: basicPerf.cc:235
Class used to track various performance data during simulation execution.
Definition: basicPerf.h:98