stk::diag::Timer Class Reference

Class Timer implements a diagnostic timer and timer container for the collection and display of execution times. More...

#include <Timer.hpp>

List of all members.

Classes

struct  Metric
 Class Metric maintains the metric data for the timer or counter. More...

Public Member Functions

 Timer (const std::string &name, const Timer parent)
 Creates a new Timer instance.
 Timer (const std::string &name, const Timer parent, const TimerSet &timer_set)
 Creates a new Timer instance.
 Timer (const std::string &name, TimerMask timer_mask, const Timer parent)
 Creates a new Timer instance.
 Timer (const std::string &name, TimerMask timer_mask, const Timer parent, const TimerSet &timer_set)
 Creates a new Timer instance.
 Timer (TimerImpl &timer_impl)
 Creates the root Timer timer instance.
 Timer (TimerImpl *timer_impl)
 Timer (const Timer &timer)
Timeroperator= (const Timer &timer)
const TimerList & getTimerList () const
TimerList::iterator begin ()
TimerList::const_iterator begin () const
TimerList::iterator end ()
TimerList::const_iterator end () const
const std::string & getName () const
 Member function getName returns the name of the timer.
const TimerSetgetTimerSet () const
 Member function getTimerMask returns the timer mask of the timer.
TimerMask getTimerMask () const
 Member function getTimerMask returns the timer mask of the timer.
bool shouldRecord () const
double getSubtimerLapCount () const
 Member function getSubtimerLapCount returns the subtimer lap counter.
template<class T >
const Metric< T > & getMetric () const
 Member function getLapCount returns the lap counter metric.
double accumulateSubtimerLapCounts () const
 Member function accumulateSubtimerLapCounts accumulates the subtimer la counts.
Timerstart ()
 Member function start starts the lap timer.
Timerlap ()
 Member function lap sets the lap stop time.
Timerstop ()
 Member function stop sets the lap stop time and sums the just completed lap time to the timer.
void checkpoint () const
 Member function checkpoint checkpoints the metrics by storing the total time in the checkpoint value.
Writerdump (Writer &dout) const
 Member function dump writes the timer to the specified diagnostic writer.

Friends

class TimerImpl
class TimeBlock
class TimeBlockSynchronized
void updateRootTimer (Timer)
 Function updateRootTimer updates the root timers stop and total metric values with the current time.
Timer createRootTimer (const std::string &, const TimerSet &)
 Function createRootTimer creates a root timer.
void deleteRootTimer (Timer)
 Function deleteRootTimer deletes a root timer and all of it's children timers.
std::vector< Timer > & findTimers (Timer, const std::string &, std::vector< Timer > &)
 Member function findTimer return a vector of timers whose tail of the dot separated name from root_time to leaf matches the specified path_tail.

Detailed Description

Class Timer implements a diagnostic timer and timer container for the collection and display of execution times.

Definition at line 175 of file Timer.hpp.


Constructor & Destructor Documentation

stk::diag::Timer::Timer ( const std::string &  name,
const Timer  parent 
)

Creates a new Timer instance.

Parameters:
name a std::string const reference to the name of the timer.
parent a Timer value of the parent timer.

Definition at line 680 of file Timer.cpp.

stk::diag::Timer::Timer ( const std::string &  name,
const Timer  parent,
const TimerSet timer_set 
)

Creates a new Timer instance.

Parameters:
name a std::string const reference to the name of the timer.
parent a Timer value of the parent timer.
timer_set a TimerSet value of the timer set used to interpret the TimerMask's of this and children timers.

Definition at line 688 of file Timer.cpp.

stk::diag::Timer::Timer ( const std::string &  name,
TimerMask  timer_mask,
const Timer  parent 
)

Creates a new Timer instance.

Parameters:
name a std::string const reference to the name of the timer.
timer_mask a TimerMask value which enables this timer.
parent a Timer value of the parent timer.

Definition at line 684 of file Timer.cpp.

stk::diag::Timer::Timer ( const std::string &  name,
TimerMask  timer_mask,
const Timer  parent,
const TimerSet timer_set 
)

Creates a new Timer instance.

