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" << std::endl;
122 if (!typeSelector_[tt])
125 std::map<std::string, int>::iterator curr = timerMap_.find(name);
127 if (curr == timerMap_.end()){
128 RCP<Teuchos::Time> newTimer = Teuchos::TimeMonitor::getNewTimer(name);
129 index = timers_.size();
130 timerMap_[name] = index;
131 timers_.push_back(newTimer);
134 index = curr->second;
137 timers_[index]->start();
138 timers_[index]->incrementNumCalls();
145 Teuchos::TimeMonitor::summarize(comm_.ptr(), *fileOS_);
147 Teuchos::TimeMonitor::summarize(comm_.ptr(), *myOS_);
153 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.