Sierra Toolkit
Version of the Day
|
#include <Timer.hpp>
Public Member Functions | |
TimeBlockSynchronized (Timer &timer, ParallelMachine mpi_comm, bool start_timer=true) | |
~TimeBlockSynchronized () | |
void | start () |
void | stop () |
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.
stk_classic::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. |
stk_classic::diag::TimeBlockSynchronized::~TimeBlockSynchronized | ( | ) |
Destroys a TimeBlockSynchronized instance. Stops the timer if it has been started.
void stk_classic::diag::TimeBlockSynchronized::start | ( | ) |
void stk_classic::diag::TimeBlockSynchronized::stop | ( | ) |