walberla::timing Namespace Reference

Namespaces

 internal
 

Classes

struct  CpuPolicy
 Timing policy for the measurement of the CPU time. More...
 
class  RemainingTimeLogger
 
class  ScopeTimer
 
struct  StaticPolicy
 Timing policy for fake measurement with a static settable clock. More...
 
class  Timer
 Progress timer for time and performance measurements. More...
 
struct  TimingNode
 
class  TimingPool
 
class  TimingTree
 
struct  WcPolicy
 Timing policy for the measurement of the wall clock time. More...
 

Enumerations

enum  ReduceType { REDUCE_MIN, REDUCE_AVG, REDUCE_MAX, REDUCE_TOTAL }
 The reduce type describes which values are reduced from each process. More...
 

Functions

double getCpuTime ()
 Returns the current CPU time in seconds. More...
 
double getWcTime ()
 Returns the current wall clock time in seconds. More...
 
std::string timeToString (real_t time)
 Converts a timespan to a string. More...
 
template<typename TP >
shared_ptr< Timer< TP > > getReduced (Timer< TP > &timer, ReduceType rt, int targetRank)
 Returns a reduced Timer, holding information from all processes. More...
 
template<typename TP >
std::ostream & operator<< (std::ostream &os, const Timer< TP > &timer)
 
template<typename T , typename G , typename TP >
mpi::GenericSendBuffer< T, G > & operator<< (mpi::GenericSendBuffer< T, G > &buf, const Timer< TP > &t)
 
template<typename T , typename TP >
mpi::GenericRecvBuffer< T > & operator>> (mpi::GenericRecvBuffer< T > &buf, Timer< TP > &t)
 
template<typename TP >
std::ostream & operator<< (std::ostream &os, const TimingPool< TP > &tp)
 
template<typename T , typename G , typename TP >
mpi::GenericSendBuffer< T, G > & operator<< (mpi::GenericSendBuffer< T, G > &buf, const timing::TimingPool< TP > &tp)
 
template<typename T , typename TP >
mpi::GenericRecvBuffer< T > & operator>> (mpi::GenericRecvBuffer< T > &buf, timing::TimingPool< TP > &tp)
 

Enumeration Type Documentation

◆ ReduceType

The reduce type describes which values are reduced from each process.

Enumerator
REDUCE_MIN 

Treats each process as one timing sample. For the timing sample the min value is used.

REDUCE_AVG 

Treats each process as one timing sample. For the timing sample the average value is used.

REDUCE_MAX 

Treats each process as one timing sample. For the timing sample the max value is used.

REDUCE_TOTAL 

Collects all timing samples from all processes and accumulates the data.

The number of measurements afterwards are: nrOfProcesses*measurementsPerProcess

Function Documentation

◆ getCpuTime()

double walberla::timing::getCpuTime ( )

Returns the current CPU time in seconds.

Returns
The current CPU time in seconds.

◆ getReduced()

template<typename TP >
shared_ptr<Timer<TP> > walberla::timing::getReduced ( Timer< TP > &  timer,
ReduceType  rt,
int  targetRank 
)

Returns a reduced Timer, holding information from all processes.

Parameters
timerTimer which should be reduced
rtSpecified the method how the reduction is done. See documentation for ReduceType
targetRankthe world rank of the target process. Or negative value for an all-reduction operation
Returns
a nonzero shared pointer to a Timer on the process with rank "targetRank" and a zero pointer otherwise. For the all-reduction a valid timer is returned on all processes.

◆ getWcTime()

double walberla::timing::getWcTime ( )
inline

Returns the current wall clock time in seconds.

Returns
The current wall clock time in seconds.

◆ operator<<() [1/4]

template<typename T , typename G , typename TP >
mpi::GenericSendBuffer<T,G>& walberla::timing::operator<< ( mpi::GenericSendBuffer< T, G > &  buf,
const Timer< TP > &  t 
)

◆ operator<<() [2/4]

template<typename T , typename G , typename TP >
mpi::GenericSendBuffer<T,G>& walberla::timing::operator<< ( mpi::GenericSendBuffer< T, G > &  buf,
const timing::TimingPool< TP > &  tp 
)

◆ operator<<() [3/4]

template<typename TP >
std::ostream& walberla::timing::operator<< ( std::ostream &  os,
const Timer< TP > &  timer 
)

◆ operator<<() [4/4]

template<typename TP >
std::ostream& walberla::timing::operator<< ( std::ostream &  os,
const TimingPool< TP > &  tp 
)

◆ operator>>() [1/2]

template<typename T , typename TP >
mpi::GenericRecvBuffer<T>& walberla::timing::operator>> ( mpi::GenericRecvBuffer< T > &  buf,
Timer< TP > &  t 
)

◆ operator>>() [2/2]

template<typename T , typename TP >
mpi::GenericRecvBuffer<T>& walberla::timing::operator>> ( mpi::GenericRecvBuffer< T > &  buf,
timing::TimingPool< TP > &  tp 
)

◆ timeToString()

std::string walberla::timing::timeToString ( real_t  time)
inline

Converts a timespan to a string.

Parameters
timeThe timespan in seconds.
Returns
A string of the form "3d 2h 12m 9s". Zero values are omitted.