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 ---------------------------
61  void startProcessingLoop();
62  void stopProcessingLoop();
63 
64  void startEvent(StreamID);
65  void stopEvent(StreamContext const&);
66 
67  void startPath(StreamContext const&, PathContext const&);
68  void stopPath(StreamContext const&, PathContext const&, HLTPathStatus const&);
69 
74 
76  double m_realTime = 0.;
77  unsigned int m_timesVisited = 0;
78  };
79  struct PathTiming {
81  std::vector<ModuleInPathTiming> m_moduleTiming;
82  };
83 
84  struct ModuleTiming {
86  unsigned int m_timesRun = 0;
87  };
88 
90 
91  private:
93  bool checkBounds(unsigned int id) const;
94 
95  // ---------- member data --------------------------------
96  std::vector<WallclockTimer> m_streamEventTimer;
97 
98  std::vector<std::vector<PathTiming>> m_streamPathTiming;
99 
100  std::vector<std::vector<ModuleTiming>> m_streamModuleTiming;
101 
102  std::vector<const ModuleDescription*> m_modules;
103  std::vector<std::string> m_pathNames;
104  std::vector<std::vector<std::string>> m_modulesOnPaths;
105 
108 
109  unsigned int m_minModuleID;
110  unsigned int m_endPathOffset;
111  std::atomic<unsigned int> m_numberOfEvents;
112  };
113 } // namespace edm
114 
115 #endif
edm::StreamID
Definition: StreamID.h:30
service
Definition: service.py:1
edm::SystemTimeKeeper::PathTiming
Definition: SystemTimeKeeper.h:79
edm::SystemTimeKeeper::ModuleTiming::m_timer
WallclockTimer m_timer
Definition: SystemTimeKeeper.h:85
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::SystemTimeKeeper::ModuleInPathTiming::m_realTime
double m_realTime
Definition: SystemTimeKeeper.h:76
edm::SystemTimeKeeper::m_numberOfEvents
std::atomic< unsigned int > m_numberOfEvents
Definition: SystemTimeKeeper.h:111
edm::ProcessContext
Definition: ProcessContext.h:27
edm::SystemTimeKeeper::PathTiming::m_timer
WallclockTimer m_timer
Definition: SystemTimeKeeper.h:80
edm::SystemTimeKeeper::ModuleInPathTiming
Definition: SystemTimeKeeper.h:75
edm::CPUTimer
Definition: CPUTimer.h:37
edm::SystemTimeKeeper::m_pathNames
std::vector< std::string > m_pathNames
Definition: SystemTimeKeeper.h:103
edm::SystemTimeKeeper::PathTiming::m_moduleTiming
std::vector< ModuleInPathTiming > m_moduleTiming
Definition: SystemTimeKeeper.h:81
edm::SystemTimeKeeper::startProcessingLoop
void startProcessingLoop()
Definition: SystemTimeKeeper.cc:193
edm::SystemTimeKeeper::stopProcessingLoop
void stopProcessingLoop()
Definition: SystemTimeKeeper.cc:195
edm::SystemTimeKeeper::operator=
SystemTimeKeeper & operator=(const SystemTimeKeeper &)=delete
edm::SystemTimeKeeper::ModuleTiming::m_timesRun
unsigned int m_timesRun
Definition: SystemTimeKeeper.h:86
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:100
edm::SystemTimeKeeper::startEvent
void startEvent(StreamID)
Definition: SystemTimeKeeper.cc:124
edm::StreamContext
Definition: StreamContext.h:31
edm::TriggerTimingReport
Definition: TriggerTimingReport.h:52
edm::SystemTimeKeeper::m_processContext
ProcessContext const * m_processContext
Definition: SystemTimeKeeper.h:107
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:102
edm::SystemTimeKeeper::m_processingLoopTimer
CPUTimer m_processingLoopTimer
Definition: SystemTimeKeeper.h:106
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:96
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:104
edm::SystemTimeKeeper::ModuleTiming
Definition: SystemTimeKeeper.h:84
edm::SystemTimeKeeper
Definition: SystemTimeKeeper.h:46
edm::SystemTimeKeeper::m_streamPathTiming
std::vector< std::vector< PathTiming > > m_streamPathTiming
Definition: SystemTimeKeeper.h:98
CPUTimer.h
edm::SystemTimeKeeper::m_endPathOffset
unsigned int m_endPathOffset
Definition: SystemTimeKeeper.h:110
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:77
edm::SystemTimeKeeper::m_minModuleID
unsigned int m_minModuleID
Definition: SystemTimeKeeper.h:109
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29