46 #ifndef MUELU_MONITOR_HPP 47 #define MUELU_MONITOR_HPP 52 #include "Teuchos_FancyOStream.hpp" 53 #include "Teuchos_RCPDecl.hpp" 54 #include "Teuchos_RCP.hpp" 55 #include "Teuchos_Utils.hpp" 85 if (object_.IsPrint(msgLevel)) {
87 object_.GetOStream(msgLevel, 0) << msg << std::endl;
88 object_.getOStream()->pushTab();
126 : printMonitor_(object, msg +
" (" + object.description() +
")", msgLevel),
127 timerMonitor_(object, object.ShortClassName() +
": " + msg +
" (total)", timerLevel)
139 : printMonitor_(object, label + msg +
" (" + object.description() +
")", msgLevel),
140 timerMonitor_(object, label + object.ShortClassName() +
": " + msg +
" (total)", timerLevel)
178 : printMonitor_(object, msg, msgLevel),
179 timerMonitor_(object, object.ShortClassName() +
": " + msg +
" (sub, total)", timerLevel)
191 : printMonitor_(object, label + msg, msgLevel),
192 timerMonitor_(object, label + object.ShortClassName() +
": " + msg +
" (sub, total)", timerLevel)
201 #ifdef HAVE_MUELU_PROFILING 202 #define MUELU_TIMER_AS_STRING static_cast<std::ostringstream*>( &(std::ostringstream() << " " << timerIdentifier_++) )->str() 204 #define MUELU_TIMER_AS_STRING 242 :
Monitor(object, msg, msgLevel, timerLevel),
243 timerMonitorExclusive_(object, object.ShortClassName() +
": " + msg, timerLevel)
246 levelTimeMonitor_ = rcp(
new TimeMonitor(
object,
object.ShortClassName() +
": " + msg +
269 levelTimeMonitor_ = rcp(
new TimeMonitor(
object, label+
object.ShortClassName() +
": " + msg +
313 :
SubMonitor(object, msg, msgLevel, timerLevel)
316 levelTimeMonitor_ = rcp(
new TimeMonitor(
object,
object.ShortClassName() +
": " + msg +
333 levelTimeMonitor_ = rcp(
new TimeMonitor(
object, label+
object.ShortClassName() +
": " + msg +
344 #endif // MUELU_MONITOR_HPP RCP< TimeMonitor > levelTimeMonitor_
Total time spent on this level in this object and all children.
High level timing information (use Teuchos::TimeMonitor::summarize() to print)
std::string toString(const T &what)
Little helper function to convert non-string types to strings.
Timer to be used in factories. Similar to Monitor but with additional timers.
Timer to be used in non-factories. Similar to Monitor, but doesn't print object description.
One-liner description of what is happening.
Namespace for MueLu classes and methods.
MutuallyExclusiveTimeMonitor< FactoryBase > timerMonitorExclusive_
Total time spent on all levels in this object only, excluding all children.
Integrates Teuchos::TimeMonitor with MueLu verbosity system.
Print skeleton for the run, i.e. factory calls and used parameters.
int GetLevelID() const
Return level number.
SubFactoryMonitor(const BaseClass &object, const std::string &msg, const Level &level, MsgType msgLevel=Runtime1, MsgType timerLevel=Timings1)
Constructor.
Monitor(const BaseClass &object, const std::string &msg, MsgType msgLevel=Runtime0, MsgType timerLevel=Timings0)
Constructor.
Monitor(const BaseClass &object, const std::string &msg, const std::string &label, MsgType msgLevel=Runtime0, MsgType timerLevel=Timings0)
Constructor.
Class that holds all level-specific information.
RCP< TimeMonitor > levelTimeMonitor_
Total time spent on this level in this object and all its children.
#define MUELU_TIMER_AS_STRING
FactoryMonitor(const BaseClass &object, const std::string &msg, int levelID, MsgType msgLevel=static_cast< MsgType >(Test|Runtime0), MsgType timerLevel=Timings0)
Constructor.
Detailed timing information (use Teuchos::TimeMonitor::summarize() to print)
Timer to be used in factories. Similar to SubMonitor but adds a timer level by level.
Similar to TimeMonitor, but uses MutuallyExclusiveTime objects.
PrintMonitor(const BaseClass &object, const std::string &msg, MsgType msgLevel=Runtime0)
Constructor.
FactoryMonitor(const BaseClass &object, const std::string &msg, const Level &level, MsgType msgLevel=static_cast< MsgType >(Test|Runtime0), MsgType timerLevel=Timings0)
Constructor.
TimeMonitor timerMonitor_
Base class for MueLu classes.
Record timing information level by level. Must be used in combinaison with Timings0/Timings1.
SubFactoryMonitor(const BaseClass &object, const std::string &msg, int levelID, MsgType msgLevel=Runtime1, MsgType timerLevel=Timings1)
Constructor.
Timer to be used in non-factories.
SubMonitor(const BaseClass &object, const std::string &msg, const std::string &label, MsgType msgLevel=Runtime1, MsgType timerLevel=Timings1)
Constructor.
RCP< MutuallyExclusiveTimeMonitor< Level > > levelTimeMonitorExclusive_
Total time spent on this level in this object only, excluding all children.
static int timerIdentifier_
PrintMonitor printMonitor_
Manages printing.
Description of what is happening (more verbose)
const BaseClass & object_
TimeMonitor timerMonitor_
Records total time spent in this object and all its children, over all levels.
PrintMonitor printMonitor_
SubMonitor(const BaseClass &object, const std::string &msg, MsgType msgLevel=Runtime1, MsgType timerLevel=Timings1)
Constructor.