18 #ifndef QMCPLUSPLUS_TIMER_MANAGER_H 19 #define QMCPLUSPLUS_TIMER_MANAGER_H 26 #include <type_traits> 31 #ifdef USE_VTUNE_TASKS 32 #include <ittnotify.h> 72 #ifdef USE_VTUNE_TASKS 73 __itt_domain* task_domain;
78 #ifdef USE_VTUNE_TASKS 79 task_domain = __itt_domain_create(
"QMCPACK");
92 TIMER* current =
nullptr;
158 template<
class TIMER>
159 class TimerList :
public std::vector<std::reference_wrapper<TIMER>>
167 this->reserve(timer_list.size());
168 for (std::size_t i = 0; i < timer_list.size(); i++)
170 if (i !=
static_cast<std::underlying_type_t<T>
>(timer_list[i].
id))
171 throw std::runtime_error(
"Mismatch between index and enumeration");
172 this->push_back(*manager.createTimer(timer_list[i].name, timer_level));
class that handles xmlDoc
helper functions for EinsplineSetBuilder
void output_timing(Communicate *comm, Libxml2Document &doc, xmlNodePtr root)
std::vector< TimerIDName_t< T > > TimerNameList_t
std::map< timer_id_t, std::string > timer_id_name
timer id to name mapping
void collate_stack_profile(Communicate *comm, StackProfileData &p)
timer_levels timer_threshold
The threshold for active timers.
void print_flat(Communicate *comm)
void initializeTimer(TIMER &t)
bool max_timers_exceeded
status of maxmal timer id reached
Timer accumulates time and call counts.
std::vector< std::string > names_t
Manager creates timers and handle reports.
void push_timer(TIMER *t)
void print(Communicate *comm)
Wrapping information on parallelism.
std::vector< std::unique_ptr< TIMER > > timer_storage_
All the timers created by this manager.
std::vector< TIMER * > CurrentTimerStack
The stack of nested active timers.
TimerList(TimerManager< TIMER > &manager, const TimerNameList_t< T > &timer_list, timer_levels timer_level=timer_level_fine)
NewTimer & createGlobalTimer(const std::string &myname, timer_levels mylevel)
void collate_flat_profile(Communicate *comm, FlatProfileData &p)
std::map< std::string, int > nameList_t
TIMER * createTimer(const std::string &myname, timer_levels mytimer=timer_level_fine)
Create a new timer object registred in this manager. This call is thread-safe.
std::mutex timer_list_lock_
mutex for TimerList
bool maximum_number_of_timers_exceeded() const
void get_stack_name_from_id(const StackKey &key, std::string &name)
void set_timer_threshold(const timer_levels threshold)
TimerManager< NewTimer > & getGlobalTimerManager()
void print_stack(Communicate *comm)
std::string get_timer_threshold_string() const
std::vector< long > callList_t
NewTimer class various high-resolution timers.
timer_id_t max_timer_id
The current maximal timer id.
std::map< std::string, timer_id_t > timer_name_to_id
name to timer id mapping
std::vector< double > timeList_t