Timer info at a given level and all the children.
More...
#include <Teuchos_StackedTimer.hpp>
|
| | LevelTimer () |
| | Default constructor, shouldn't be used but needed for std::vector.
|
| | LevelTimer (int level, const char *name="RootTimer", LevelTimer *parent=nullptr, bool start_timer=true) |
| | LevelTimer (const LevelTimer &src) |
| | Copy constructor.
|
| LevelTimer * | start (const char *sub_name) |
| LevelTimer * | stop (const std::string &name="RootTimer") |
| std::string | get_full_name () const |
| int | countTimers () |
| double | accumulatedTime (const std::string &locate_name="") |
| unsigned | level () const |
| | Returns the level of the timer in the stack.
|
| double | accumulatedTimePerUpdate (const std::string &locate_name="") |
| double | accumulatedTimePerTimerCall (const std::string &locate_name="") |
| void | pack () |
| LevelTimer * | unpack (unsigned from) |
| void | report (std::ostream &os) |
| const BaseTimer * | findBaseTimer (const std::string &name) const |
| BaseTimer::TimeInfo | findTimer (const std::string &name, bool &found) |
| void | start () |
| | Start a currently stopped timer.
|
| void | stop () |
| | Stop a current running timer and accumulate time difference.
|
| unsigned long long | incrementUpdates (unsigned long long count=1) |
| | Increment the total number of items updated between a start stop.
|
| double | accumulatedTime () const |
| | Get the total accumulated time since last reset or construction when the timer is running.
|
| void | setAccumulatedTime (double accum=0) |
| | Setter for accumulated time.
|
| double | accumulatedTimePerUpdate () const |
| | return the average time per item updated
|
| double | accumulatedTimePerTimerCall () const |
| | return the average time per timer start/stop
|
| double | difference (const BaseTimer &from) const |
| | Return the difference between two timers in seconds,.
|
| void | reset () |
| | Reset all the timer stats, throws if it is already running.
|
| bool | running () const |
| | Returns true if the timer is currently accumulating time.
|
| unsigned long | numCalls () const |
| | Returns the number of calls to start().
|
| unsigned long long | numUpdates () const |
| | Returns the number of updates added to this timer.
|
| void | overrideNumCallsForUnitTesting (const unsigned long num_calls) |
| | Sets the number of calls to start() for this timer. This is only used for unit testing.
|
| void | overrideNumUpdatesForUnitTesting (const unsigned long long num_updates) |
| | Sets the number of counts for this timer. This is only used for unit testing.
|
|
| void | splitString (const std::string &locate_name, std::string &first_name, std::string &second_name) |
| | split a string into two parts split by a '@' if no '@' first gets the full string
|
Timer info at a given level and all the children.
This holds the timer info for the leaf node of a timer stack. It has both its timer info and all the sub leaves bellow it. You can start and stop sub timers, get sub info and dump out things to a ostream
Definition at line 203 of file Teuchos_StackedTimer.hpp.
◆ LevelTimer() [1/3]
| Teuchos::StackedTimer::LevelTimer::LevelTimer |
( |
| ) |
|
◆ LevelTimer() [2/3]
| Teuchos::StackedTimer::LevelTimer::LevelTimer |
( |
int | level, |
|
|
const char * | name = "RootTimer", |
|
|
LevelTimer * | parent = nullptr, |
|
|
bool | start_timer = true ) |
|
inline |
Standard constructor
- Parameters
-
| [in] | level | Integer level of this timer |
| [in] | name | Name for this timer |
| [in] | parent | Parent of this timer |
| [in] | start | bool to start the timer on construction |
Definition at line 223 of file Teuchos_StackedTimer.hpp.
◆ LevelTimer() [3/3]
| Teuchos::StackedTimer::LevelTimer::LevelTimer |
( |
const LevelTimer & | src | ) |
|
|
inline |
◆ start()
| LevelTimer * Teuchos::StackedTimer::LevelTimer::start |
( |
const char * | sub_name | ) |
|
|
inline |
Start a sub timer of a given name, create if doesn't exist
- Parameters
-
| [in] | sub_name | Name of subtimer |
- Returns
- Pointer to the sub timer which was started
Definition at line 250 of file Teuchos_StackedTimer.hpp.
◆ stop()
| LevelTimer * Teuchos::StackedTimer::LevelTimer::stop |
( |
const std::string & | name = "RootTimer" | ) |
|
|
inline |
Stop the current running timer. The timer name is required to verify that you are stopping the current running timer and will error out if the names don't match
- Parameters
-
| [in] | name | the name of the timer you want to stop, used for matching start only |
- Returns
- parent level timer
Definition at line 267 of file Teuchos_StackedTimer.hpp.
◆ get_full_name()
| std::string Teuchos::StackedTimer::LevelTimer::get_full_name |
( |
| ) |
const |
|
inline |
Return the full name of the timer with each level split by :
- Returns
- The full name of the timer
Definition at line 279 of file Teuchos_StackedTimer.hpp.
◆ countTimers()
| int Teuchos::StackedTimer::LevelTimer::countTimers |
( |
| ) |
|
|
inline |
Return the number of timers on this level
- Returns
- the number of timers and sub timers
Definition at line 295 of file Teuchos_StackedTimer.hpp.
◆ accumulatedTime()
| double Teuchos::StackedTimer::LevelTimer::accumulatedTime |
( |
const std::string & | locate_name = "" | ) |
|
|
inline |
Return the time spent at a given level
- Parameters
-
| [in] | locate_name | name of subtimer, if blank return current level time |
- Returns
- time in seconds at provided level
Definition at line 313 of file Teuchos_StackedTimer.hpp.
◆ level()
| unsigned Teuchos::StackedTimer::LevelTimer::level |
( |
| ) |
const |
|
inline |
◆ splitString()
| void Teuchos::StackedTimer::LevelTimer::splitString |
( |
const std::string & | locate_name, |
|
|
std::string & | first_name, |
|
|
std::string & | second_name ) |
|
inlineprotected |
split a string into two parts split by a '@' if no '@' first gets the full string
- Parameters
-
| [in] | locate_name | input string to split |
| [out] | first_name | Part of string before the first '@' |
| [out] | second_name | part of string after the first '@' |
Definition at line 345 of file Teuchos_StackedTimer.hpp.
◆ accumulatedTimePerUpdate()
| double Teuchos::StackedTimer::LevelTimer::accumulatedTimePerUpdate |
( |
const std::string & | locate_name = "" | ) |
|
|
inline |
Return the time spent per update at a given level
- Parameters
-
| [in] | locate_name | name of subtimer, if blank return current level time |
- Returns
- time in seconds per update at provided level
Definition at line 362 of file Teuchos_StackedTimer.hpp.
◆ accumulatedTimePerTimerCall()
| double Teuchos::StackedTimer::LevelTimer::accumulatedTimePerTimerCall |
( |
const std::string & | locate_name = "" | ) |
|
|
inline |
Return the time spent per timer start/stop pair at a given level
- Parameters
-
| [in] | locate_name | name of subtimer, if blank return current level time |
- Returns
- time in seconds per timer start/stop pair at provided level
Definition at line 381 of file Teuchos_StackedTimer.hpp.
◆ pack()
| void Teuchos::StackedTimer::LevelTimer::pack |
( |
| ) |
|
Pack up all the levels into a buffer and mpi send to rank 0
◆ unpack()
| LevelTimer * Teuchos::StackedTimer::LevelTimer::unpack |
( |
unsigned | from | ) |
|
Unpack the level timer stack from a mpi recv
- Parameters
-
| [in] | from | rank you are sending from |
- Returns
- pointer to level timer unpacked
◆ report()
| void Teuchos::StackedTimer::LevelTimer::report |
( |
std::ostream & | os | ) |
|
Dump the timer stats in a pretty format to ostream
- Parameters
-
| [in,out] | os | Where are you dumping the stats, stdout?? |
Definition at line 33 of file Teuchos_StackedTimer.cpp.
◆ findBaseTimer()
| const BaseTimer * Teuchos::StackedTimer::LevelTimer::findBaseTimer |
( |
const std::string & | name | ) |
const |
◆ findTimer()
| BaseTimer::TimeInfo Teuchos::StackedTimer::LevelTimer::findTimer |
( |
const std::string & | name, |
|
|
bool & | found ) |
Return the time info for a given string
- Parameters
-
| name | input string to search for |
| set | to true on exit if timer was found |
- Returns
- Time data
Definition at line 67 of file Teuchos_StackedTimer.cpp.
The documentation for this class was generated from the following files: