|
Teuchos - Trilinos Tools Package
Version of the Day
|
This class allows one to push and pop timers on and off a stack. More...
#include <Teuchos_StackedTimer.hpp>
Classes | |
| class | LevelTimer |
| Timer info at a given level and all the children. More... | |
| struct | OutputOptions |
| Struct for controlling output options like histograms. More... | |
Public Member Functions | |
| StackedTimer (const char *name) | |
| void | start () |
| void | start (const std::string name) |
| void | stop (const std::string &name="RootTimer") |
| void | incrementCount (int i) |
| double | accumulatedTime (const std::string &name="") |
| double | accumulatedTimePerUpdate (const std::string &name="") |
| double | accumulatedTimePerTimerCall (const std::string &name="") |
| BaseTimer::TimeInfo | findTimer (const std::string &name) |
| void | report (std::ostream &os, Teuchos::RCP< const Teuchos::Comm< int > > comm, OutputOptions options=OutputOptions()) |
Protected Member Functions | |
| void | flatten () |
| void | merge (Teuchos::RCP< const Teuchos::Comm< int > > comm) |
| void | collectRemoteData (Teuchos::RCP< const Teuchos::Comm< int > > comm, const OutputOptions &options) |
| double | printLevel (std::string prefix, int level, std::ostream &os, std::vector< bool > &printed, double parent_time, const OutputOptions &options) |
Protected Attributes | |
| LevelTimer * | top_ |
| Current level running. More... | |
| LevelTimer | timer_ |
| Base timer. More... | |
This class allows one to push and pop timers on and off a stack.
To use this class one would do something like this
StackedTimer timer(); // construct top level timer timer.start("some comp"); do_work(); timer.start("sub comp"); more_work(); timer.stop(); // stopping sub comp timer.stop(); // stopping comp
timer.stop(); // stopping all timer stuff timer.report(std::cout); // dump to screen
Definition at line 169 of file Teuchos_StackedTimer.hpp.
|
inlineexplicit |
Construct a stacked timer
| name | Top level name of the timer |
Definition at line 408 of file Teuchos_StackedTimer.hpp.
|
inline |
Start the base level timer only, used really in testing only
Definition at line 413 of file Teuchos_StackedTimer.hpp.
|
inline |
Start a sublevel timer
| [in] | name | Name of the timer you wish to start |
Definition at line 423 of file Teuchos_StackedTimer.hpp.
|
inline |
Stop the current top running timer, should be called for the root timer prior to final output
Definition at line 436 of file Teuchos_StackedTimer.hpp.
|
inline |
Increment the iteration count for the running timer
| [in] | i | amount to increment the count |
Definition at line 450 of file Teuchos_StackedTimer.hpp.
|
inline |
Return the accumulated time the named timer has, if name is blank top level timer
| [in] | name | Name of the timer to output |
Definition at line 459 of file Teuchos_StackedTimer.hpp.
|
inline |
Return the time spent per update at a given level
| [in] | name | name of subtimer, if blank return current level time |
Definition at line 471 of file Teuchos_StackedTimer.hpp.
|
inline |
Return the time spent per timer start/stop at a given level
| [in] | name | name of subtimer, if blank return current level time |
Definition at line 482 of file Teuchos_StackedTimer.hpp.
|
inline |
Return the time info for a given string (full string name)
| name | input string to search for |
Definition at line 494 of file Teuchos_StackedTimer.hpp.
| void Teuchos::StackedTimer::report | ( | std::ostream & | os, |
| Teuchos::RCP< const Teuchos::Comm< int > > | comm, | ||
| OutputOptions | options = OutputOptions() |
||
| ) |
Dump all the data from all the MPI ranks to an ostream
| [in] | os | - Output stream |
| [in] | comm | - Teuchos comm pointer |
Definition at line 230 of file Teuchos_StackedTimer.cpp.
|
protected |
Flatten the timers into a single array
Definition at line 57 of file Teuchos_StackedTimer.cpp.
|
protected |
Merge all the timers together into a single structure
| [in] | comm | - Communicator to use |
Definition at line 65 of file Teuchos_StackedTimer.cpp.
|
protected |
Migrate all the timer data to rank=0 if parallel
Definition at line 72 of file Teuchos_StackedTimer.cpp.
|
protected |
Recursive call to print a level of timer data.
Definition at line 167 of file Teuchos_StackedTimer.cpp.
|
protected |
Current level running.
Definition at line 530 of file Teuchos_StackedTimer.hpp.
|
protected |
Base timer.
Definition at line 532 of file Teuchos_StackedTimer.hpp.
1.8.16