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