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 
67  void startModuleEvent(StreamContext const&, ModuleCallingContext const&);
68  void stopModuleEvent(StreamContext const&, ModuleCallingContext const&);
69  void pauseModuleEvent(StreamContext const&, ModuleCallingContext const&);
70  void restartModuleEvent(StreamContext const&, ModuleCallingContext const&);
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 
86  void fillTriggerTimingReport(TriggerTimingReport& rep) const;
87 
88  private:
89  SystemTimeKeeper(const SystemTimeKeeper&) = delete; // stop default
90 
91  const SystemTimeKeeper& operator=(const SystemTimeKeeper&) = delete; // stop default
92 
93  PathTiming& pathTiming(StreamContext const&, PathContext const&);
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
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