MueLu
Version of the Day
|
This class wraps a Teuchos::Time and maintains a mutually exclusive property between wrapped timers. More...
#include <MueLu_MutuallyExclusiveTime.hpp>
Public Member Functions | |
void | start (bool reset=false) |
Starts the timer. If a MutuallyExclusiveTime timer is running, it will be stopped. More... | |
void | incrementNumCalls () |
Increment the number of times this timer has been called. More... | |
![]() | |
virtual | ~BaseClass () |
Destructor. More... | |
![]() | |
VerbLevel | GetVerbLevel () const |
Get the verbosity level. More... | |
void | SetVerbLevel (const VerbLevel verbLevel) |
Set the verbosity level of this object. More... | |
int | GetProcRankVerbose () const |
Get proc rank used for printing. Do not use this information for any other purpose. More... | |
int | SetProcRankVerbose (int procRank) const |
Set proc rank used for printing. More... | |
bool | IsPrint (MsgType type, int thisProcRankOnly=-1) const |
Find out whether we need to print out information for a specific message type. More... | |
Teuchos::FancyOStream & | GetOStream (MsgType type, int thisProcRankOnly=0) const |
Get an output stream for outputting the input message type. More... | |
Teuchos::FancyOStream & | GetBlackHole () const |
VerboseObject () | |
virtual | ~VerboseObject () |
Destructor. More... | |
![]() | |
VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null) | |
VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null) | |
virtual const VerboseObject & | setVerbLevel (const EVerbosityLevel verbLevel) const |
virtual const VerboseObject & | setVerbLevel (const EVerbosityLevel verbLevel) const |
virtual const VerboseObject & | setOverridingVerbLevel (const EVerbosityLevel verbLevel) const |
virtual const VerboseObject & | setOverridingVerbLevel (const EVerbosityLevel verbLevel) const |
virtual EVerbosityLevel | getVerbLevel () const |
virtual EVerbosityLevel | getVerbLevel () const |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< const ParameterList > | getValidVerboseObjectSublist () |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | setupVerboseObjectSublist (ParameterList *paramList) |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | readVerboseObjectSublist (ParameterList *paramList, RCP< FancyOStream > *oStream, EVerbosityLevel *verbLevel) |
void | readVerboseObjectSublist (ParameterList *paramList, VerboseObject< ObjectType > *verboseObject) |
![]() | |
virtual | ~VerboseObjectBase () |
VerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null) | |
virtual const VerboseObjectBase & | setOStream (const RCP< FancyOStream > &oStream) const |
virtual const VerboseObjectBase & | setOverridingOStream (const RCP< FancyOStream > &oStream) const |
virtual VerboseObjectBase & | setLinePrefix (const std::string &linePrefix) |
virtual RCP< FancyOStream > | getOStream () const |
virtual RCP< FancyOStream > | getOverridingOStream () const |
virtual std::string | getLinePrefix () const |
virtual OSTab | getOSTab (const int tabs=1, const std::string &linePrefix="") const |
virtual | ~VerboseObjectBase () |
VerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null) | |
virtual const VerboseObjectBase & | setOStream (const RCP< FancyOStream > &oStream) const |
virtual const VerboseObjectBase & | setOverridingOStream (const RCP< FancyOStream > &oStream) const |
virtual VerboseObjectBase & | setLinePrefix (const std::string &linePrefix) |
virtual RCP< FancyOStream > | getOStream () const |
virtual RCP< FancyOStream > | getOverridingOStream () const |
virtual std::string | getLinePrefix () const |
virtual OSTab | getOSTab (const int tabs=1, const std::string &linePrefix="") const |
![]() | |
virtual | ~Describable () |
Destructor. More... | |
virtual std::string | ShortClassName () const |
Return the class name of the object, without template parameters and without namespace. More... | |
virtual void | describe (Teuchos::FancyOStream &out_arg, const VerbLevel verbLevel=Default) const |
virtual std::string | description () const |
Return a simple one-line description of this object. More... | |
void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const |
Print the object with some verbosity level to an FancyOStream object. More... | |
![]() | |
void | describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
DescribableStreamManipulatorState | describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default) |
std::ostream & | operator<< (std::ostream &os, const DescribableStreamManipulatorState &d) |
void | describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
![]() | |
LabeledObject () | |
virtual | ~LabeledObject () |
virtual void | setObjectLabel (const std::string &objectLabel) |
virtual std::string | getObjectLabel () const |
Static Public Member Functions | |
static RCP< MutuallyExclusiveTime< TagName > > | getNewTimer (const std::string &name) |
Return a new MutuallyExclusiveTime that is registered with the Teuchos::TimeMonitor (for timer summary). More... | |
static void | PrintParentChildPairs () |
Print std::map of (child,parent) pairs for post-run analysis. More... | |
![]() | |
static void | SetDefaultOStream (const Teuchos::RCP< Teuchos::FancyOStream > &defaultOStream) |
static Teuchos::RCP< Teuchos::FancyOStream > | GetDefaultOStream () |
static void | SetDefaultVerbLevel (const VerbLevel defaultVerbLevel) |
Set the default (global) verbosity level. More... | |
static VerbLevel | GetDefaultVerbLevel () |
Get the default (global) verbosity level. More... | |
![]() | |
static void | setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel) |
static void | setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel) |
static EVerbosityLevel | getDefaultVerbLevel () |
static EVerbosityLevel | getDefaultVerbLevel () |
![]() | |
static void | setDefaultOStream (const RCP< FancyOStream > &defaultOStream) |
static RCP< FancyOStream > | getDefaultOStream () |
static void | setDefaultOStream (const RCP< FancyOStream > &defaultOStream) |
static RCP< FancyOStream > | getDefaultOStream () |
Public Attributes | |
std::string | name_ |
Name of this mutually exclusive timer. More... | |
Private Member Functions | |
MutuallyExclusiveTime (RCP< Teuchos::Time > timer) | |
void | TopOfTheStack () |
Check if 'this' is the head of the stack. More... | |
Private Attributes | |
RCP< Teuchos::Time > | timer_ |
Using an RCP allows to use Teuchos::TimeMonitor to keep track of the timer. More... | |
bool | isPaused_ |
Static Private Attributes | |
static std::stack< MutuallyExclusiveTime< TagName > * > | timerStack_ |
Stack of created timers (active or paused timers). More... | |
Constructor/Destructor | |
MutuallyExclusiveTime (const std::string &name, bool startFlag=false) | |
Constructor. More... | |
~MutuallyExclusiveTime () | |
Destructor. More... | |
Functions that can only be called on the most recent timer (i.e., the running or last paused timer) | |
double | stop () |
Stops the timer. The previous MutuallyExclusiveTime that has been paused when this timer was started will be resumed. This method can be called on an already stopped timer or on the currently running timer. More... | |
void | pause () |
Pause running timer. Used internally by start(). More... | |
void | resume () |
Resume paused timer. Used internally by stop(). Timer is not reset. More... | |
Query methods. | |
bool | isRunning () |
bool | isPaused () |
Additional Inherited Members | |
![]() | |
static const EVerbosityLevel | verbLevel_default |
![]() | |
void | initializeVerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null) |
![]() | |
void | initializeVerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null) |
virtual void | informUpdatedVerbosityState () const |
This class wraps a Teuchos::Time and maintains a mutually exclusive property between wrapped timers.
This class is useful to exclude from a timer the execution time of a subroutine; when a MutuallyExclusiveTime is running, other timers are not running. Timers have three states (running, stopped, paused) to enforce the mutually exclusive property. When the running timer is stopped, the last active timer is restarted. A stack of timers is used internally to support this functionality. The template parameter of this class can be used to define several sets of mutually exclusive timers.
Note: Only one timer can be active at a time but all timers can be inactive at the same time. Timers cannot be destroyed when they are in 'paused'.
Definition at line 85 of file MueLu_MutuallyExclusiveTime.hpp.
|
inline |
Constructor.
Definition at line 92 of file MueLu_MutuallyExclusiveTime.hpp.
|
inline |
Destructor.
Definition at line 102 of file MueLu_MutuallyExclusiveTime.hpp.
|
inlineprivate |
This constructor is not public to prevent users from using Teuchos::Time::start()/stop() instead of MutuallyExclusiveTime::start()/stop(), if they have access to the underlying Teuchos::Time object.
Definition at line 244 of file MueLu_MutuallyExclusiveTime.hpp.
|
inline |
Starts the timer. If a MutuallyExclusiveTime timer is running, it will be stopped.
Definition at line 117 of file MueLu_MutuallyExclusiveTime.hpp.
|
inline |
Stops the timer. The previous MutuallyExclusiveTime that has been paused when this timer was started will be resumed. This method can be called on an already stopped timer or on the currently running timer.
Definition at line 145 of file MueLu_MutuallyExclusiveTime.hpp.
|
inline |
Pause running timer. Used internally by start().
Definition at line 164 of file MueLu_MutuallyExclusiveTime.hpp.
|
inline |
Resume paused timer. Used internally by stop(). Timer is not reset.
Definition at line 178 of file MueLu_MutuallyExclusiveTime.hpp.
|
inline |
Definition at line 195 of file MueLu_MutuallyExclusiveTime.hpp.
|
inline |
Definition at line 203 of file MueLu_MutuallyExclusiveTime.hpp.
|
inlinestatic |
Return a new MutuallyExclusiveTime that is registered with the Teuchos::TimeMonitor (for timer summary).
Definition at line 212 of file MueLu_MutuallyExclusiveTime.hpp.
|
inline |
Increment the number of times this timer has been called.
Definition at line 219 of file MueLu_MutuallyExclusiveTime.hpp.
|
inlinestatic |
Print std::map of (child,parent) pairs for post-run analysis.
This method print a std::map. Each key is a child, and the value is its parent. The (child,parent0) pairs can be used by the MueLu script ``mueprof.sh" to print a nice hierarchical tree that shows both runtime flow and time for each section.
Definition at line 230 of file MueLu_MutuallyExclusiveTime.hpp.
|
inlineprivate |
Check if 'this' is the head of the stack.
Definition at line 262 of file MueLu_MutuallyExclusiveTime.hpp.
std::string MueLu::MutuallyExclusiveTime< TagName >::name_ |
Name of this mutually exclusive timer.
Definition at line 222 of file MueLu_MutuallyExclusiveTime.hpp.
|
private |
Using an RCP allows to use Teuchos::TimeMonitor to keep track of the timer.
Definition at line 251 of file MueLu_MutuallyExclusiveTime.hpp.
|
private |
Definition at line 252 of file MueLu_MutuallyExclusiveTime.hpp.
|
staticprivate |
Stack of created timers (active or paused timers).
Definition at line 258 of file MueLu_MutuallyExclusiveTime.hpp.