stk::diag::TimeBlockSynchronized Class Reference

#include <Timer.hpp>

List of all members.

Detailed Description

Class TimeBlockSynchronized is a time sentry for timing a statement block.

The timer is generally started upon construction. But, the start is delayed if the second argument is false. In this case, manually start the timer by calling the start() function. This gives the safety of using a sentry, but does not force to awkwardness associated with local variables crossing the timed block.

Prior to starting the timer, an MPI synchronization barrier is set so that the timing of routines which require MPI communication will all be at a known location prior to executing.

Definition at line 571 of file Timer.hpp.

Public Member Functions

 TimeBlockSynchronized (Timer &timer, ParallelMachine mpi_comm, bool start_timer=true)
 Creates a new TimeBlockSynchronized instance.
 ~TimeBlockSynchronized ()
 Destroys a TimeBlockSynchronized instance.
void start ()
 Member function start starts the timer associated with the time block.
void stop ()
 Member function stop stops the timer associated with the time block.

Constructor & Destructor Documentation

stk::diag::TimeBlockSynchronized::TimeBlockSynchronized ( Timer timer,
ParallelMachine  mpi_comm,
bool  start_timer = true 

Creates a new TimeBlockSynchronized instance.

If start_timer is true, then the timer is started using the start(). An MPI_Barrier is called to synchronize the start of the timer. The destructor will always stop a started timer.

timer a Timer reference to the timer to start.
mpi_comm a MPI_Comm value of the mpi communicator.
start_timer a bool value to start the timer on construction.

Definition at line 821 of file Timer.cpp.

stk::diag::TimeBlockSynchronized::~TimeBlockSynchronized (  ) 

Destroys a TimeBlockSynchronized instance.

Stops the timer if it has been started.

Definition at line 841 of file Timer.cpp.

Member Function Documentation

void stk::diag::TimeBlockSynchronized::start (  ) 

Member function start starts the timer associated with the time block.

An MPI_Barrier is executed prior to starting the timer.

Definition at line 854 of file Timer.cpp.

The documentation for this class was generated from the following files:
Generated on Tue Jul 13 09:27:33 2010 for Sierra Toolkit by  doxygen 1.4.7