46 #ifndef MUELU_MUTUALLYEXCLUSIVETIME_HPP 47 #define MUELU_MUTUALLYEXCLUSIVETIME_HPP 54 #include "Teuchos_FancyOStream.hpp" 68 extern std::map<std::string,std::string>
myParent_;
84 template<
class TagName>
106 GetOStream(
Errors) <<
"MutuallyExclusiveTime::~MutuallyExclusiveTime(): Error: destructor called on a paused timer." << std::endl;
233 *fos <<
"Parent Child Map" << std::endl;
234 std::map<std::string, std::string >::const_iterator iter;
236 *fos <<
"Key: " << iter->first <<
" Value: " << iter->second << std::endl;
276 #endif // MUELU_MUTUALLYEXCLUSIVETIME_HPP void TopOfTheStack()
Check if 'this' is the head of the stack.
static std::stack< MutuallyExclusiveTime< TagName > * > timerStack_
Stack of created timers (active or paused timers).
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
static void PrintParentChildPairs()
Print std::map of (child,parent) pairs for post-run analysis.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
~MutuallyExclusiveTime()
Destructor.
Print additional debugging information.
Namespace for MueLu classes and methods.
void start(bool reset=false)
Starts the timer. If a MutuallyExclusiveTime timer is running, it will be stopped.
static RCP< Time > getNewTimer(const std::string &name)
std::map< std::string, std::string > myParent_
double stop()
Stops the timer. The previous MutuallyExclusiveTime that has been paused when this timer was started ...
void start(bool reset=false)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
std::string name_
Name of this mutually exclusive timer.
void incrementNumCalls()
Increment the number of times this timer has been called.
RCP< Teuchos::Time > timer_
Using an RCP allows to use Teuchos::TimeMonitor to keep track of the timer.
static RCP< MutuallyExclusiveTime< TagName > > getNewTimer(const std::string &name)
Return a new MutuallyExclusiveTime that is registered with the Teuchos::TimeMonitor (for timer summar...
basic_FancyOStream & setOutputToRootOnly(const int rootRank)
void pause()
Pause running timer. Used internally by start().
Base class for MueLu classes.
void resume()
Resume paused timer. Used internally by stop(). Timer is not reset.
This class wraps a Teuchos::Time and maintains a mutually exclusive property between wrapped timers...
Exception throws to report errors in the internal logical of the program.
MutuallyExclusiveTime(const std::string &name, bool startFlag=false)
Constructor.
MutuallyExclusiveTime(RCP< Teuchos::Time > timer)