CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  struct TriggerTimingReport;
41  namespace service {
42  class TriggersNameService;
43  }
44 
46  {
47 
48  public:
49  SystemTimeKeeper(unsigned int iNumStreams,
50  std::vector<const ModuleDescription*> const& iModules,
51  service::TriggerNamesService const& iNameService);
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 
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 
87  private:
88  SystemTimeKeeper(const SystemTimeKeeper&) = delete; // stop default
89 
90  const SystemTimeKeeper& operator=(const SystemTimeKeeper&) = delete; // stop default
91 
93 
94  // ---------- member data --------------------------------
95  std::vector<WallclockTimer> m_streamEventTimer;
96 
97  std::vector<std::vector<PathTiming>> m_streamPathTiming;
98 
99  std::vector<std::vector<ModuleTiming>> m_streamModuleTiming;
100 
101  std::vector<const ModuleDescription*> m_modules;
102  std::vector<std::string> m_pathNames;
103  std::vector<std::vector<std::string>> m_modulesOnPaths;
104 
106 
107  unsigned int m_minModuleID;
108  unsigned int m_endPathOffset;
109  std::atomic<unsigned int> m_numberOfEvents;
110 
111  };
112 }
113 
114 
115 #endif
std::vector< std::vector< std::string > > m_modulesOnPaths
void fillTriggerTimingReport(TriggerTimingReport &rep) const
string rep
Definition: cuy.py:1188
void stopEvent(StreamContext const &)
std::atomic< unsigned int > m_numberOfEvents
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::vector< ModuleInPathTiming > m_moduleTiming
std::vector< std::vector< ModuleTiming > > m_streamModuleTiming
std::vector< std::string > m_pathNames
const SystemTimeKeeper & operator=(const SystemTimeKeeper &)=delete
std::vector< const ModuleDescription * > m_modules
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
void startPath(StreamContext const &, PathContext const &)
SystemTimeKeeper(unsigned int iNumStreams, std::vector< const ModuleDescription * > const &iModules, service::TriggerNamesService const &iNameService)
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::vector< WallclockTimer > m_streamEventTimer
PathTiming & pathTiming(StreamContext const &, PathContext const &)
unsigned int m_endPathOffset
std::vector< std::vector< PathTiming > > m_streamPathTiming