Teuchos::PerformanceMonitorBase< T > Class Template Reference

Provides common capabilities for collecting and reporting performance data across processors. PerformanceMonitorBase is templated on a counter type (which might be a timer or a flop counter). The common capability of the counter type is a counter for the number of calls. Derived counter types can supply additional features. More...

#include <Teuchos_PerformanceMonitorBase.hpp>

List of all members.

Public Member Functions

 PerformanceMonitorBase (T &counter, bool reset=false)
virtual ~PerformanceMonitorBase ()

Static Public Member Functions

RefCountPtr< T > getNewCounter (const string &name)
TableFormatformat ()

Protected Member Functions

const T & counter () const
T & counter ()
bool isRecursiveCall () const


Detailed Description

template<class T>
class Teuchos::PerformanceMonitorBase< T >

Provides common capabilities for collecting and reporting performance data across processors. PerformanceMonitorBase is templated on a counter type (which might be a timer or a flop counter). The common capability of the counter type is a counter for the number of calls. Derived counter types can supply additional features.

A PerformanceMonitorBase will increment its call counter upon every ctor call. Derived types might do more upon construction or destruction; for example, a timer will start upon construction and stop upon destruction.

The class keeps a static list of all counters created using the getNewCounter() method during the course of a run. Counts from this list can then be printed out at the end of the run.

The minimum requirements on the counter for use in the PerformanceMonitorBase are the following methods:

 // add one to number of calls 
 void incrementNumCalls() 
 // return the number of calls
 int numCalls() const 
 // indicate whether the counter is already running
 bool isRunning() const 

Definition at line 75 of file Teuchos_PerformanceMonitorBase.hpp.


Constructor & Destructor Documentation

template<class T>
Teuchos::PerformanceMonitorBase< T >::PerformanceMonitorBase T &  counter,
bool  reset = false
[inline]
 

Construct with a counter.

Definition at line 79 of file Teuchos_PerformanceMonitorBase.hpp.

template<class T>
virtual Teuchos::PerformanceMonitorBase< T >::~PerformanceMonitorBase  )  [inline, virtual]
 

The dtor for the base class does nothing.

Definition at line 86 of file Teuchos_PerformanceMonitorBase.hpp.


Member Function Documentation

template<class T>
RefCountPtr<T> Teuchos::PerformanceMonitorBase< T >::getNewCounter const string &  name  )  [inline, static]
 

Create a new counter with the specified name and append it to a global list of counters of this type. New counters should usually be created in this way rather than through a direct ctor call so that they can be appended to the list.

Definition at line 94 of file Teuchos_PerformanceMonitorBase.hpp.

template<class T>
TableFormat& Teuchos::PerformanceMonitorBase< T >::format  )  [inline, static]
 

Get the format that will be used to print a summary of results.

Definition at line 104 of file Teuchos_PerformanceMonitorBase.hpp.

template<class T>
const T& Teuchos::PerformanceMonitorBase< T >::counter  )  const [inline, protected]
 

Access to the counter

Definition at line 113 of file Teuchos_PerformanceMonitorBase.hpp.

template<class T>
T& Teuchos::PerformanceMonitorBase< T >::counter  )  [inline, protected]
 

Access to the counter

Definition at line 116 of file Teuchos_PerformanceMonitorBase.hpp.

template<class T>
bool Teuchos::PerformanceMonitorBase< T >::isRecursiveCall  )  const [inline, protected]
 

Indicate whether the current call is recursive. This can matter in cases such as timing where we don't want to start and stop timers multiple times within a single call stack.

Definition at line 122 of file Teuchos_PerformanceMonitorBase.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:30:32 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1