13 #ifndef __MPI_TIMER_H_
14 #define __MPI_TIMER_H_
23 #include <boost/shared_ptr.hpp>
34 void setStart(
const double &wTime);
35 void pause(
const double &wTime);
36 void resume(
const double &wTime);
37 void setStop(
const double &wTime,
bool elapseIsStopMinusStart=
false);
38 double getTiming()
const;
39 const std::string &getName()
const;
41 bool isPaused()
const;
45 void isPaused(
bool paused);
67 std::ostream &getOStream();
69 const std::string &getFileName()
const;
76 std::string m_fileName;
78 bool m_haveWrittenHeader;
79 typedef boost::shared_ptr<std::ofstream> OFStreamPtr;
80 OFStreamPtr m_oFStreamPtr;
91 void start(
const std::string &name);
92 void stop(
const std::string &name,
bool elapseIsStopMinusStart=
false);
93 void pause(
const std::string &name);
94 void resume(
const std::string &name);
95 void zeroise(
const std::string &name);
97 bool timerExists(
const std::string &name)
const;
98 double getTiming(
const std::string &name)
const;
100 void writeHeader(std::ostream &oStream);
101 void appendData(std::ostream &oStream);
102 void appendData(
const std::string &fileName);
106 void createTimer(
const std::string &timerName);
108 MpiWTimer *findTimer(
const std::string &timerName);
109 const MpiWTimer *findTimer(
const std::string &timerName)
const;
111 MpiWTimer &findOrCreateTimer(
const std::string &timerName);
116 typedef std::map<std::string, MpiWTimer> NameMpiWTimerMap;
117 NameMpiWTimerMap m_timerMap;
119 typedef std::map<std::string, TimingDataWriter> FileNameWriterMap;
120 FileNameWriterMap m_fileNameWriterMap;
123 #endif //__MPI_TIMER_H_