Public Member Functions | Static Public Attributes | Private Attributes | Friends

LibGeoDecomp::Chronometer Class Reference

This class can be used to measure execution time of different parts of our code. More...

#include <chronometer.h>

Collaboration diagram for LibGeoDecomp::Chronometer:
Collaboration graph

List of all members.

Public Member Functions

 Chronometer ()
const double & operator[] (int intervalID) const
double & operator[] (int intervalID)
Chronometeroperator+= (const Chronometer &other)
 Aggregates two chronometers.
Chronometer operator+ (const Chronometer &other) const
void reset ()
 Flushes all time totals to 0.
void cycle ()
double interval (int i) const
template<typename INTERVAL >
double interval () const
template<typename INTERVAL1 , typename INTERVAL2 >
double ratio ()
 Returns the ratio of the accumulated times of INTERVAL1 and INTERVAL2.
double * rawTotalTimes ()
template<typename EVENT >
void addTime (double elapsedTime)
template<typename EVENT >
void tock (double startTime)
std::string report ()

Static Public Attributes

static const std::size_t NUM_INTERVALS = ChronometerHelpers::EventUtil<100>::NUM_EVENTS

Private Attributes

FixedArray< double,


class ChronometerTest
class Serialization
class Typemaps

Detailed Description

This class can be used to measure execution time of different parts of our code.

This is useful to determine the relative load of a node or to find out which part of the algorithm the most time.

Constructor & Destructor Documentation

LibGeoDecomp::Chronometer::Chronometer (  )  [inline]

References reset().

Member Function Documentation

template<typename EVENT >
void LibGeoDecomp::Chronometer::addTime ( double  elapsedTime  )  [inline]
void LibGeoDecomp::Chronometer::cycle (  )  [inline]
template<typename INTERVAL >
double LibGeoDecomp::Chronometer::interval (  )  const [inline]

References totalTimes.

double LibGeoDecomp::Chronometer::interval ( int  i  )  const [inline]

References totalTimes.

Chronometer LibGeoDecomp::Chronometer::operator+ ( const Chronometer other  )  const [inline]
Chronometer& LibGeoDecomp::Chronometer::operator+= ( const Chronometer other  )  [inline]

Aggregates two chronometers.

This is good for accumulating measurements from multiple sources.

References NUM_INTERVALS, and totalTimes.

double& LibGeoDecomp::Chronometer::operator[] ( int  intervalID  )  [inline]

References totalTimes.

const double& LibGeoDecomp::Chronometer::operator[] ( int  intervalID  )  const [inline]

References totalTimes.

template<typename INTERVAL1 , typename INTERVAL2 >
double LibGeoDecomp::Chronometer::ratio (  )  [inline]

Returns the ratio of the accumulated times of INTERVAL1 and INTERVAL2.

Caveat: returns 0.5 if the second interval is empty. This is because ratio() is typically used for load balancing. For that purpose 0.5 is easier to digest than NaN.

References totalTimes.

double* LibGeoDecomp::Chronometer::rawTotalTimes (  )  [inline]
std::string LibGeoDecomp::Chronometer::report (  )  [inline]

References NUM_INTERVALS, and totalTimes.

void LibGeoDecomp::Chronometer::reset (  )  [inline]
template<typename EVENT >
void LibGeoDecomp::Chronometer::tock ( double  startTime  )  [inline]

Friends And Related Function Documentation

friend class ChronometerTest [friend]
friend class Serialization [friend]
friend class Typemaps [friend]

Member Data Documentation

const std::size_t LibGeoDecomp::Chronometer::NUM_INTERVALS = ChronometerHelpers::EventUtil<100>::NUM_EVENTS [static]

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