CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::service::Timing Class Reference
Inheritance diagram for edm::service::Timing:
edm::TimingServiceBase

Classes

struct  CountAndTime
 

Public Member Functions

void addToCPUTime (double iTime) override
 
double getTotalCPU () const override
 
 Timing (ParameterSet const &, ActivityRegistry &)
 
 ~Timing () override
 
- Public Member Functions inherited from edm::TimingServiceBase
const TimingServiceBaseoperator= (const TimingServiceBase &)=delete
 
 TimingServiceBase ()
 
 TimingServiceBase (const TimingServiceBase &)=delete
 
virtual ~TimingServiceBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::TimingServiceBase
static void jobStarted ()
 
static double jobStartTime ()
 

Private Member Functions

void accumulateTimeBegin (std::atomic< CountAndTime * > &countAndTime, double &accumulatedTime)
 
void accumulateTimeEnd (std::atomic< CountAndTime * > &countAndTime, double &accumulatedTime)
 
void lastPostEvent (double curr_event_time, unsigned int index, StreamContext const &iStream)
 
void postBeginJob ()
 
double postCommon () const
 
void postEndJob ()
 
void postEvent (StreamContext const &)
 
void postGlobalBeginLumi (GlobalContext const &)
 
void postGlobalBeginRun (GlobalContext const &)
 
void postModule (ModuleDescription const &md)
 
void postModuleEvent (StreamContext const &, ModuleCallingContext const &)
 
void postModuleGlobal (GlobalContext const &, ModuleCallingContext const &)
 
void postModuleStream (StreamContext const &, ModuleCallingContext const &)
 
void postOpenFile (std::string const &, bool)
 
void postSourceEvent (StreamID)
 
void postSourceLumi (LuminosityBlockIndex)
 
void postSourceRun (RunIndex)
 
void preBeginJob (PathsAndConsumesOfModulesBase const &, ProcessContext const &)
 
void preEvent (StreamContext const &)
 
void preModule (ModuleDescription const &md)
 
void preModuleGlobal (GlobalContext const &, ModuleCallingContext const &)
 
void preModuleStream (StreamContext const &, ModuleCallingContext const &)
 
void preOpenFile (std::string const &, bool)
 
void preSourceEvent (StreamID)
 
void preSourceLumi (LuminosityBlockIndex)
 
void preSourceRun (RunIndex)
 

Private Attributes

double accumulatedTimeForGet_
 
double accumulatedTimeForLock_
 
std::atomic< unsigned long > begin_lumi_count_
 
std::atomic< unsigned long > begin_run_count_
 
bool configuredInTopLevelProcess_
 
std::atomic< CountAndTime * > countAndTimeForGet_
 
std::atomic< CountAndTime * > countAndTimeForLock_
 
CountAndTime countAndTimeZero_
 
std::vector< std::unique_ptr< std::atomic< unsigned int > > > countSubProcessesPostEvent_
 
std::vector< std::unique_ptr< std::atomic< unsigned int > > > countSubProcessesPreEvent_
 
std::vector< double > curr_events_time_
 
double curr_job_cpu_
 
double curr_job_time_
 
std::atomic< double > extra_job_cpu_
 
std::atomic< double > last_run_cpu_
 
std::atomic< double > last_run_time_
 
std::vector< double > max_events_time_
 
std::vector< double > min_events_time_
 
unsigned int nStreams_
 
unsigned int nSubProcesses_
 
unsigned int nThreads_
 
bool report_summary_
 
std::vector< double > sum_events_time_
 
bool summary_only_
 
double threshold_
 
std::atomic< unsigned long > total_event_count_
 

Detailed Description

Definition at line 46 of file Timing.cc.

Constructor & Destructor Documentation

◆ Timing()

edm::service::Timing::Timing ( ParameterSet const &  iPS,
ActivityRegistry iRegistry 
)

Definition at line 207 of file Timing.cc.

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),
214  summary_only_(iPS.getUntrackedParameter<bool>("summaryOnly")),
215  report_summary_(iPS.getUntrackedParameter<bool>("useJobReport")),
216  threshold_(iPS.getUntrackedParameter<double>("excessiveTimeThreshold")),
221  begin_run_count_(0),
222  countAndTimeZero_{0, 0.0},
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
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&) {
317  last_run_cpu_ = getCPU();
318  });
319  }

