ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
profiler.hpp File Reference

Lightweight named-region execution profiling. More...

#include <string>
+ Include dependency graph for profiler.hpp:

Namespaces

namespace  orb5x
 Public C++ interface of the ORB5X gyrokinetic application.
 
namespace  orb5x::profiler
 Profiling facilities implemented by the profiler module.
 

Macros

#define profiler_begin_region(region_name)    profiler_begin_region_impl((region_name), __FILE__, __LINE__)
 Begin a named profiling region and capture its source location.
 
#define profiler_begin_region_species(isp)    profiler_begin_region_species_impl((isp), __FILE__, __LINE__)
 Begin a species profiling region and capture its source location.
 

Functions

void orb5x::profiler::profiler_add_region_time (const std::string &region_name, double seconds, long long calls=1)
 Add an externally measured sample to window and cumulative totals.
 
void orb5x::profiler::profiler_begin_region_impl (const char *region_name, const char *file, int line)
 Begin profiling for a specific region.
 
void orb5x::profiler::profiler_begin_region_species_impl (int isp, const char *file, int line)
 Open a subregion for a specific species.
 
void orb5x::profiler::profiler_end_region (const char *region_name)
 End profiling for a specific region.
 
void orb5x::profiler::profiler_end_region_species (int isp)
 Close a subregion for a specific species.
 
void orb5x::profiler::profiler_off ()
 Deactivate the profiling.
 
void orb5x::profiler::profiler_on ()
 Activate the profiling (ON by default)
 
void orb5x::profiler::profiler_print_summary (const std::string &label)
 Print current-window regions in descending elapsed-time order.
 
void orb5x::profiler::profiler_reset_summary ()
 Reset wall-clock totals for the current reporting window.
 
void orb5x::profiler::profiler_write_summary_file (const std::string &label)
 Write the top cumulative regions to a per-rank text file.
 

Detailed Description

Lightweight named-region execution profiling.

Records process-local wall-clock totals and call counts; regions must be balanced.

Macro Definition Documentation

◆ profiler_begin_region

#define profiler_begin_region (   region_name)     profiler_begin_region_impl((region_name), __FILE__, __LINE__)

Begin a named profiling region and capture its source location.

Parameters
[in]region_nameNull-terminated region name.

◆ profiler_begin_region_species

#define profiler_begin_region_species (   isp)     profiler_begin_region_species_impl((isp), __FILE__, __LINE__)

Begin a species profiling region and capture its source location.

Parameters
[in]ispSpecies number used in the generated region name.