Parameters:
name a std::string const reference to the name of the timer.
timer_mask a TimerMask value which enables this timer.
parent a Timer value of the parent timer.
timer_set a TimerSet value of the timer set used to interpret the TimerMask's of this and children timers.

Definition at line 692 of file Timer.cpp.


Member Function Documentation

const std::string & stk::diag::Timer::getName (  )  const

Member function getName returns the name of the timer.

Returns:
a std::string const reference to the timer's name.

Definition at line 698 of file Timer.cpp.

const TimerSet & stk::diag::Timer::getTimerSet (  )  const

Member function getTimerMask returns the timer mask of the timer.

Returns:
a TimerMask value to the timer mask.

Definition at line 708 of file Timer.cpp.

TimerMask stk::diag::Timer::getTimerMask (  )  const

Member function getTimerMask returns the timer mask of the timer.

Returns:
a TimerMask value to the timer mask.

Definition at line 703 of file Timer.cpp.

double stk::diag::Timer::getSubtimerLapCount (  )  const

Member function getSubtimerLapCount returns the subtimer lap counter.

Returns:
a Counter value of the subtimer lap counter.

Definition at line 713 of file Timer.cpp.

template<class T >
template const Timer::Metric< MPIByteCount > & stk::diag::Timer::getMetric< MPIByteCount > (  )  const [inline]

Member function getLapCount returns the lap counter metric.

The lap count metric is the number of times the stop function has been executed.

Returns:
a CounterMetric const reference of the lap counter metric.

Definition at line 724 of file Timer.cpp.

double stk::diag::Timer::accumulateSubtimerLapCounts (  )  const

Member function accumulateSubtimerLapCounts accumulates the subtimer la counts.

Returns:
an int value of the count.

Definition at line 766 of file Timer.cpp.

Timer & stk::diag::Timer::start (  ) 

Member function start starts the lap timer.

Returns:
a Timer reference to this timer.

Definition at line 771 of file Timer.cpp.

Timer & stk::diag::Timer::lap (  ) 

Member function lap sets the lap stop time.

Returns:
a Timer reference to the timer.

Definition at line 777 of file Timer.cpp.

Timer & stk::diag::Timer::stop (  ) 

Member function stop sets the lap stop time and sums the just completed lap time to the timer.

Returns:
a Timer reference to the timer.

Definition at line 783 of file Timer.cpp.

Writer & stk::diag::Timer::dump ( Writer dout  )  const

Member function dump writes the timer to the specified diagnostic writer.

Parameters:
dout a Writer variable reference to write the timer to.
Returns:
a Writer reference to dout.

Definition at line 794 of file Timer.cpp.


Friends And Related Function Documentation

void updateRootTimer ( Timer   )  [friend]

Function updateRootTimer updates the root timers stop and total metric values with the current time.

Parameters:
root_timer a Timer reference to the root timer.
Timer createRootTimer ( const std::string &  ,
const TimerSet  
) [friend]

Function createRootTimer creates a root timer.

Root timers are the root of a timer hierarchy. The timer_set specifies the timer groupings for this root timer. The percentage of a child timer is the ratio of that timer the its root.

Parameters:
name a std::string const reference to the name of the new root timer.
timer_set a TimerSet const reference of the timer set of the new root timer.
Returns:
a Timer value of the new root timer.
void deleteRootTimer ( Timer   )  [friend]

Function deleteRootTimer deletes a root timer and all of it's children timers.

All children Timers are invalidated and can no longer be used.

Parameters:
a Timer value of the root timer to delete.
std::vector<Timer>& findTimers ( Timer  ,
const std::string &  ,
std::vector< Timer > &   
) [friend]

Member function findTimer return a vector of timers whose tail of the dot separated name from root_time to leaf matches the specified path_tail.

Parameters:
root_timer a Timer value of the root to begin search.
path_tail a std::string const reference to the dot separated tail to match.
found_timer a std::vector<Timer> reference to the vector to store matching timers.
Returns:
a std::vector<Timer> reference to found_timer.

The documentation for this class was generated from the following files:
Generated on Wed Apr 13 10:05:50 2011 for Sierra Toolkit by  doxygen 1.6.3