CMS 3D CMS Logo

SystemTimeKeeper.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_SystemTimeKeeper_h
2 #define FWCore_Framework_SystemTimeKeeper_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : SystemTimeKeeper
7 //
17 //
18 // Original Author: Chris Jones
19 // Created: Mon, 07 Jul 2014 14:37:31 GMT
20 //
21 
22 // system include files
23 #include <atomic>
24 #include <vector>
25 #include <string>
26 
27 // user include files
30 
31 // forward declarations
32 
33 namespace edm {
34  class ModuleDescription;
35  class StreamID;
36  class StreamContext;
37  class PathContext;
38  class HLTPathStatus;
39  class ModuleCallingContext;
40  class ProcessContext;
41  struct TriggerTimingReport;
42  namespace service {
43  class TriggerNamesService;
44  }
45 
47  public:
48  SystemTimeKeeper(unsigned int iNumStreams,
49  std::vector<const ModuleDescription*> const& iModules,
50  service::TriggerNamesService const& iNameService,
51  ProcessContext const* iProcessContext);
52 
53  // ---------- const member functions ---------------------
54 
55  // ---------- static member functions --------------------
56 
57  // ---------- member functions ---------------------------
58  void startProcessingLoop();
59  void stopProcessingLoop();
60 
61  void startEvent(StreamID);
62  void stopEvent(StreamContext const&);
63 
64  void startPath(StreamContext const&, PathContext const&);
65  void stopPath(StreamContext const&, PathContext const&, HLTPathStatus const&);
66 
71 
73  double m_realTime = 0.;
74  unsigned int m_timesVisited = 0;
75  };
76  struct PathTiming {
78  std::vector<ModuleInPathTiming> m_moduleTiming;
79  };
80 
81  struct ModuleTiming {
83  unsigned int m_timesRun = 0;
84  };
85 
87 
88  private:
89  SystemTimeKeeper(const SystemTimeKeeper&) = delete; // stop default
90 
91  const SystemTimeKeeper& operator=(const SystemTimeKeeper&) = delete; // stop default
92 
94  bool checkBounds(unsigned int id) const;
95 
96  // ---------- member data --------------------------------
97  std::vector<WallclockTimer> m_streamEventTimer;
98 
99  std::vector<std::vector<PathTiming>> m_streamPathTiming;
100 
101  std::vector<std::vector<ModuleTiming>> m_streamModuleTiming;
102 
103  std::vector<const ModuleDescription*> m_modules;
104  std::vector<std::string> m_pathNames;
105  std::vector<std::vector<std::string>> m_modulesOnPaths;
106 
109 
110  unsigned int m_minModuleID;
111  unsigned int m_endPathOffset;
112  std::atomic<unsigned int> m_numberOfEvents;
113  };
114 } // namespace edm
115 
116 #endif
edm::StreamID
Definition: StreamID.h:30
service
Definition: service.py:1
edm::SystemTimeKeeper::PathTiming
Definition: SystemTimeKeeper.h:76
edm::SystemTimeKeeper::ModuleTiming::m_timer
WallclockTimer m_timer
Definition: SystemTimeKeeper.h:82
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::SystemTimeKeeper::ModuleInPathTiming::m_realTime
double m_realTime
Definition: SystemTimeKeeper.h:73
edm::SystemTimeKeeper::m_numberOfEvents
std::atomic< unsigned int > m_numberOfEvents
Definition: SystemTimeKeeper.h:112
edm::ProcessContext
Definition: ProcessContext.h:27
edm::SystemTimeKeeper::PathTiming::m_timer
WallclockTimer m_timer
Definition: SystemTimeKeeper.h:77
edm::SystemTimeKeeper::ModuleInPathTiming
Definition: SystemTimeKeeper.h:72
edm::CPUTimer
Definition: CPUTimer.h:37
edm::SystemTimeKeeper::m_pathNames
std::vector< std::string > m_pathNames
Definition: SystemTimeKeeper.h:104
edm::SystemTimeKeeper::PathTiming::m_moduleTiming
std::vector< ModuleInPathTiming > m_moduleTiming
Definition: SystemTimeKeeper.h:78
edm::SystemTimeKeeper::startProcessingLoop
void startProcessingLoop()
Definition: SystemTimeKeeper.cc:193
edm::SystemTimeKeeper::stopProcessingLoop
void stopProcessingLoop()
Definition: SystemTimeKeeper.cc:195
edm::SystemTimeKeeper::ModuleTiming::m_timesRun
unsigned int m_timesRun
Definition: SystemTimeKeeper.h:83
edm::SystemTimeKeeper::startModuleEvent
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:153
edm::SystemTimeKeeper::m_streamModuleTiming
std::vector< std::vector< ModuleTiming > > m_streamModuleTiming
Definition: SystemTimeKeeper.h:101
edm::SystemTimeKeeper::startEvent
void startEvent(StreamID)
Definition: SystemTimeKeeper.cc:124
edm::StreamContext
Definition: StreamContext.h:31
edm::SystemTimeKeeper::operator=
const SystemTimeKeeper & operator=(const SystemTimeKeeper &)=delete
edm::TriggerTimingReport
Definition: TriggerTimingReport.h:52
edm::SystemTimeKeeper::m_processContext
ProcessContext const * m_processContext
Definition: SystemTimeKeeper.h:108
edm::WallclockTimer
Definition: WallclockTimer.h:37
edm::PathContext
Definition: PathContext.h:24
edm::SystemTimeKeeper::fillTriggerTimingReport
void fillTriggerTimingReport(TriggerTimingReport &rep) const
Definition: SystemTimeKeeper.cc:231
edm::HLTPathStatus
Definition: HLTPathStatus.h:33
edm::SystemTimeKeeper::m_modules
std::vector< const ModuleDescription * > m_modules
Definition: SystemTimeKeeper.h:103
edm::SystemTimeKeeper::m_processingLoopTimer
CPUTimer m_processingLoopTimer
Definition: SystemTimeKeeper.h:107
edm::SystemTimeKeeper::SystemTimeKeeper
SystemTimeKeeper(unsigned int iNumStreams, std::vector< const ModuleDescription * > const &iModules, service::TriggerNamesService const &iNameService, ProcessContext const *iProcessContext)
Definition: SystemTimeKeeper.cc:41
cuy.rep
rep
Definition: cuy.py:1190
edm::SystemTimeKeeper::stopPath
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
Definition: SystemTimeKeeper.cc:140
edm::SystemTimeKeeper::stopModuleEvent
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:160
WallclockTimer.h
edm::service::TriggerNamesService
Definition: TriggerNamesService.h:42
edm::SystemTimeKeeper::startPath
void startPath(StreamContext const &, PathContext const &)
Definition: SystemTimeKeeper.cc:133
edm::SystemTimeKeeper::m_streamEventTimer
std::vector< WallclockTimer > m_streamEventTimer
Definition: SystemTimeKeeper.h:97
edm::SystemTimeKeeper::pathTiming
PathTiming & pathTiming(StreamContext const &, PathContext const &)
Definition: SystemTimeKeeper.cc:106
edm::SystemTimeKeeper::pauseModuleEvent
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:173
edm::SystemTimeKeeper::checkBounds
bool checkBounds(unsigned int id) const
Definition: SystemTimeKeeper.cc:120
edm::SystemTimeKeeper::m_modulesOnPaths
std::vector< std::vector< std::string > > m_modulesOnPaths
Definition: SystemTimeKeeper.h:105
edm::SystemTimeKeeper::ModuleTiming
Definition: SystemTimeKeeper.h:81
edm::SystemTimeKeeper
Definition: SystemTimeKeeper.h:46
edm::SystemTimeKeeper::m_streamPathTiming
std::vector< std::vector< PathTiming > > m_streamPathTiming
Definition: SystemTimeKeeper.h:99
CPUTimer.h
edm::SystemTimeKeeper::m_endPathOffset
unsigned int m_endPathOffset
Definition: SystemTimeKeeper.h:111
edm::SystemTimeKeeper::stopEvent
void stopEvent(StreamContext const &)
Definition: SystemTimeKeeper.cc:129
edm::SystemTimeKeeper::restartModuleEvent
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:186
edm::SystemTimeKeeper::ModuleInPathTiming::m_timesVisited
unsigned int m_timesVisited
Definition: SystemTimeKeeper.h:74
edm::SystemTimeKeeper::m_minModuleID
unsigned int m_minModuleID
Definition: SystemTimeKeeper.h:110
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29