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