Sierra Toolkit Version of the Day
stk::diag::TimeBlockSynchronized Class Reference

#include <Timer.hpp>

Collaboration diagram for stk::diag::TimeBlockSynchronized:

List of all members.

Public Member Functions

 TimeBlockSynchronized (Timer &timer, ParallelMachine mpi_comm, bool start_timer=true)
 ~TimeBlockSynchronized ()
void start ()
void stop ()

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 581 of file Timer.hpp.

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.

timera Timer reference to the timer to start.
mpi_comma MPI_Comm value of the mpi communicator.
start_timera bool value to start the timer on construction.

Definition at line 870 of file Timer.cpp.

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

Destroys a TimeBlockSynchronized instance. Stops the timer if it has been started.

Definition at line 890 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 903 of file Timer.cpp.

void stk::diag::TimeBlockSynchronized::stop ( )

Member function stop stops the timer associated with the time block.

Definition at line 913 of file Timer.cpp.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines