![]() |
NEURON
|
Instrumentation infrastructure for benchmarking and profiling. More...
#include <profiler_interface.h>
Static Public Member Functions | |
static void | phase_begin (const char *name) |
Activate the collection of profiling data within a code region. More... | |
static void | phase_end (const char *name) |
Deactivate the collection of profiling data within a code region. More... | |
static void | start_profile () |
Globally activate the collection of profiling data. More... | |
static void | stop_profile () |
Globally deactivate the collection of profiling data. More... | |
static void | init_profile () |
Initialize the profiler. More... | |
static void | finalize_profile () |
Finalize the profiler. More... | |
Static Private Member Functions | |
static void | initialize_regions_from_env () |
Initialize regions to track from the NRN_PROFILE_REGIONS environment variable. More... | |
static bool | is_region_to_track (const char *name) |
Check if a given region name should be tracked. More... | |
Static Private Attributes | |
static std::unordered_set< std::string > | regions_to_measure |
Caliper regions that we want to measure. More... | |
Instrumentation infrastructure for benchmarking and profiling.
The Instrumentor class exposes static methods that can be used to toggle with fine-grained resolution the profiling of specific areas within the code.
Definition at line 50 of file profiler_interface.h.
|
inlinestatic |
Finalize the profiler.
Finalize a profiler's internal structure, without activating yet any data collection, similar in concept to MPI_Finalize. Loops through all enabled profilers and calls the relevant finalize_profile
function. This function should have a non-empty implementation only for profilers that require special finalization.
Definition at line 149 of file profiler_interface.h.
|
inlinestatic |
Initialize the profiler.
Initialize a profiler's internal structure, without activating yet any data collection, similar in concept to MPI_Init. Loops through all enabled profilers and calls the relevant init_profile
function. This function should have a non-empty implementation only for profilers that require special initialization, typically before any memory allocation is done.
Definition at line 134 of file profiler_interface.h.
|
inlinestaticprivate |
Initialize regions to track from the NRN_PROFILE_REGIONS environment variable.
Checks if the NRN_PROFILE_REGIONS
environment variable is set. If it is set, splits the value by "," and inserts each split string into the regions that should be measured during profiling.
Definition at line 164 of file profiler_interface.h.
|
inlinestaticprivate |
Check if a given region name should be tracked.
By default the regions_to_measure set is empty and we measure all functions instrumented via Caliper instrumentation. But one might want to profile only particular region or "phase" (e.g. due to profiling overhead) and in that case we check NRN_PROFILE_REGIONS
environment variable.
name | The name of the region to check. |
Definition at line 189 of file profiler_interface.h.
|
inlinestatic |
Activate the collection of profiling data within a code region.
This function semantically defines the beginning of a region of code that the user wishes to profile. Loops through all enabled profilers and calls the relevant phase_begin
function. This function should have a non-empty implementation only for profilers that allow multiple code regions with different names to be profiled concurrently.
name | the (unique) identifier of the code region to be profiled |
Definition at line 68 of file profiler_interface.h.
|
inlinestatic |
Deactivate the collection of profiling data within a code region.
This function semantically defines the end of a region of code that the user wishes to profile. Loops through all enabled profilers and calls the relevant phase_end
function. This function should have a non-empty implementation only for profilers that allow multiple code regions with different names to be profiled concurrently.
name | the (unique) identifier of the code region to be profiled |
Definition at line 87 of file profiler_interface.h.
|
inlinestatic |
Globally activate the collection of profiling data.
Activate the collection of profiler data without defining a region of interest with a given name, as opposed to phase_begin
. Loops through all enabled profilers and calls the relevant start_profile
function. This function should have a non-empty implementation only for profilers that expose simply a global begin/end interface, without named regions.
Definition at line 104 of file profiler_interface.h.
|
inlinestatic |
Globally deactivate the collection of profiling data.
Deactivate the collection of profiler data without defining a region of interest with a given name, as opposed to phase_end
. Loops through all enabled profilers and calls the relevant stop_profile
function. This function should have a non-empty implementation only for profilers that expose simply a global begin/end interface, without named regions.
Definition at line 119 of file profiler_interface.h.
|
inlinestaticprivate |
Caliper regions that we want to measure.
Each string in the set represents the name of a region of interest that we have already defined via Instrumentor::phase API.
Definition at line 202 of file profiler_interface.h.