walberla::timing::TimingTree< TP > Class Template Reference

#include <TimingTree.h>

Public Member Functions

 TimingTree ()
 Creates and initialises the timing structure. More...
 
 TimingTree (const TimingTree &tt)
 
TimingTree< TP > & operator= (const TimingTree< TP > &tt)
 
void swap (TimingTree< TP > &tt)
 
void start (const std::string &name)
 Starts a timer beneath the current hierarchy level. More...
 
void stop (const std::string &name)
 Stops the last started timer and jumps back one hierarchy level. More...
 
bool isTimerRunning (const std::string &name) const
 Checks if specified timer is currently running. More...
 
void reset ()
 Resets the the timing hierarchy. More...
 
const TimingNode< TP > & getRawData () const
 Returns the raw tree data structure. More...
 
const Timer< TP > & operator[] (const std::string &name) const
 Finds the specified timer in the timing hierarchy. More...
 
bool timerExists (const std::string &n) const
 Checks if the specified timer exists in the timing hierarchy. More...
 
std::string getCurrentTimerName () const
 Returns the name of the currently running timer Might be expensive due to value search. More...
 
TimingTree< TP > getCopyWithRemainder () const
 Returns a copy of the timing tree containing the remaining time as a subnode. More...
 
Reduction
TimingTree< TP > getReduced (ReduceType rt=REDUCE_TOTAL, int targetRank=0) const
 Collects all the timing data from different processes. More...
 
void synchronize ()
 Adds entries which only exist on other processes. Has to be collectively called on all processes! More...
 

Private Attributes

TimingNode< TP > root_
 Tree data structure. More...
 
TimingNode< TP > * current_
 Pointer to the current hierarchy level. More...
 

Related Functions

(Note that these are not member functions.)

template<typename TP >
void to_json (nlohmann::json &j, const TimingTree< TP > &tt)
 Converts a TimingTree to json. More...
 
template<typename TP >
std::ostream & operator<< (std::ostream &os, const TimingTree< TP > &tt)
 

Constructor & Destructor Documentation

template<typename TP >
walberla::timing::TimingTree< TP >::TimingTree ( )

Creates and initialises the timing structure.

template<typename TP >
walberla::timing::TimingTree< TP >::TimingTree ( const TimingTree< TP > &  tt)

Member Function Documentation

template<typename TP >
TimingTree< TP > walberla::timing::TimingTree< TP >::getCopyWithRemainder ( ) const

Returns a copy of the timing tree containing the remaining time as a subnode.

template<typename TP >
std::string walberla::timing::TimingTree< TP >::getCurrentTimerName ( ) const

Returns the name of the currently running timer Might be expensive due to value search.

template<typename TP >
const TimingNode< TP > & walberla::timing::TimingTree< TP >::getRawData ( ) const

Returns the raw tree data structure.

template<typename TP >
TimingTree< TP > walberla::timing::TimingTree< TP >::getReduced ( ReduceType  rt = REDUCE_TOTAL,
int  targetRank = 0 
) const

Collects all the timing data from different processes.

template<typename TP >
bool walberla::timing::TimingTree< TP >::isTimerRunning ( const std::string &  name) const

Checks if specified timer is currently running.

template<typename TP >
TimingTree< TP > & walberla::timing::TimingTree< TP >::operator= ( const TimingTree< TP > &  tt)
template<typename TP >
const Timer< TP > & walberla::timing::TimingTree< TP >::operator[] ( const std::string &  name) const

Finds the specified timer in the timing hierarchy.

Parameters
nametimer name which may include more than one hierarchy separated by "."
tt["firstLevel.secondLevel.thirdLevel.timerName"].total();
template<typename TP >
void walberla::timing::TimingTree< TP >::reset ( )

Resets the the timing hierarchy.

template<typename TP >
void walberla::timing::TimingTree< TP >::start ( const std::string &  name)

Starts a timer beneath the current hierarchy level.

Parameters
nametimer name. '.' is not allowed in the timer name!
template<typename TP >
void walberla::timing::TimingTree< TP >::stop ( const std::string &  name)

Stops the last started timer and jumps back one hierarchy level.

template<typename TP >
void walberla::timing::TimingTree< TP >::swap ( TimingTree< TP > &  tt)
template<typename TP >
void walberla::timing::TimingTree< TP >::synchronize ( )

Adds entries which only exist on other processes. Has to be collectively called on all processes!

template<typename TP >
bool walberla::timing::TimingTree< TP >::timerExists ( const std::string &  name) const
inline

Checks if the specified timer exists in the timing hierarchy.

Parameters
nametimer name which may include more than one hierarchy separated by "."
tt.timerExists("firstLevel.secondLevel.thirdLevel.timerName");

Friends And Related Function Documentation

template<typename TP >
std::ostream & operator<< ( std::ostream &  os,
const TimingTree< TP > &  tt 
)
related
template<typename TP >
void to_json ( nlohmann::json &  j,
const TimingTree< TP > &  tt 
)
related

Converts a TimingTree to json.

The signature is required by the json library

Member Data Documentation

template<typename TP >
TimingNode<TP>* walberla::timing::TimingTree< TP >::current_
private

Pointer to the current hierarchy level.

template<typename TP >
TimingNode<TP> walberla::timing::TimingTree< TP >::root_
private

Tree data structure.


The documentation for this class was generated from the following files: