#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... | |
TimingTree< TP > | getReduced (ReduceType rt=REDUCE_TOTAL, int targetRank=0, bool callSynchronize=true) 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... | |
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... | |
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) |
walberla::timing::TimingTree< TP >::TimingTree |
Creates and initialises the timing structure.
walberla::timing::TimingTree< TP >::TimingTree | ( | const TimingTree< TP > & | tt | ) |
TimingTree< TP > walberla::timing::TimingTree< TP >::getCopyWithRemainder |
Returns a copy of the timing tree containing the remaining time as a subnode.
std::string walberla::timing::TimingTree< TP >::getCurrentTimerName |
Returns the name of the currently running timer Might be expensive due to value search.
const TimingNode< TP > & walberla::timing::TimingTree< TP >::getRawData |
Returns the raw tree data structure.
TimingTree< TP > walberla::timing::TimingTree< TP >::getReduced | ( | ReduceType | rt = REDUCE_TOTAL , |
int | targetRank = 0 , |
||
bool | callSynchronize = true |
||
) | const |
Collects all the timing data from different processes.
rt | type of reduction used |
targetRank | |
callSynchronize | call synchronize() before doing the reduction |
bool walberla::timing::TimingTree< TP >::isTimerRunning | ( | const std::string & | name | ) | const |
Checks if specified timer is currently running.
TimingTree< TP > & walberla::timing::TimingTree< TP >::operator= | ( | const TimingTree< TP > & | tt | ) |
const Timer< TP > & walberla::timing::TimingTree< TP >::operator[] | ( | const std::string & | name | ) | const |
Finds the specified timer in the timing hierarchy.
name | timer name which may include more than one hierarchy separated by "." tt["firstLevel.secondLevel.thirdLevel.timerName"].total();
|
void walberla::timing::TimingTree< TP >::reset |
Resets the the timing hierarchy.
void walberla::timing::TimingTree< TP >::start | ( | const std::string & | name | ) |
Starts a timer beneath the current hierarchy level.
name | timer name. '.' is not allowed in the timer name! |
void walberla::timing::TimingTree< TP >::stop | ( | const std::string & | name | ) |
Stops the last started timer and jumps back one hierarchy level.
void walberla::timing::TimingTree< TP >::swap | ( | TimingTree< TP > & | tt | ) |
void walberla::timing::TimingTree< TP >::synchronize |
Adds entries which only exist on other processes. Has to be collectively called on all processes!
|
inline |
Checks if the specified timer exists in the timing hierarchy.
name | timer name which may include more than one hierarchy separated by "." tt.timerExists("firstLevel.secondLevel.thirdLevel.timerName");
|
|
related |
|
related |
Converts a TimingTree to json.
The signature is required by the json library
|
private |
Pointer to the current hierarchy level.
|
private |
Tree data structure.