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  SystemTimeKeeper(const SystemTimeKeeper&) = delete;
55 
56  // ---------- const member functions ---------------------
57 
58  // ---------- static member functions --------------------
59 
60  // ---------- member functions ---------------------------
62 
63  void startProcessingLoop();
64  void stopProcessingLoop();
65 
66  void startEvent(StreamID);
67  void stopEvent(StreamContext const&);
68 
69  void startPath(StreamContext const&, PathContext const&);
70  void stopPath(StreamContext const&, PathContext const&, HLTPathStatus const&);
71 
76 
78  double m_realTime = 0.;
79  unsigned int m_timesVisited = 0;
80  };
81  struct PathTiming {
83  std::vector<ModuleInPathTiming> m_moduleTiming;
84  };
85 
86  struct ModuleTiming {
88  unsigned int m_timesRun = 0;
89  };
90 
92 
93  private:
95  bool checkBounds(unsigned int id) const;
96 
97  // ---------- member data --------------------------------
98  std::vector<WallclockTimer> m_streamEventTimer;
99 
100  std::vector<std::vector<PathTiming>> m_streamPathTiming;
101 
102  std::vector<std::vector<ModuleTiming>> m_streamModuleTiming;
103 
104  std::vector<const ModuleDescription*> m_modules;
105  std::vector<std::string> m_pathNames;
106  std::vector<std::vector<std::string>> m_modulesOnPaths;
107 
110 
111  unsigned int m_minModuleID;
112  unsigned int m_endPathOffset;
113  std::atomic<unsigned int> m_numberOfEvents;
114  };
115 } // namespace edm
116 
117 #endif
edm::StreamID
Definition: StreamID.h:30
service
Definition: service.py:1
edm::SystemTimeKeeper::PathTiming
Definition: SystemTimeKeeper.h:81
edm::SystemTimeKeeper::removeModuleIfExists
void removeModuleIfExists(ModuleDescription const &module)
Definition: SystemTimeKeeper.cc:109
edm::SystemTimeKeeper::ModuleTiming::m_timer
WallclockTimer m_timer
Definition: SystemTimeKeeper.h:87
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::SystemTimeKeeper::ModuleInPathTiming::m_realTime
double m_realTime
Definition: SystemTimeKeeper.h:78
edm::SystemTimeKeeper::m_numberOfEvents
std::atomic< unsigned int > m_numberOfEvents
Definition: SystemTimeKeeper.h:113
edm::ProcessContext
Definition: ProcessContext.h:27
edm::SystemTimeKeeper::PathTiming::m_timer
WallclockTimer m_timer
Definition: SystemTimeKeeper.h:82
edm::SystemTimeKeeper::ModuleInPathTiming
Definition: SystemTimeKeeper.h:77
edm::CPUTimer
Definition: CPUTimer.h:37
edm::SystemTimeKeeper::m_pathNames
std::vector< std::string > m_pathNames
Definition: SystemTimeKeeper.h:105
edm::SystemTimeKeeper::PathTiming::m_moduleTiming
std::vector< ModuleInPathTiming > m_moduleTiming
Definition: SystemTimeKeeper.h:83
edm::SystemTimeKeeper::startProcessingLoop
void startProcessingLoop()
Definition: SystemTimeKeeper.cc:205
edm::SystemTimeKeeper::stopProcessingLoop
void stopProcessingLoop()
Definition: SystemTimeKeeper.cc:207
edm::SystemTimeKeeper::operator=
SystemTimeKeeper & operator=(const SystemTimeKeeper &)=delete
edm::SystemTimeKeeper::ModuleTiming::m_timesRun
unsigned int m_timesRun
Definition: SystemTimeKeeper.h:88
edm::SystemTimeKeeper::startModuleEvent
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:165
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::SystemTimeKeeper::m_streamModuleTiming
std::vector< std::vector< ModuleTiming > > m_streamModuleTiming
Definition: SystemTimeKeeper.h:102
edm::SystemTimeKeeper::startEvent
void startEvent(StreamID)
Definition: SystemTimeKeeper.cc:136
edm::StreamContext
Definition: StreamContext.h:31
edm::TriggerTimingReport
Definition: TriggerTimingReport.h:52
edm::SystemTimeKeeper::m_processContext
ProcessContext const * m_processContext
Definition: SystemTimeKeeper.h:109
edm::WallclockTimer
Definition: WallclockTimer.h:37
edm::PathContext
Definition: PathContext.h:24
edm::SystemTimeKeeper::fillTriggerTimingReport
void fillTriggerTimingReport(TriggerTimingReport &rep) const
Definition: SystemTimeKeeper.cc:243
edm::HLTPathStatus
Definition: HLTPathStatus.h:33
edm::SystemTimeKeeper::m_modules
std::vector< const ModuleDescription * > m_modules
Definition: SystemTimeKeeper.h:104
edm::SystemTimeKeeper::m_processingLoopTimer
CPUTimer m_processingLoopTimer
Definition: SystemTimeKeeper.h:108
edm::SystemTimeKeeper::SystemTimeKeeper
SystemTimeKeeper(unsigned int iNumStreams, std::vector< const ModuleDescription * > const &iModules, service::TriggerNamesService const &iNameService, ProcessContext const *iProcessContext)
Definition: SystemTimeKeeper.cc:47
cuy.rep
rep
Definition: cuy.py:1189
edm::SystemTimeKeeper::stopPath
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
Definition: SystemTimeKeeper.cc:152
edm::SystemTimeKeeper::stopModuleEvent
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:172
WallclockTimer.h
callgraph.module
module
Definition: callgraph.py:61
edm::service::TriggerNamesService
Definition: TriggerNamesService.h:42
edm::SystemTimeKeeper::startPath
void startPath(StreamContext const &, PathContext const &)
Definition: SystemTimeKeeper.cc:145
edm::SystemTimeKeeper::m_streamEventTimer
std::vector< WallclockTimer > m_streamEventTimer
Definition: SystemTimeKeeper.h:98
edm::SystemTimeKeeper::pathTiming
PathTiming & pathTiming(StreamContext const &, PathContext const &)
Definition: SystemTimeKeeper.cc:118
edm::SystemTimeKeeper::pauseModuleEvent
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:185
edm::SystemTimeKeeper::checkBounds
bool checkBounds(unsigned int id) const
Definition: SystemTimeKeeper.cc:132
edm::SystemTimeKeeper::m_modulesOnPaths
std::vector< std::vector< std::string > > m_modulesOnPaths
Definition: SystemTimeKeeper.h:106
edm::SystemTimeKeeper::ModuleTiming
Definition: SystemTimeKeeper.h:86
edm::SystemTimeKeeper
Definition: SystemTimeKeeper.h:46
edm::SystemTimeKeeper::m_streamPathTiming
std::vector< std::vector< PathTiming > > m_streamPathTiming
Definition: SystemTimeKeeper.h:100
CPUTimer.h
edm::SystemTimeKeeper::m_endPathOffset
unsigned int m_endPathOffset
Definition: SystemTimeKeeper.h:112
edm::SystemTimeKeeper::stopEvent
void stopEvent(StreamContext const &)
Definition: SystemTimeKeeper.cc:141
edm::SystemTimeKeeper::restartModuleEvent
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:198
edm::SystemTimeKeeper::ModuleInPathTiming::m_timesVisited
unsigned int m_timesVisited
Definition: SystemTimeKeeper.h:79
edm::SystemTimeKeeper::m_minModuleID
unsigned int m_minModuleID
Definition: SystemTimeKeeper.h:111
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29