◆ ~Timing()

edm::service::Timing::~Timing ( )
override

Definition at line 321 of file Timing.cc.

321 {}

Member Function Documentation

◆ accumulateTimeBegin()

void edm::service::Timing::accumulateTimeBegin ( std::atomic< CountAndTime * > &  countAndTime,
double &  accumulatedTime 
)
private

Definition at line 595 of file Timing.cc.

595  {
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  }

References edm::service::Timing::CountAndTime::count_, countAndTimeZero_, edm::service::getTime(), and edm::service::Timing::CountAndTime::time_.

◆ accumulateTimeEnd()

void edm::service::Timing::accumulateTimeEnd ( std::atomic< CountAndTime * > &  countAndTime,
double &  accumulatedTime 
)
private

Definition at line 618 of file Timing.cc.

618  {
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  }

References edm::service::Timing::CountAndTime::count_, countAndTimeZero_, cppFunctionSkipper::exception, edm::service::getTime(), and edm::service::Timing::CountAndTime::time_.

◆ addToCPUTime()

void edm::service::Timing::addToCPUTime ( double  iTime)
overridevirtual

Extra CPU time used by a job but not seen by cmsRun The value should be in seconds. This function is safe to call from multiple threads

Implements edm::TimingServiceBase.

Definition at line 323 of file Timing.cc.

323  {
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  }

References extra_job_cpu_.

◆ fillDescriptions()

void edm::service::Timing::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 332 of file Timing.cc.

332  {
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  }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and edm::ConfigurationDescriptions::setComment().

◆ getTotalCPU()

double edm::service::Timing::getTotalCPU ( ) const
overridevirtual

CPU time used by this process and all its children. The value returned should be in seconds.

Implements edm::TimingServiceBase.

Definition at line 330 of file Timing.cc.

330 { return getCPU(); }

References edm::service::getCPU().

◆ lastPostEvent()

void edm::service::Timing::lastPostEvent ( double  curr_event_time,
unsigned int  index,
StreamContext const &  iStream 
)
private

Definition at line 504 of file Timing.cc.

504  {
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  }

References edm::StreamContext::eventID(), max_events_time_, min_events_time_, sum_events_time_, summary_only_, and total_event_count_.

Referenced by postEvent().

◆ postBeginJob()

void edm::service::Timing::postBeginJob ( )
private

Definition at line 352 of file Timing.cc.

352  {
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  }

References configuredInTopLevelProcess_, curr_job_cpu_, curr_job_time_, edm::service::getCPU(), edm::service::getTime(), and summary_only_.

◆ postCommon()

double edm::service::Timing::postCommon ( ) const
private

Definition at line 581 of file Timing.cc.

581  {
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  }

References configuredInTopLevelProcess_, edm::service::popStack(), submitPVValidationJobs::t, and threshold_.

Referenced by postModule(), postModuleEvent(), postModuleGlobal(), postModuleStream(), postOpenFile(), postSourceEvent(), postSourceLumi(), and postSourceRun().

◆ postEndJob()

void edm::service::Timing::postEndJob ( )
private

Definition at line 370 of file Timing.cc.

370  {
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  }

References accumulatedTimeForGet_, accumulatedTimeForLock_, begin_lumi_count_, begin_run_count_, configuredInTopLevelProcess_, curr_job_cpu_, curr_job_time_, edm::service::d2str(), extra_job_cpu_, edm::service::getCPU(), edm::service::getTime(), edm::TimingServiceBase::jobStartTime(), last_run_cpu_, last_run_time_, max_events_time_, min_events_time_, nStreams_, nThreads_, report_summary_, sum_events_time_, submitPVValidationJobs::t, total_event_count_, and edm::service::ui2str().

◆ postEvent()

void edm::service::Timing::postEvent ( StreamContext const &  iStream)
private

Definition at line 488 of file Timing.cc.

488  {
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  }

References configuredInTopLevelProcess_, submitPVResolutionJobs::count, countSubProcessesPostEvent_, curr_events_time_, edm::service::getTime(), lastPostEvent(), nSubProcesses_, edm::StreamContext::streamID(), and edm::StreamID::value().

