56 comm_(comm), myOS_(NULL), fileOS_(os), ttype_(tt),
57 typeSelector_(), timers_(), timerMap_(), stopHint_(-1)
62 typeSelector_.reset();
63 typeSelector_.set(ttype_);
73 comm_(comm), myOS_(os), fileOS_(NULL), ttype_(tt),
74 typeSelector_(), timers_(), timerMap_(), stopHint_(-1)
79 typeSelector_.reset();
80 typeSelector_.set(ttype_);
98 if (!typeSelector_[tt])
101 if (stopHint_>0 && timers_[stopHint_]->name() == name){
102 timers_[stopHint_]->stop();
107 std::map<std::string, int>::iterator curr = timerMap_.find(name);
108 if (curr != timerMap_.end()){
109 timers_[curr->second]->stop();
112 RCP<Teuchos::Time> newTimer = Teuchos::TimeMonitor::getNewTimer(name);
114 timerMap_[name] = timers_.size();
115 timers_.push_back(newTimer);
116 std::cerr << comm_->getRank() <<
": warning, stop with no start:"
117 << name.c_str() << std::endl;
123 if (!typeSelector_[tt])
126 std::map<std::string, int>::iterator curr = timerMap_.find(name);
128 if (curr == timerMap_.end()){
129 RCP<Teuchos::Time> newTimer = Teuchos::TimeMonitor::getNewTimer(name);
130 index = timers_.size();
131 timerMap_[name] = index;
132 timers_.push_back(newTimer);
135 index = curr->second;
138 timers_[index]->start();
139 timers_[index]->incrementNumCalls();
146 Teuchos::TimeMonitor::summarize(comm_.ptr(), *fileOS_);
148 Teuchos::TimeMonitor::summarize(comm_.ptr(), *myOS_);
154 Teuchos::TimeMonitor::zeroOutTimers();
Time an algorithm (or other entity) as a whole.
~TimerManager()
Destructor.
TimerType
The type of timers which should be active.
void print() const
Print out global summary, do not reset timers.
Time the substeps of an entity.
TimerManager(const RCP< const Comm< int > > &comm, std::ofstream *of, TimerType tt)
Constructor for output to a file.
Run both MACRO and MICRO timers.
void printAndResetToZero()
Print out global summary of timers and reset timers to zero.
No timing data will be collected (the default).
Declarations for TimerManager.
void stop(TimerType tt, const std::string &name)
Stop the named timer.
void start(TimerType tt, const std::string &name)
Start the named timer.