walberla::timing::TimingNode< TP > Struct Template Reference

#include <TimingNode.h>

Public Member Functions

 TimingNode ()
 Creates and initialises the timing structure. More...
 
 TimingNode (const TimingNode &tt)
 
TimingNode< TP > & operator= (const TimingNode< TP > &tt)
 
void swap (TimingNode< TP > &tt)
 
void printImpl (std::ostream &os, const std::string &prefix, const double totalTime, const double parentTime, const int firstColumn) const
 Implementation of the recursive print function. More...
 

Public Attributes

TimingNodelast_
 Pointer to the parent node. More...
 
Timer< TP > timer_
 Node timer. More...
 
std::map< std::string, TimingNodetree_
 Collection of sub timers. More...
 

Related Functions

(Note that these are not member functions.)

template<typename TP >
void to_json (nlohmann::json &j, const TimingNode< TP > &tn)
 Converts a TimingNode to json. More...
 
template<typename TP >
const Timer< TP > & findTimer (const TimingNode< TP > &tn, const std::string &name)
 Finds the specified timer in the timing hierarchy. More...
 
template<typename TP >
bool timerExists (const TimingNode< TP > &tn, const std::string &name)
 Checks if the specified timer exists in the timing hierarchy. More...
 
template<typename TP >
void reset (TimingNode< TP > &tn)
 Resets the timer in the TimingNode structure and all sub timers. More...
 
template<typename TP >
size_t getLongestTimerNameLength (const TimingNode< TP > &tn)
 Utility function to find the length of the longest timer name. More...
 
template<typename TP >
size_t getHierarchyDepth (const TimingNode< TP > &tn)
 Utility function to find the depth of a TimingNode tree. More...
 
template<typename TP >
void reduceInplace (TimingNode< TP > &tn, ReduceType rt=REDUCE_TOTAL, int targetRank=0)
 Collects all the timing data from different processes. More...
 
template<typename TP >
void synchronizeEntries (TimingNode< TP > &tn)
 Makes sure all nodes on all processes have the same children. More...
 
template<typename TP >
std::ostream & operator<< (std::ostream &os, const TimingNode< TP > &tn)
 

Constructor & Destructor Documentation

◆ TimingNode() [1/2]

template<typename TP >
walberla::timing::TimingNode< TP >::TimingNode

Creates and initialises the timing structure.

◆ TimingNode() [2/2]

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

Member Function Documentation

◆ operator=()

template<typename TP >
TimingNode< TP > & walberla::timing::TimingNode< TP >::operator= ( const TimingNode< TP > &  tt)

◆ printImpl()

template<typename TP >
void walberla::timing::TimingNode< TP >::printImpl ( std::ostream &  os,
const std::string &  prefix,
const double  totalTime,
const double  parentTime,
const int  firstColumn 
) const

Implementation of the recursive print function.

◆ swap()

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

Friends And Related Function Documentation

◆ findTimer()

template<typename TP >
const Timer< TP > & findTimer ( const TimingNode< TP > &  tn,
const std::string &  name 
)
related

Finds the specified timer in the timing hierarchy.

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

◆ getHierarchyDepth()

template<typename TP >
size_t getHierarchyDepth ( const TimingNode< TP > &  tn)
related

Utility function to find the depth of a TimingNode tree.

◆ getLongestTimerNameLength()

template<typename TP >
size_t getLongestTimerNameLength ( const TimingNode< TP > &  tn)
related

Utility function to find the length of the longest timer name.

◆ operator<<()

template<typename TP >
std::ostream & operator<< ( std::ostream &  os,
const TimingNode< TP > &  tn 
)
related

◆ reduceInplace()

template<typename TP >
void reduceInplace ( TimingNode< TP > &  tn,
ReduceType  rt = REDUCE_TOTAL,
int  targetRank = 0 
)
related

Collects all the timing data from different processes.

Attention
Will overwrite the current timer data! Multiple calls will accumulate!

◆ reset()

template<typename TP >
void reset ( TimingNode< TP > &  tn)
related

Resets the timer in the TimingNode structure and all sub timers.

◆ synchronizeEntries()

template<typename TP >
void synchronizeEntries ( TimingNode< TP > &  tn)
related

Makes sure all nodes on all processes have the same children.

◆ timerExists()

template<typename TP >
bool timerExists ( const TimingNode< TP > &  tn,
const std::string &  name 
)
related

Checks if the specified timer exists in the timing hierarchy.

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

◆ to_json()

template<typename TP >
void to_json ( nlohmann::json &  j,
const TimingNode< TP > &  tn 
)
related

Converts a TimingNode to json.

The signature is required by the json library

ignore the first timer in the timing node since it is empty

Member Data Documentation

◆ last_

template<typename TP >
TimingNode* walberla::timing::TimingNode< TP >::last_

Pointer to the parent node.

◆ timer_

template<typename TP >
Timer<TP> walberla::timing::TimingNode< TP >::timer_

Node timer.

◆ tree_

template<typename TP >
std::map<std::string, TimingNode> walberla::timing::TimingNode< TP >::tree_

Collection of sub timers.


The documentation for this struct was generated from the following files:
bool timerExists(const TimingNode< TP > &tn, const std::string &name)
Checks if the specified timer exists in the timing hierarchy.
Definition: TimingNode.h:140
const Timer< TP > & findTimer(const TimingNode< TP > &tn, const std::string &name)
Finds the specified timer in the timing hierarchy.
Definition: TimingNode.h:121