◆ postGlobalBeginLumi()

void edm::service::Timing::postGlobalBeginLumi ( GlobalContext const &  gc)
private

Definition at line 566 of file Timing.cc.

566  {
568  return;
569  }
570  if (!gc.processContext()->isSubProcess()) {
572  }
573  }

References begin_lumi_count_, configuredInTopLevelProcess_, edm::ProcessContext::isSubProcess(), and edm::GlobalContext::processContext().

◆ postGlobalBeginRun()

void edm::service::Timing::postGlobalBeginRun ( GlobalContext const &  gc)
private

Definition at line 557 of file Timing.cc.

557  {
559  return;
560  }
561  if (!gc.processContext()->isSubProcess()) {
563  }
564  }

References begin_run_count_, configuredInTopLevelProcess_, edm::ProcessContext::isSubProcess(), and edm::GlobalContext::processContext().

◆ postModule()

void edm::service::Timing::postModule ( ModuleDescription const &  md)
private

Definition at line 549 of file Timing.cc.

549 { postCommon(); }

References postCommon().

◆ postModuleEvent()

void edm::service::Timing::postModuleEvent ( StreamContext const &  iStream,
ModuleCallingContext const &  iModule 
)
private

Definition at line 518 of file Timing.cc.

518  {
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  }

References configuredInTopLevelProcess_, submitPVResolutionJobs::desc, edm::StreamContext::eventID(), edm::ModuleCallingContext::moduleDescription(), postCommon(), summary_only_, and submitPVValidationJobs::t.

◆ postModuleGlobal()

void edm::service::Timing::postModuleGlobal ( GlobalContext const &  ,
ModuleCallingContext const &  mcc 
)
private

Definition at line 555 of file Timing.cc.

555 { postCommon(); }

References postCommon().

◆ postModuleStream()

void edm::service::Timing::postModuleStream ( StreamContext const &  ,
ModuleCallingContext const &  mcc 
)
private

Definition at line 579 of file Timing.cc.

579 { postCommon(); }

References postCommon().

◆ postOpenFile()

void edm::service::Timing::postOpenFile ( std::string const &  lfn,
bool  b 
)
private

Definition at line 545 of file Timing.cc.

545 { postCommon(); }

References postCommon().

◆ postSourceEvent()

void edm::service::Timing::postSourceEvent ( StreamID  sid)
private

Definition at line 533 of file Timing.cc.

533 { postCommon(); }

References postCommon().

◆ postSourceLumi()

void edm::service::Timing::postSourceLumi ( LuminosityBlockIndex  index)
private

Definition at line 537 of file Timing.cc.

537 { postCommon(); }

References postCommon().

◆ postSourceRun()

void edm::service::Timing::postSourceRun ( RunIndex  index)
private

Definition at line 541 of file Timing.cc.

541 { postCommon(); }

References postCommon().

◆ preBeginJob()

void edm::service::Timing::preBeginJob ( PathsAndConsumesOfModulesBase const &  pathsAndConsumes,
ProcessContext const &  pc 
)
private

Definition at line 344 of file Timing.cc.

344  {
345  if (pc.isSubProcess()) {
346  ++nSubProcesses_;
347  } else {
349  }
350  }

References configuredInTopLevelProcess_, edm::ProcessContext::isSubProcess(), and nSubProcesses_.

◆ preEvent()

void edm::service::Timing::preEvent ( StreamContext const &  iStream)
private

Definition at line 471 of file Timing.cc.

471  {
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  }

References configuredInTopLevelProcess_, submitPVResolutionJobs::count, countSubProcessesPreEvent_, curr_events_time_, edm::service::getTime(), nSubProcesses_, edm::StreamContext::streamID(), and edm::StreamID::value().

◆ preModule()

void edm::service::Timing::preModule ( ModuleDescription const &  md)
private

◆ preModuleGlobal()

void edm::service::Timing::preModuleGlobal ( GlobalContext const &  ,
ModuleCallingContext const &   
)
private

Definition at line 551 of file Timing.cc.

551  {
553  }

