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
31 
32 // forward declarations
33 
34 namespace edm {
35  class ModuleDescription;
36  class StreamID;
37  class StreamContext;
38  class PathContext;
39  class HLTPathStatus;
40  class ModuleCallingContext;
41  class ProcessContext;
42  struct TriggerTimingReport;
43  namespace service {
44  class TriggerNamesService;
45  }
46 
48  public:
49  SystemTimeKeeper(unsigned int iNumStreams,
50  std::vector<const ModuleDescription*> const& iModules,
51  service::TriggerNamesService const& iNameService,
52  ProcessContext const* iProcessContext);
53 
54  SystemTimeKeeper(const SystemTimeKeeper&) = delete;
56 
57  // ---------- const member functions ---------------------
58 
59  // ---------- static member functions --------------------
60 
61  // ---------- member functions ---------------------------
63 
64  void startProcessingLoop();
65  void stopProcessingLoop();
66 
67  void startEvent(StreamID);
68  void stopEvent(StreamContext const&);
69 
70  void startPath(StreamContext const&, PathContext const&);
71  void stopPath(StreamContext const&, PathContext const&, HLTPathStatus const&);
72 
77 
79  double m_realTime = 0.;
80  unsigned int m_timesVisited = 0;
81  };
82  struct PathTiming {
84  std::vector<ModuleInPathTiming> m_moduleTiming;
85  };
86 
87  struct ModuleTiming {
89  unsigned int m_timesRun = 0;
90  };
91 
93 
94  private:
96  bool checkBounds(unsigned int id) const;
97 
98  // ---------- member data --------------------------------
99  std::vector<WallclockTimer> m_streamEventTimer;
100 
101  std::vector<std::vector<PathTiming>> m_streamPathTiming;
102 
103  std::vector<std::vector<ModuleTiming>> m_streamModuleTiming;
104 
105  std::vector<const ModuleDescription*> m_modules;
106  std::vector<std::string> m_pathNames;
107  std::vector<std::vector<std::string>> m_modulesOnPaths;
108 
112 
113  unsigned int m_minModuleID;
114  unsigned int m_endPathOffset;
115  std::atomic<unsigned int> m_numberOfEvents;
116  };
117 } // namespace edm
118 
119 #endif
std::vector< std::vector< std::string > > m_modulesOnPaths
ChildrenCPUTimer m_processingLoopChildrenTimer
void stopEvent(StreamContext const &)
std::atomic< unsigned int > m_numberOfEvents
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
SystemTimeKeeper(unsigned int iNumStreams, std::vector< const ModuleDescription *> const &iModules, service::TriggerNamesService const &iNameService, ProcessContext const *iProcessContext)
void removeModuleIfExists(ModuleDescription const &module)
std::vector< ModuleInPathTiming > m_moduleTiming
std::vector< std::vector< ModuleTiming > > m_streamModuleTiming
SystemTimeKeeper & operator=(const SystemTimeKeeper &)=delete
std::vector< std::string > m_pathNames
std::vector< const ModuleDescription * > m_modules
ProcessContext const * m_processContext
rep
Definition: cuy.py:1189
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
void startPath(StreamContext const &, PathContext const &)
void fillTriggerTimingReport(TriggerTimingReport &rep) const
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
HLT enums.
std::vector< WallclockTimer > m_streamEventTimer
PathTiming & pathTiming(StreamContext const &, PathContext const &)
unsigned int m_endPathOffset
bool checkBounds(unsigned int id) const
std::vector< std::vector< PathTiming > > m_streamPathTiming