Value:
__LINE__) = \
NULL; \
do \
{ \
static bool timer_is_setup = false; \
if (!timer_is_setup) \
{ \
SAMRAI_CONCATENATE_TOKENS(samrai_timer_, __LINE__) =
\
timer_is_setup = true; \
} \
} while (false)
#define SAMRAI_CONCATENATE_TOKENS(x, y)
Definition: TimerManager.h:575
static TimerManager * getManager()
virtual Pointer< Timer > getTimer(const std::string &name, bool ignore_timer_input=false)
Macro for setting up a timer. Defines a static pointer with name 'cardinal_timer_X' in the current scope, in which 'X' is the current line number. The arguments are the variable name of the timer (e.g., t_interpolate_velocity) and a string for identifying the timer in the output (e.g., "cardinal::fsi::IFEDMethod::interpolateVelocity()").
SAMRAI's TimerManager class stores the timers in an array: i.e., in order to find a timer, it must perform possibly hundreds of string comparisons. This is a performance problem for short functions which we still want to time. Hence, this macro sets up the timer as a static pointer and only defines it once. It does nothing if SAMRAI is not initialized.