CMS 3D CMS Logo

Timing.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Services
4 // Class : Timing
5 //
6 // Implementation:
7 //
8 // Original Author: Jim Kowalkowski
9 //
10 
12 
26 
27 #include <iostream>
28 #include <sstream>
29 #include <sys/resource.h>
30 #include <sys/time.h>
31 #include <atomic>
32 #include <exception>
33 
34 namespace edm {
35 
36  namespace eventsetup {
37  struct ComponentDescription;
38  class DataKey;
39  class EventSetupRecordKey;
40  }
41 
42  namespace service {
43  class Timing : public TimingServiceBase {
44  public:
46  ~Timing() override;
47 
48  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
49 
50  void addToCPUTime(double iTime) override;
51  double getTotalCPU() const override;
52 
53  private:
54 
55  void postBeginJob();
56  void postEndJob();
57 
58  void preEvent(StreamContext const&);
59  void postEvent(StreamContext const&);
60 
61  void postModuleEvent(StreamContext const&, ModuleCallingContext const&);
62 
63  void preSourceEvent(StreamID);
64  void postSourceEvent(StreamID);
65 
66  void preSourceLumi(LuminosityBlockIndex);
67  void postSourceLumi(LuminosityBlockIndex);
68 
69  void preSourceRun(RunIndex);
70  void postSourceRun(RunIndex);
71 
72  void preOpenFile(std::string const&, bool);
73  void postOpenFile(std::string const&, bool);
74 
75  void preModule(ModuleDescription const& md);
76  void postModule(ModuleDescription const& md);
77 
78  void preModuleGlobal(GlobalContext const&, ModuleCallingContext const&);
79  void postModuleGlobal(GlobalContext const&, ModuleCallingContext const&);
80 
81  void postGlobalBeginRun(GlobalContext const&);
82  void postGlobalBeginLumi(GlobalContext const&);
83 
84  void preModuleStream(StreamContext const&, ModuleCallingContext const&);
85  void postModuleStream(StreamContext const&, ModuleCallingContext const&);
86 
87  double postCommon() const;
88 
89  void preLockEventSetupGet(eventsetup::ComponentDescription const*,
91  eventsetup::DataKey const&);
92 
93  void postLockEventSetupGet(eventsetup::ComponentDescription const*,
95  eventsetup::DataKey const&);
96 
97  void postEventSetupGet(eventsetup::ComponentDescription const*,
99  eventsetup::DataKey const&);
100 
101  struct CountAndTime {
102  public:
103  CountAndTime(unsigned int count, double time) : count_(count), time_(time) { }
104  unsigned int count_;
105  double time_;
106  };
107 
108  void accumulateTimeBegin(std::atomic<CountAndTime*>& countAndTime, double& accumulatedTime);
109  void accumulateTimeEnd(std::atomic<CountAndTime*>& countAndTime, double& accumulatedTime);
110 
111  double curr_job_time_; // seconds
112  double curr_job_cpu_; // seconds
113  std::atomic<double> extra_job_cpu_; //seconds
114  //use last run time for determining end of processing
115  std::atomic<double> last_run_time_;
116  std::atomic<double> last_run_cpu_;
117  std::vector<double> curr_events_time_; // seconds
120  double threshold_;
121  //
122  // Min Max and total event times for each Stream.
123  // Used for summary at end of job
124  std::vector<double> max_events_time_; // seconds
125  std::vector<double> min_events_time_; // seconds
126  std::vector<double> sum_events_time_;
127  std::atomic<unsigned long> total_event_count_;
128  std::atomic<unsigned long> begin_lumi_count_;
129  std::atomic<unsigned long> begin_run_count_;
130  unsigned int nStreams_;
131  unsigned int nThreads_;
132 
134 
135  std::atomic<CountAndTime*> countAndTimeForLock_;
137 
138  std::atomic<CountAndTime*> countAndTimeForGet_;
140  };
141  }
142 }
143 
144 namespace edm {
145  namespace service {
146 
147  static std::string d2str(double d) {
148  std::stringstream t;
149  t << d;
150  return t.str();
151  }
152 
153  static std::string ui2str(unsigned int i) {
154  std::stringstream t;
155  t << i;
156  return t.str();
157  }
158 
159 
160  static double getTime() {
161  struct timeval t;
162  if(gettimeofday(&t, nullptr) < 0)
163  throw cms::Exception("SysCallFailed", "Failed call to gettimeofday");
164  return static_cast<double>(t.tv_sec) + (static_cast<double>(t.tv_usec) * 1E-6);
165  }
166 
167  static double getCPU() {
168  struct rusage usage;
169  getrusage(RUSAGE_SELF, &usage);
170 
171  double totalCPUTime = 0.0;
172  // User code
173  totalCPUTime = (double)usage.ru_utime.tv_sec + (double(usage.ru_utime.tv_usec) * 1E-6);
174  // System functions
175  totalCPUTime += (double)usage.ru_stime.tv_sec + (double(usage.ru_stime.tv_usec) * 1E-6);
176 
177  // Additionally, add in CPU usage from our child processes.
178  getrusage(RUSAGE_CHILDREN, &usage);
179  totalCPUTime += (double)usage.ru_utime.tv_sec + (double(usage.ru_utime.tv_usec) * 1E-6);
180  totalCPUTime += (double)usage.ru_stime.tv_sec + (double(usage.ru_stime.tv_usec) * 1E-6);
181 
182  return totalCPUTime;
183  }
184 
185  //NOTE: We use a per thread stack for module times since unscheduled
186  // exectuion or tbb task spawning can cause a module to run on the
187  // same thread as an already running module
188  static
189  std::vector<double>& moduleTimeStack() {
190  static thread_local std::vector<double> s_stack;
191  return s_stack;
192  }
193 
194  static
195  double popStack() {
196  auto& modStack = moduleTimeStack();
197  assert(!modStack.empty());
198  double curr_module_time = modStack.back();
199  modStack.pop_back();
200  double t = getTime() - curr_module_time;
201  return t;
202  }
203 
204  static
205  void pushStack() {
206  auto& modStack = moduleTimeStack();
207  modStack.push_back(getTime());
208  }
209 
210  Timing::Timing(ParameterSet const& iPS, ActivityRegistry& iRegistry) :
211  curr_job_time_(0.),
212  curr_job_cpu_(0.),
213  extra_job_cpu_(0.0),
214  last_run_time_(0.0),
215  last_run_cpu_(0.0),
216  curr_events_time_(),
217  summary_only_(iPS.getUntrackedParameter<bool>("summaryOnly")),
218  report_summary_(iPS.getUntrackedParameter<bool>("useJobReport")),
219  threshold_(iPS.getUntrackedParameter<double>("excessiveTimeThreshold")),
220  max_events_time_(),
221  min_events_time_(),
222  total_event_count_(0),
223  begin_lumi_count_(0),
224  begin_run_count_(0),
225  countAndTimeZero_{0, 0.0},
226  countAndTimeForLock_{&countAndTimeZero_},
227  accumulatedTimeForLock_{0.0},
228  countAndTimeForGet_{&countAndTimeZero_},
229  accumulatedTimeForGet_{0.0} {
230 
231  iRegistry.watchPostBeginJob(this, &Timing::postBeginJob);
232  iRegistry.watchPostEndJob(this, &Timing::postEndJob);
233 
234  iRegistry.watchPreEvent(this, &Timing::preEvent);
235  iRegistry.watchPostEvent(this, &Timing::postEvent);
236 
237  iRegistry.watchPreLockEventSetupGet(this, &Timing::preLockEventSetupGet);
238  iRegistry.watchPostLockEventSetupGet(this, &Timing::postLockEventSetupGet);
239  iRegistry.watchPostEventSetupGet(this, &Timing::postEventSetupGet);
240 
241  bool checkThreshold = true;
242  if (threshold_ <= 0.0) {
243  //we need to ignore the threshold check
244  threshold_ = std::numeric_limits<double>::max();
245  checkThreshold = false;
246  }
247 
248  if( (not summary_only_) || (checkThreshold) ) {
249  iRegistry.watchPreModuleEvent(this, &Timing::preModuleStream);
250  iRegistry.watchPostModuleEvent(this, &Timing::postModuleEvent);
251  }
252  if(checkThreshold) {
253  iRegistry.watchPreSourceEvent(this, &Timing::preSourceEvent);
254  iRegistry.watchPostSourceEvent(this, &Timing::postSourceEvent);
255 
256  iRegistry.watchPreSourceLumi(this, &Timing::preSourceLumi);
257  iRegistry.watchPostSourceLumi(this, &Timing::postSourceLumi);
258 
259  iRegistry.watchPreSourceRun(this, &Timing::preSourceRun);
260  iRegistry.watchPostSourceRun(this, &Timing::postSourceRun);
261 
262  iRegistry.watchPreOpenFile(this, &Timing::preOpenFile);
263  iRegistry.watchPostOpenFile(this, &Timing::postOpenFile);
264 
265  iRegistry.watchPreEventReadFromSource(this, &Timing::preModuleStream);
266  iRegistry.watchPostEventReadFromSource(this, &Timing::postModuleStream);
267 
268  iRegistry.watchPreModuleConstruction(this, &Timing::preModule);
269  iRegistry.watchPostModuleConstruction(this, &Timing::postModule);
270 
271  iRegistry.watchPreModuleBeginJob(this, &Timing::preModule);
272  iRegistry.watchPostModuleBeginJob(this, &Timing::postModule);
273 
274  iRegistry.watchPreModuleEndJob(this, &Timing::preModule);
275  iRegistry.watchPostModuleEndJob(this, &Timing::postModule);
276 
277  iRegistry.watchPreModuleStreamBeginRun(this, &Timing::preModuleStream);
278  iRegistry.watchPostModuleStreamBeginRun(this, &Timing::postModuleStream);
279  iRegistry.watchPreModuleStreamEndRun(this, &Timing::preModuleStream);
280  iRegistry.watchPostModuleStreamEndRun(this, &Timing::postModuleStream);
281 
282  iRegistry.watchPreModuleStreamBeginLumi(this, &Timing::preModuleStream);
283  iRegistry.watchPostModuleStreamBeginLumi(this, &Timing::postModuleStream);
284  iRegistry.watchPreModuleStreamEndLumi(this, &Timing::preModuleStream);
285  iRegistry.watchPostModuleStreamEndLumi(this, &Timing::postModuleStream);
286 
287  iRegistry.watchPreModuleGlobalBeginRun(this, &Timing::preModuleGlobal);
288  iRegistry.watchPostModuleGlobalBeginRun(this, &Timing::postModuleGlobal);
289  iRegistry.watchPreModuleGlobalEndRun(this, &Timing::preModuleGlobal);
290  iRegistry.watchPostModuleGlobalEndRun(this, &Timing::postModuleGlobal);
291 
292  iRegistry.watchPreModuleGlobalBeginLumi(this, &Timing::preModuleGlobal);
293  iRegistry.watchPostModuleGlobalBeginLumi(this, &Timing::postModuleGlobal);
294  iRegistry.watchPreModuleGlobalEndLumi(this, &Timing::preModuleGlobal);
295  iRegistry.watchPostModuleGlobalEndLumi(this, &Timing::postModuleGlobal);
296 
297  iRegistry.watchPreSourceConstruction(this, &Timing::preModule);
298  iRegistry.watchPostSourceConstruction(this, &Timing::postModule);
299  }
300 
301  iRegistry.watchPostGlobalBeginRun(this, &Timing::postGlobalBeginRun);
302  iRegistry.watchPostGlobalBeginLumi(this, &Timing::postGlobalBeginLumi);
303 
304  iRegistry.preallocateSignal_.connect([this](service::SystemBounds const& iBounds){
305  nStreams_ = iBounds.maxNumberOfStreams();
306  nThreads_ = iBounds.maxNumberOfThreads();
307  curr_events_time_.resize(nStreams_,0.);
308  sum_events_time_.resize(nStreams_,0.);
309  max_events_time_.resize(nStreams_,0.);
310  min_events_time_.resize(nStreams_,1.E6);
311 
312  });
313 
314  iRegistry.postGlobalEndRunSignal_.connect([this](edm::GlobalContext const&) {
315  last_run_time_ = getTime();
316  last_run_cpu_ = getCPU();
317  });
318  }
319 
321  }
322 
323  void Timing::addToCPUTime(double iTime) {
324  //For accounting purposes we effectively can say we started earlier
325  double expected = extra_job_cpu_.load();
326  while( not extra_job_cpu_.compare_exchange_strong(expected,expected+iTime) ) {}
327  }
328 
329  double Timing::getTotalCPU() const {
330  return getCPU();
331  }
332 
335  desc.addUntracked<bool>("summaryOnly", false)->setComment(
336  "If 'true' do not report timing for each event");
337  desc.addUntracked<bool>("useJobReport", true)->setComment(
338  "If 'true' write summary information to JobReport");
339  desc.addUntracked<double>("excessiveTimeThreshold", 0.)->setComment(
340  "Amount of time in seconds before reporting a module or source has taken excessive time. A value of 0.0 turns off this reporting.");
341  descriptions.add("Timing", desc);
342  descriptions.setComment(
343  "This service reports the time it takes to run each module in a job.");
344  }
345 
348  curr_job_cpu_ = getCPU();
349 
350  if(not summary_only_) {
351  LogImportant("TimeReport")
352  << "TimeReport> Report activated" << "\n"
353  << "TimeReport> Report columns headings for events: "
354  << "eventnum runnum timetaken\n"
355  << "TimeReport> Report columns headings for modules: "
356  << "eventnum runnum modulelabel modulename timetakeni\n"
357  << "TimeReport> JobTime=" << curr_job_time_ << " JobCPU=" << curr_job_cpu_ << "\n";
358  }
359  }
360 
362  const double job_end_time =getTime();
363  const double job_end_cpu =getCPU();
364  double total_job_time = job_end_time - jobStartTime();
365 
366  double total_job_cpu = job_end_cpu+extra_job_cpu_;
367 
368  const double total_initialization_time = curr_job_time_ - jobStartTime();
369  const double total_initialization_cpu = curr_job_cpu_;
370 
371  if( 0.0 == jobStartTime()) {
372  //did not capture beginning time
373  total_job_time =job_end_time - curr_job_time_;
374  total_job_cpu =job_end_cpu + extra_job_cpu_ - curr_job_cpu_ ;
375  }
376 
377  double min_event_time = *(std::min_element(min_events_time_.begin(),
378  min_events_time_.end()));
379  double max_event_time = *(std::max_element(max_events_time_.begin(),
380  max_events_time_.end()));
381 
382  auto total_loop_time = last_run_time_ - curr_job_time_;
383  auto total_loop_cpu = last_run_cpu_ + extra_job_cpu_ - curr_job_cpu_;
384 
385  if(last_run_time_ == 0.0) {
386  total_loop_time = 0.0;
387  total_loop_cpu = 0.0;
388  }
389 
390  double sum_all_events_time = 0;
391  for(auto t : sum_events_time_) { sum_all_events_time += t; }
392 
393  double average_event_time = 0.0;
394  if(total_event_count_ != 0) {
395  average_event_time = sum_all_events_time / total_event_count_;
396  }
397 
398  double event_throughput = 0.0;
399  if(total_loop_time != 0.0) {
400  event_throughput = total_event_count_ / total_loop_time;
401  }
402 
403  LogImportant("TimeReport")
404  << "TimeReport> Time report complete in "
405  << total_job_time << " seconds"
406  << "\n"
407  << " Time Summary: \n"
408  << " - Min event: " << min_event_time << "\n"
409  << " - Max event: " << max_event_time << "\n"
410  << " - Avg event: " << average_event_time << "\n"
411  << " - Total loop: " << total_loop_time <<"\n"
412  << " - Total init: " << total_initialization_time <<"\n"
413  << " - Total job: " << total_job_time << "\n"
414  << " - EventSetup Lock: " << accumulatedTimeForLock_ << "\n"
415  << " - EventSetup Get: " << accumulatedTimeForGet_ << "\n"
416  << " Event Throughput: "<< event_throughput <<" ev/s\n"
417  << " CPU Summary: \n"
418  << " - Total loop: " << total_loop_cpu << "\n"
419  << " - Total init: " << total_initialization_cpu <<"\n"
420  << " - Total extra: " << extra_job_cpu_ << "\n"
421  << " - Total job: " << total_job_cpu << "\n"
422  << " Processing Summary: \n"
423  << " - Number of Events: " << total_event_count_ << "\n"
424  << " - Number of Global Begin Lumi Calls: " << begin_lumi_count_ << "\n"
425  << " - Number of Global Begin Run Calls: " << begin_run_count_ << "\n";
426 
427  if(report_summary_) {
428  Service<JobReport> reportSvc;
429  std::map<std::string, std::string> reportData;
430 
431  reportData.insert(std::make_pair("MinEventTime", d2str(min_event_time)));
432  reportData.insert(std::make_pair("MaxEventTime", d2str(max_event_time)));
433  reportData.insert(std::make_pair("AvgEventTime", d2str(average_event_time)));
434  reportData.insert(std::make_pair("EventThroughput", d2str(event_throughput)));
435  reportData.insert(std::make_pair("TotalJobTime", d2str(total_job_time)));
436  reportData.insert(std::make_pair("TotalJobCPU", d2str(total_job_cpu)));
437  reportData.insert(std::make_pair("TotalLoopTime", d2str(total_loop_time)));
438  reportData.insert(std::make_pair("TotalLoopCPU", d2str(total_loop_cpu)));
439  reportData.insert(std::make_pair("TotalInitTime", d2str(total_initialization_time)));
440  reportData.insert(std::make_pair("TotalInitCPU", d2str(total_initialization_cpu)));
441  reportData.insert(std::make_pair("NumberOfStreams",ui2str(nStreams_)));
442  reportData.insert(std::make_pair("NumberOfThreads",ui2str(nThreads_)));
443  reportData.insert(std::make_pair("EventSetup Lock",d2str(accumulatedTimeForLock_)));
444  reportData.insert(std::make_pair("EventSetup Get",d2str(accumulatedTimeForGet_)));
445  reportSvc->reportPerformanceSummary("Timing", reportData);
446 
447  std::map<std::string, std::string> reportData1;
448  reportData1.insert(std::make_pair("NumberEvents", ui2str(total_event_count_)));
449  reportData1.insert(std::make_pair("NumberBeginLumiCalls", ui2str(begin_lumi_count_)));
450  reportData1.insert(std::make_pair("NumberBeginRunCalls", ui2str(begin_run_count_)));
451  reportSvc->reportPerformanceSummary("ProcessingSummary", reportData1);
452  }
453  }
454 
455  void Timing::preEvent(StreamContext const& iStream) {
456  auto index = iStream.streamID().value();
458  }
459 
460  void Timing::postEvent(StreamContext const& iStream) {
461  auto index = iStream.streamID().value();
462 
463  double curr_event_time = getTime() - curr_events_time_[index];
464  sum_events_time_[index] +=curr_event_time;
465 
466  if(not summary_only_) {
467  auto const & eventID = iStream.eventID();
468  LogPrint("TimeEvent")
469  << "TimeEvent> "
470  << eventID.event() << " "
471  << eventID.run() << " "
472  << curr_event_time ;
473  }
474  if(curr_event_time > max_events_time_[index]) max_events_time_[index] = curr_event_time;
475  if(curr_event_time < min_events_time_[index]) min_events_time_[index] = curr_event_time;
477  }
478 
479  void Timing::postModuleEvent(StreamContext const& iStream, ModuleCallingContext const& iModule) {
480  auto const & eventID = iStream.eventID();
481  auto const & desc = *(iModule.moduleDescription());
482  double t = postCommon();
483  if ( not summary_only_) {
484  LogPrint("TimeModule") << "TimeModule> "
485  << eventID.event() << " "
486  << eventID.run() << " "
487  << desc.moduleLabel() << " "
488  << desc.moduleName() << " "
489  << t;
490  }
491  }
492 
494  pushStack();
495  }
496 
498  postCommon();
499  }
500 
502  pushStack();
503  }
504 
506  postCommon();
507  }
508 
510  pushStack();
511  }
512 
514  postCommon();
515  }
516 
517  void Timing::preOpenFile(std::string const& lfn, bool b) {
518  pushStack();
519  }
520 
521  void Timing::postOpenFile(std::string const& lfn, bool b) {
522  postCommon();
523  }
524 
525  void
527  pushStack();
528  }
529 
530  void
532  postCommon();
533  }
534 
535  void
537  pushStack();
538  }
539 
540  void
542  postCommon();
543  }
544 
545  void
548  }
549 
550  void
553  }
554 
555  void
557  pushStack();
558  }
559 
560  void
562  postCommon();
563  }
564 
565  double
567  double t = popStack();
568  if(t > threshold_) {
569  LogError("ExcessiveTime")
570  << "ExcessiveTime: Module used " << t
571  << " seconds of time which exceeds the error threshold configured in the Timing Service of "
572  << threshold_ << " seconds.";
573  }
574  return t;
575  }
576 
577  void
580  eventsetup::DataKey const&) {
581 
583  }
584 
585  void
588  eventsetup::DataKey const&) {
589 
592  }
593 
594  void
597  eventsetup::DataKey const&) {
598 
600  }
601 
602  void
603  Timing::accumulateTimeBegin(std::atomic<CountAndTime*>& countAndTime, double& accumulatedTime) {
604 
605  double newTime = getTime();
606  auto newStat = std::make_unique<CountAndTime>(0, newTime);
607 
608  CountAndTime* oldStat = countAndTime.load();
609  while (oldStat == nullptr ||
610  !countAndTime.compare_exchange_strong(oldStat, nullptr)) {
611  oldStat = countAndTime.load();
612  }
613 
614  newStat->count_ = oldStat->count_ + 1;
615  if (oldStat->count_ != 0) {
616  accumulatedTime += (newTime - oldStat->time_) * oldStat->count_;
617  }
618  countAndTime.store(newStat.release());
619  if (oldStat != &countAndTimeZero_) {
620  delete oldStat;
621  }
622  }
623 
624  void
625  Timing::accumulateTimeEnd(std::atomic<CountAndTime*>& countAndTime, double& accumulatedTime) {
626 
627  double newTime = getTime();
628 
629  CountAndTime* oldStat = countAndTime.load();
630  while (oldStat == nullptr ||
631  !countAndTime.compare_exchange_strong(oldStat, nullptr)) {
632  oldStat = countAndTime.load();
633  }
634 
635  if (oldStat->count_ == 1) {
636  accumulatedTime += newTime - oldStat->time_;
637  countAndTime.store(&countAndTimeZero_);
638  } else {
639  try {
640  auto newStat = std::make_unique<CountAndTime>(oldStat->count_ - 1, newTime);
641  accumulatedTime += (newTime - oldStat->time_) * oldStat->count_;
642  countAndTime.store(newStat.release());
643  } catch (std::exception &) {
644  countAndTime.store(oldStat);
645  throw;
646  }
647  }
648  delete oldStat;
649  }
650  }
651 }
652 
654 
std::vector< double > sum_events_time_
Definition: Timing.cc:126
void setComment(std::string const &value)
double curr_job_time_
Definition: Timing.cc:111
std::atomic< double > last_run_cpu_
Definition: Timing.cc:116
#define DEFINE_FWK_SERVICE_MAKER(concrete, maker)
Definition: ServiceMaker.h:117
std::vector< double > max_events_time_
Definition: Timing.cc:124
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< double > curr_events_time_
Definition: Timing.cc:117
void postLockEventSetupGet(eventsetup::ComponentDescription const *, eventsetup::EventSetupRecordKey const &, eventsetup::DataKey const &)
Definition: Timing.cc:586
double getTotalCPU() const override
Definition: Timing.cc:329
void preModule(ModuleDescription const &md)
Definition: Timing.cc:526
static double getCPU()
Definition: Timing.cc:167
void postEvent(StreamContext const &)
Definition: Timing.cc:460
void preModuleStream(StreamContext const &, ModuleCallingContext const &)
Definition: Timing.cc:556
double curr_job_cpu_
Definition: Timing.cc:112
std::atomic< unsigned long > begin_lumi_count_
Definition: Timing.cc:128
edm::serviceregistry::AllArgsMaker< edm::TimingServiceBase, Timing > TimingMaker
Definition: Timing.cc:655
void accumulateTimeBegin(std::atomic< CountAndTime * > &countAndTime, double &accumulatedTime)
Definition: Timing.cc:603
void preSourceLumi(LuminosityBlockIndex)
Definition: Timing.cc:501
unsigned int nThreads_
Definition: Timing.cc:131
void preOpenFile(std::string const &, bool)
Definition: Timing.cc:517
unsigned int nStreams_
Definition: Timing.cc:130
void preModuleGlobal(GlobalContext const &, ModuleCallingContext const &)
Definition: Timing.cc:536
void postModule(ModuleDescription const &md)
Definition: Timing.cc:531
static void pushStack()
Definition: Timing.cc:205
void postGlobalBeginRun(GlobalContext const &)
Definition: Timing.cc:546
void preSourceRun(RunIndex)
Definition: Timing.cc:509
void postModuleStream(StreamContext const &, ModuleCallingContext const &)
Definition: Timing.cc:561
std::atomic< CountAndTime * > countAndTimeForGet_
Definition: Timing.cc:138
void accumulateTimeEnd(std::atomic< CountAndTime * > &countAndTime, double &accumulatedTime)
Definition: Timing.cc:625
CountAndTime(unsigned int count, double time)
Definition: Timing.cc:103
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ModuleDescription const * moduleDescription() const
void postModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: Timing.cc:479
std::atomic< double > last_run_time_
Definition: Timing.cc:115
void postSourceLumi(LuminosityBlockIndex)
Definition: Timing.cc:505
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: Timing.cc:333
~Timing() override
Definition: Timing.cc:320
std::atomic< CountAndTime * > countAndTimeForLock_
Definition: Timing.cc:135
double accumulatedTimeForLock_
Definition: Timing.cc:136
void preLockEventSetupGet(eventsetup::ComponentDescription const *, eventsetup::EventSetupRecordKey const &, eventsetup::DataKey const &)
Definition: Timing.cc:578
static double jobStartTime()
StreamID const & streamID() const
Definition: StreamContext.h:57
static std::string ui2str(unsigned int i)
Definition: Timing.cc:153
void setComment(std::string const &value)
void postGlobalBeginLumi(GlobalContext const &)
Definition: Timing.cc:551
std::atomic< unsigned long > begin_run_count_
Definition: Timing.cc:129
unsigned int value() const
Definition: StreamID.h:46
void postEventSetupGet(eventsetup::ComponentDescription const *, eventsetup::EventSetupRecordKey const &, eventsetup::DataKey const &)
Definition: Timing.cc:595
std::atomic< unsigned long > total_event_count_
Definition: Timing.cc:127
static std::vector< double > & moduleTimeStack()
Definition: Timing.cc:189
void addToCPUTime(double iTime) override
Definition: Timing.cc:323
double b
Definition: hdecay.h:120
static std::string d2str(double d)
Definition: Timing.cc:147
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double postCommon() const
Definition: Timing.cc:566
void postSourceRun(RunIndex)
Definition: Timing.cc:513
double accumulatedTimeForGet_
Definition: Timing.cc:139
void postModuleGlobal(GlobalContext const &, ModuleCallingContext const &)
Definition: Timing.cc:541
HLT enums.
CountAndTime countAndTimeZero_
Definition: Timing.cc:133
void postOpenFile(std::string const &, bool)
Definition: Timing.cc:521
static double getTime()
Definition: Timing.cc:160
void postSourceEvent(StreamID)
Definition: Timing.cc:497
EventID const & eventID() const
Definition: StreamContext.h:63
std::atomic< double > extra_job_cpu_
Definition: Timing.cc:113
static double popStack()
Definition: Timing.cc:195
void preSourceEvent(StreamID)
Definition: Timing.cc:493
void preEvent(StreamContext const &)
Definition: Timing.cc:455
std::vector< double > min_events_time_
Definition: Timing.cc:125