CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Timing.h
Go to the documentation of this file.
1 #ifndef Services_TIMING_h
2 #define Services_TIMING_h
3 // -*- C++ -*-
4 //
5 // Package: Services
6 // Class : Timing
7 //
8 // Original Author: Jim Kowalkowski
9 //
10 
13 #include <atomic>
14 
15 namespace edm {
16  class ActivityRegistry;
17  class Event;
18  class EventSetup;
19  class ParameterSet;
21  class StreamContext;
22  class ModuleCallingContext;
23 
24  namespace service {
25  class Timing : public TimingServiceBase {
26  public:
28  ~Timing();
29 
30  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
31 
32  virtual void addToCPUTime(StreamID id, double iTime) override;
33 
34  private:
35 
36  void postBeginJob();
37  void postEndJob();
38 
39  void preEvent(StreamContext const&);
40  void postEvent(StreamContext const&);
41 
42  void preModule(StreamContext const&, ModuleCallingContext const&);
43  void postModule(StreamContext const&, ModuleCallingContext const&);
44 
45  double curr_job_time_; // seconds
46  double curr_job_cpu_; // seconds
47  std::vector<double> curr_events_time_; // seconds
48  std::vector<double> curr_events_cpu_; // seconds
49  std::vector<double> total_events_cpu_; // seconds
52 
53  //
54  // Min Max and average event times for each Stream.
55  // Used for summary at end of job
56  std::vector<double> max_events_time_; // seconds
57  std::vector<double> max_events_cpu_; // seconds
58  std::vector<double> min_events_time_; // seconds
59  std::vector<double> min_events_cpu_; // seconds
60  std::atomic<unsigned long> total_event_count_;
61  };
62  }
63 }
64 
65 #endif
double curr_job_time_
Definition: Timing.h:45
std::vector< double > max_events_time_
Definition: Timing.h:56
bool report_summary_
Definition: Timing.h:51
std::vector< double > curr_events_time_
Definition: Timing.h:47
void postEvent(StreamContext const &)
Definition: Timing.cc:198
double curr_job_cpu_
Definition: Timing.h:46
std::vector< double > curr_events_cpu_
Definition: Timing.h:48
std::vector< double > total_events_cpu_
Definition: Timing.h:49
Timing(ParameterSet const &, ActivityRegistry &)
Definition: Timing.cc:68
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: Timing.cc:113
virtual void addToCPUTime(StreamID id, double iTime) override
Definition: Timing.cc:107
std::atomic< unsigned long > total_event_count_
Definition: Timing.h:60
std::vector< double > max_events_cpu_
Definition: Timing.h:57
std::vector< double > min_events_cpu_
Definition: Timing.h:59
void postModule(StreamContext const &, ModuleCallingContext const &)
Definition: Timing.cc:227
void preEvent(StreamContext const &)
Definition: Timing.cc:192
void preModule(StreamContext const &, ModuleCallingContext const &)
Definition: Timing.cc:222
std::vector< double > min_events_time_
Definition: Timing.h:58