64 timer_ = Teuchos::TimeMonitor::getNewTimer(
"MueLu: " + msg);
66 timer_ = rcp(
new Teuchos::Time(
"MueLu: " + msg));
71 timer_->incrementNumCalls();
72 #ifdef HAVE_TEUCHOS_ADD_TIME_MONITOR_TO_STACKED_TIMER 73 const auto stackedTimer = Teuchos::TimeMonitor::getStackedTimer();
74 if (nonnull(stackedTimer))
75 stackedTimer->start(
timer_->name());
84 if (
timer_ != Teuchos::null) {
86 #ifdef HAVE_TEUCHOS_ADD_TIME_MONITOR_TO_STACKED_TIMER 88 const auto stackedTimer = Teuchos::TimeMonitor::getStackedTimer();
89 if (nonnull(stackedTimer))
90 stackedTimer->stop(
timer_->name());
92 catch (std::runtime_error&) {
93 std::ostringstream warning;
95 "\n*********************************************************************\n" 96 "WARNING: Overlapping timers detected!\n" 97 "A TimeMonitor timer was stopped before a nested subtimer was\n" 98 "stopped. This is not allowed by the StackedTimer. This corner case\n" 99 "typically occurs if the TimeMonitor is stored in an RCP and the RCP is\n" 100 "assigned to a new timer. To disable this warning, either fix the\n" 101 "ordering of timer creation and destuction or disable the StackedTimer\n";
102 std::cout << warning.str() << std::endl;
103 Teuchos::TimeMonitor::setStackedTimer(Teuchos::null);
void SetVerbLevel(const VerbLevel verbLevel)
Set the verbosity level of this object.
RCP< Teuchos::Time > timer_
Namespace for MueLu classes and methods.
bool IsPrint(MsgType type, int thisProcRankOnly=-1) const
Find out whether we need to print out information for a specific message type.
int SetProcRankVerbose(int procRank) const
Set proc rank used for printing.
int GetProcRankVerbose() const
Get proc rank used for printing. Do not use this information for any other purpose.
Similar to TimeMonitor, but uses MutuallyExclusiveTime objects.
By default, enabled timers appears in the teuchos time monitor summary. Use this option if you do not...
Timers that are enabled (using Timings0/Timings1) will be printed during the execution.
Base class for MueLu classes.
VerbLevel GetVerbLevel() const
Get the verbosity level.