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  {
48 
49  public:
50  SystemTimeKeeper(unsigned int iNumStreams,
51  std::vector<const ModuleDescription*> const& iModules,
52  service::TriggerNamesService const& iNameService,
53  ProcessContext const* iProcessContext);
54 
55  // ---------- const member functions ---------------------
56 
57  // ---------- static member functions --------------------
58 
59  // ---------- member functions ---------------------------
60  void startProcessingLoop();
61  void stopProcessingLoop();
62 
63  void startEvent(StreamID);
64  void stopEvent(StreamContext const&);
65 
66  void startPath(StreamContext const&, PathContext const&);
67  void stopPath(StreamContext const&, PathContext const&, HLTPathStatus const&);
68 
69  void startModuleEvent(StreamContext const&, ModuleCallingContext const&);
70  void stopModuleEvent(StreamContext const&, ModuleCallingContext const&);
71  void pauseModuleEvent(StreamContext const&, ModuleCallingContext const&);
72  void restartModuleEvent(StreamContext const&, ModuleCallingContext const&);
73 
75  double m_realTime = 0.;
76  unsigned int m_timesVisited = 0;
77  };
78  struct PathTiming {
80  std::vector<ModuleInPathTiming> m_moduleTiming;
81  };
82 
83  struct ModuleTiming {
85  unsigned int m_timesRun =0;
86  };
87 
88  void fillTriggerTimingReport(TriggerTimingReport& rep) const;
89  private:
90  SystemTimeKeeper(const SystemTimeKeeper&) = delete; // stop default
91 
92  const SystemTimeKeeper& operator=(const SystemTimeKeeper&) = delete; // stop default
93 
94  PathTiming& pathTiming(StreamContext const&, PathContext const&);
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  };
116 }
117 
118 
119 #endif
std::vector< std::vector< std::string > > m_modulesOnPaths
std::atomic< unsigned int > m_numberOfEvents
std::vector< ModuleInPathTiming > m_moduleTiming
std::vector< std::vector< ModuleTiming > > m_streamModuleTiming
std::vector< std::string > m_pathNames
std::vector< const ModuleDescription * > m_modules
ProcessContext const * m_processContext
rep
Definition: cuy.py:1190
HLT enums.
std::vector< WallclockTimer > m_streamEventTimer
unsigned int m_endPathOffset
std::vector< std::vector< PathTiming > > m_streamPathTiming