18 #ifndef QMCPLUSPLUS_NEW_TIMER_H 19 #define QMCPLUSPLUS_NEW_TIMER_H 27 #ifdef USE_VTUNE_TASKS 28 #include <ittnotify.h> 32 #include <nvToolsExt.h> 35 #define USE_STACK_TIMERS 72 long int long_buckets[
N];
80 for (
int j = 0; j <
N; j++)
90 short_buckets[
level] = c1;
108 for (
int j = 0; j <
N; j++)
110 same &= this->long_buckets[j] == rhs.long_buckets[j];
117 for (
int j = 0; j <
N; j++)
119 if (!(this->long_buckets[j] == rhs.long_buckets[j]))
121 return this->long_buckets[j] < rhs.long_buckets[j];
124 return this->long_buckets[
N - 1] < rhs.long_buckets[
N - 1];
134 template<
class CLOCK>
154 #ifdef USE_STACK_TIMERS 164 #ifdef USE_VTUNE_TASKS 165 __itt_string_handle* task_name;
171 #ifdef USE_STACK_TIMERS 181 #ifdef USE_STACK_TIMERS 213 #ifdef USE_VTUNE_TASKS 214 task_name = __itt_string_handle_create(myname.c_str());
227 template<
class CLOCK1>
230 template<
class CLOCK1>
240 template<
class TIMER = NewTimer>
double get_total(const StackKey &key)
std::map< StackKey, double > per_stack_total_time
total time accumulated per stack key
long get_num_calls() const
timer_id_t get_id(int idx) const
helper functions for EinsplineSetBuilder
void set_active_by_timer_threshold(const timer_levels threshold)
TimerType(const std::string &myname, TimerManager< TimerType< CLOCK >> *mymanager, timer_levels mytimer=timer_level_fine)
timer_id_t timer_id
timer id in registered in the manager
long num_calls
total call counts
friend void set_total_time(TimerType< CLOCK1 > *timer, double total_time_input)
std::string get_name() const
Timer accumulates time and call counts.
StackKey & get_stack_key()
Manager creates timers and handle reports.
std::map< StackKey, double > & get_per_stack_total_time()
bool operator==(const StackKeyParam &rhs)
TimerManager< TimerType< CLOCK > > * manager
timer manager which allocated this timer object. nullptr if USE_STACK_TIMERS is not used...
CLOCK::time_point start_time
start time of the current measurement
void add_id(timer_id_t c1)
friend void set_num_calls(TimerType< CLOCK1 > *timer, long num_calls_input)
StackKey current_stack_key
stack key of the current measurement
long get_num_calls(const StackKey &key)
std::map< StackKey, long > per_stack_num_calls
total call counts per stack key
bool active
if false, timer start/stop becomes no-op.
void set_id(timer_id_t id)
void put_id(timer_id_t c1)
bool timer_max_level_exceeded
double total_time
total time accumulated of all the calls
timer_id_t get_id() const
void set_active(const bool &is_active)
bool operator<(const StackKeyParam &rhs) const
std::string name
name of this timer
static const int max_level
timer_levels timer_level
timer level
void set_name(const std::string &myname)