References configuredInTopLevelProcess_, and edm::service::pushStack().

◆ preModuleStream()

void edm::service::Timing::preModuleStream ( StreamContext const &  ,
ModuleCallingContext const &   
)
private

Definition at line 575 of file Timing.cc.

575  {
577  }

References configuredInTopLevelProcess_, and edm::service::pushStack().

◆ preOpenFile()

void edm::service::Timing::preOpenFile ( std::string const &  lfn,
bool  b 
)
private

◆ preSourceEvent()

void edm::service::Timing::preSourceEvent ( StreamID  sid)
private

◆ preSourceLumi()

void edm::service::Timing::preSourceLumi ( LuminosityBlockIndex  index)
private

◆ preSourceRun()

void edm::service::Timing::preSourceRun ( RunIndex  index)
private

Member Data Documentation

◆ accumulatedTimeForGet_

double edm::service::Timing::accumulatedTimeForGet_
private

Definition at line 131 of file Timing.cc.

Referenced by postEndJob().

◆ accumulatedTimeForLock_

double edm::service::Timing::accumulatedTimeForLock_
private

Definition at line 128 of file Timing.cc.

Referenced by postEndJob().

◆ begin_lumi_count_

std::atomic<unsigned long> edm::service::Timing::begin_lumi_count_
private

Definition at line 120 of file Timing.cc.

Referenced by postEndJob(), and postGlobalBeginLumi().

◆ begin_run_count_

std::atomic<unsigned long> edm::service::Timing::begin_run_count_
private

Definition at line 121 of file Timing.cc.

Referenced by postEndJob(), and postGlobalBeginRun().

◆ configuredInTopLevelProcess_

bool edm::service::Timing::configuredInTopLevelProcess_
private

◆ countAndTimeForGet_

std::atomic<CountAndTime*> edm::service::Timing::countAndTimeForGet_
private

Definition at line 130 of file Timing.cc.

◆ countAndTimeForLock_

std::atomic<CountAndTime*> edm::service::Timing::countAndTimeForLock_
private

Definition at line 127 of file Timing.cc.

◆ countAndTimeZero_

CountAndTime edm::service::Timing::countAndTimeZero_
private

Definition at line 125 of file Timing.cc.

Referenced by accumulateTimeBegin(), and accumulateTimeEnd().

◆ countSubProcessesPostEvent_

std::vector<std::unique_ptr<std::atomic<unsigned int> > > edm::service::Timing::countSubProcessesPostEvent_
private

Definition at line 134 of file Timing.cc.

Referenced by postEvent().

◆ countSubProcessesPreEvent_

std::vector<std::unique_ptr<std::atomic<unsigned int> > > edm::service::Timing::countSubProcessesPreEvent_
private

Definition at line 133 of file Timing.cc.

Referenced by preEvent().

◆ curr_events_time_

std::vector<double> edm::service::Timing::curr_events_time_
private

Definition at line 109 of file Timing.cc.

Referenced by postEvent(), and preEvent().

◆ curr_job_cpu_

double edm::service::Timing::curr_job_cpu_
private

Definition at line 104 of file Timing.cc.

Referenced by postBeginJob(), and postEndJob().

◆ curr_job_time_

double edm::service::Timing::curr_job_time_
private

Definition at line 103 of file Timing.cc.

Referenced by postBeginJob(), and postEndJob().

◆ extra_job_cpu_

std::atomic<double> edm::service::Timing::extra_job_cpu_
private

Definition at line 105 of file Timing.cc.

Referenced by addToCPUTime(), and postEndJob().

◆ last_run_cpu_

std::atomic<double> edm::service::Timing::last_run_cpu_
private

Definition at line 108 of file Timing.cc.

Referenced by postEndJob().

◆ last_run_time_

std::atomic<double> edm::service::Timing::last_run_time_
private

Definition at line 107 of file Timing.cc.

Referenced by postEndJob().

◆ max_events_time_

std::vector<double> edm::service::Timing::max_events_time_
private

Definition at line 116 of file Timing.cc.

Referenced by lastPostEvent(), and postEndJob().

◆ min_events_time_

std::vector<double> edm::service::Timing::min_events_time_
private

