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
29 
30 // forward declarations
31 
32 namespace edm {
33  class ModuleDescription;
34  class StreamID;
35  class StreamContext;
36  class PathContext;
37  class HLTPathStatus;
38  class ModuleCallingContext;
39  class TriggerTimingReport;
40  namespace service {
41  class TriggersNameService;
42  }
43 
45  {
46 
47  public:
48  SystemTimeKeeper(unsigned int iNumStreams,
49  std::vector<const ModuleDescription*> const& iModules,
50  service::TriggerNamesService const& iNameService);
51 
52  // ---------- const member functions ---------------------
53 
54  // ---------- static member functions --------------------
55 
56  // ---------- member functions ---------------------------
57  void startEvent(StreamID);
58  void stopEvent(StreamContext const&);
59 
60  void startPath(StreamContext const&, PathContext const&);
61  void stopPath(StreamContext const&, PathContext const&, HLTPathStatus const&);
62 
67 
69  double m_realTime = 0.;
70  double m_cpuTime = 0.;
71  unsigned int m_timesVisited = 0;
72  };
73  struct PathTiming {
75  std::vector<ModuleInPathTiming> m_moduleTiming;
76  };
77 
78  struct ModuleTiming {
80  unsigned int m_timesRun =0;
81  };
82 
84  private:
85  SystemTimeKeeper(const SystemTimeKeeper&) = delete; // stop default
86 
87  const SystemTimeKeeper& operator=(const SystemTimeKeeper&) = delete; // stop default
88 
90 
91  // ---------- member data --------------------------------
92  std::vector<CPUTimer> m_streamEventTimer;
93 
94  std::vector<std::vector<PathTiming>> m_streamPathTiming;
95 
96  std::vector<std::vector<ModuleTiming>> m_streamModuleTiming;
97 
98  std::vector<const ModuleDescription*> m_modules;
99  std::vector<std::string> m_pathNames;
100  std::vector<std::vector<std::string>> m_modulesOnPaths;
101 
102  unsigned int m_minModuleID;
103  unsigned int m_endPathOffset;
104  std::atomic<unsigned int> m_numberOfEvents;
105 
106  };
107 }
108 
109 
110 #endif
std::vector< std::vector< std::string > > m_modulesOnPaths
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< CPUTimer > m_streamEventTimer
std::vector< std::string > m_pathNames
const SystemTimeKeeper & operator=(const SystemTimeKeeper &)=delete
void fillTriggerTimingReport(TriggerTimingReport &rep)
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 &)
PathTiming & pathTiming(StreamContext const &, PathContext const &)
unsigned int m_endPathOffset
std::vector< std::vector< PathTiming > > m_streamPathTiming