Definition at line 117 of file Timing.cc.

Referenced by lastPostEvent(), and postEndJob().

◆ nStreams_

unsigned int edm::service::Timing::nStreams_
private

Definition at line 122 of file Timing.cc.

Referenced by postEndJob().

◆ nSubProcesses_

unsigned int edm::service::Timing::nSubProcesses_
private

Definition at line 137 of file Timing.cc.

Referenced by postEvent(), preBeginJob(), and preEvent().

◆ nThreads_

unsigned int edm::service::Timing::nThreads_
private

Definition at line 123 of file Timing.cc.

Referenced by postEndJob().

◆ report_summary_

bool edm::service::Timing::report_summary_
private

Definition at line 111 of file Timing.cc.

Referenced by postEndJob().

◆ sum_events_time_

std::vector<double> edm::service::Timing::sum_events_time_
private

Definition at line 118 of file Timing.cc.

Referenced by lastPostEvent(), and postEndJob().

◆ summary_only_

bool edm::service::Timing::summary_only_
private

Definition at line 110 of file Timing.cc.

Referenced by lastPostEvent(), postBeginJob(), and postModuleEvent().

◆ threshold_

double edm::service::Timing::threshold_
private

Definition at line 112 of file Timing.cc.

Referenced by postCommon().

◆ total_event_count_

std::atomic<unsigned long> edm::service::Timing::total_event_count_
private

Definition at line 119 of file Timing.cc.

Referenced by lastPostEvent(), and postEndJob().

edm::service::Timing::countAndTimeForGet_
std::atomic< CountAndTime * > countAndTimeForGet_
Definition: Timing.cc:130
mps_fire.i
i
Definition: mps_fire.py:428
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::service::Timing::preSourceEvent
void preSourceEvent(StreamID)
Definition: Timing.cc:531
edm::service::Timing::preOpenFile
void preOpenFile(std::string const &, bool)
Definition: Timing.cc:543
edm::service::Timing::countSubProcessesPreEvent_
std::vector< std::unique_ptr< std::atomic< unsigned int > > > countSubProcessesPreEvent_
Definition: Timing.cc:133
edm::service::getTime
static double getTime()
Definition: Timing.cc:157
edm::TimingServiceBase::jobStartTime
static double jobStartTime()
Definition: TimingServiceBase.h:47
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
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
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::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
edm::service::popStack
static double popStack()
Definition: Timing.cc:190
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::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::service::Timing::postOpenFile
void postOpenFile(std::string const &, bool)
Definition: Timing.cc:545
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::service::Timing::lastPostEvent
void lastPostEvent(double curr_event_time, unsigned int index, StreamContext const &iStream)
Definition: Timing.cc:504
Service
edm::service::Timing::preSourceLumi
void preSourceLumi(LuminosityBlockIndex)
Definition: Timing.cc:535
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
edm::service::Timing::preEvent
void preEvent(StreamContext const &)
Definition: Timing.cc:471
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::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
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
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
edm::service::Timing::postModuleGlobal
void postModuleGlobal(GlobalContext const &, ModuleCallingContext const &)
Definition: Timing.cc:555
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::service::Timing::postSourceLumi
void postSourceLumi(LuminosityBlockIndex)
Definition: Timing.cc:537
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
edm::service::Timing::preModuleGlobal
void preModuleGlobal(GlobalContext const &, ModuleCallingContext const &)
Definition: Timing.cc:551
edm::service::Timing::threshold_
double threshold_
Definition: Timing.cc:112
ParameterSetDescription
edm::service::Timing::last_run_cpu_
std::atomic< double > last_run_cpu_
Definition: Timing.cc:108
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::curr_job_time_
double curr_job_time_
Definition: Timing.cc:103
edm::service::Timing::report_summary_
bool report_summary_
Definition: Timing.cc:111
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::service::Timing::preSourceRun
void preSourceRun(RunIndex)
Definition: Timing.cc:539
edm::service::Timing::countAndTimeForLock_
std::atomic< CountAndTime * > countAndTimeForLock_
Definition: Timing.cc:127
edm::service::Timing::last_run_time_
std::atomic< double > last_run_time_
Definition: Timing.cc:107