CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::Schedule Class Reference

#include <Schedule.h>

Public Types

typedef std::vector< edm::propagate_const< std::shared_ptr< OutputModuleCommunicator > > > AllOutputModuleCommunicators
 
typedef std::vector< Worker * > AllWorkers
 
typedef std::vector< std::string > vstring
 
typedef std::vector< Worker * > Workers
 

Public Member Functions

AllWorkers const & allWorkers () const
 returns the collection of pointers to workers More...
 
void availablePaths (std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill the labels for all paths in the process More...
 
void beginJob (ProductRegistry const &)
 
void beginStream (unsigned int)
 
bool changeModule (std::string const &iLabel, ParameterSet const &iPSet, const ProductRegistry &iRegistry)
 
void clearCounters ()
 Clear all the counters in the trigger report. More...
 
void closeOutputFiles ()
 
void enableEndPaths (bool active)
 
void endJob (ExceptionCollector &collector)
 
void endPaths (std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill the labels for all end paths in the process More...
 
bool endPathsEnabled () const
 
void endStream (unsigned int)
 
void fillModuleAndConsumesInfo (std::vector< ModuleDescription const * > &allModuleDescriptions, std::vector< std::pair< unsigned int, unsigned int > > &moduleIDToIndex, std::vector< std::vector< ModuleDescription const * > > &modulesWhoseProductsAreConsumedBy, ProductRegistry const &preg) const
 
std::vector< ModuleDescription const * > getAllModuleDescriptions () const
 
void getTriggerReport (TriggerReport &rep) const
 
void getTriggerTimingReport (TriggerTimingReport &rep) const
 
void moduleDescriptionsInEndPath (std::string const &iEndPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
 
void moduleDescriptionsInPath (std::string const &iPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
 
void modulesInPath (std::string const &iPathLabel, std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill in execution order the labels of all modules in path iPathLabel More...
 
void openNewOutputFilesIfNeeded ()
 
void openOutputFiles (FileBlock &fb)
 
void postForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
 
void preForkReleaseResources ()
 
void processOneEventAsync (WaitingTaskHolder iTask, unsigned int iStreamID, EventPrincipal &principal, EventSetup const &eventSetup)
 
template<typename T >
void processOneGlobal (typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
 
template<typename T >
void processOneStream (unsigned int iStreamID, typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
 
void respondToCloseInputFile (FileBlock const &fb)
 
void respondToOpenInputFile (FileBlock const &fb)
 
 Schedule (ParameterSet &proc_pset, service::TriggerNamesService &tns, ProductRegistry &pregistry, BranchIDListHelper &branchIDListHelper, ThinnedAssociationsHelper &thinnedAssociationsHelper, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration > processConfiguration, bool hasSubprocesses, PreallocationConfiguration const &config, ProcessContext const *processContext)
 
bool shouldWeCloseOutput () const
 
bool terminate () const
 Return whether each output module has reached its maximum count. More...
 
int totalEvents () const
 
int totalEventsFailed () const
 
int totalEventsPassed () const
 
void triggerPaths (std::vector< std::string > &oLabelsToFill) const
 
void writeLumi (LuminosityBlockPrincipal const &lbp, ProcessContext const *)
 
void writeRun (RunPrincipal const &rp, ProcessContext const *)
 

Private Member Functions

void limitOutput (ParameterSet const &proc_pset, BranchIDLists const &branchIDLists)
 
std::shared_ptr< ModuleRegistry const > moduleRegistry () const
 
std::shared_ptr< ModuleRegistry > & moduleRegistry ()
 
std::shared_ptr< TriggerResultInserter const > resultsInserter () const
 
std::shared_ptr< TriggerResultInserter > & resultsInserter ()
 

Private Attributes

AllOutputModuleCommunicators all_output_communicators_
 
volatile bool endpathsAreActive_
 
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
 
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
 
PreallocationConfiguration preallocConfig_
 
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
 
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
 
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
 
bool wantSummary_
 

Detailed Description

Definition at line 114 of file Schedule.h.

Member Typedef Documentation

Definition at line 118 of file Schedule.h.

typedef std::vector<Worker*> edm::Schedule::AllWorkers

Definition at line 117 of file Schedule.h.

typedef std::vector<std::string> edm::Schedule::vstring

Definition at line 116 of file Schedule.h.

typedef std::vector<Worker*> edm::Schedule::Workers

Definition at line 120 of file Schedule.h.

Constructor & Destructor Documentation

edm::Schedule::Schedule ( ParameterSet proc_pset,
service::TriggerNamesService tns,
ProductRegistry pregistry,
BranchIDListHelper branchIDListHelper,
ThinnedAssociationsHelper thinnedAssociationsHelper,
ExceptionToActionTable const &  actions,
std::shared_ptr< ActivityRegistry areg,
std::shared_ptr< ProcessConfiguration processConfiguration,
bool  hasSubprocesses,
PreallocationConfiguration const &  config,
ProcessContext const *  processContext 
)

Definition at line 372 of file Schedule.cc.

References actions, all_output_communicators_, allWorkers(), EnergyCorrector::c, popcon2dropbox::copy(), edm::maker::ModuleHolder::createOutputModuleCommunicator(), endpathsAreActive_, edm::service::TriggerNamesService::getTrigPaths(), globalSchedule_, i, limitOutput(), moduleRegistry(), moduleRegistry_, gen::n, edm::SystemTimeKeeper::pauseModuleEvent(), preallocConfig_, edm::PRODUCT_TYPE, edm::SystemTimeKeeper::restartModuleEvent(), resultsInserter(), findQualityFiles::size, edm::SystemTimeKeeper::startEvent(), edm::SystemTimeKeeper::startModuleEvent(), edm::SystemTimeKeeper::startPath(), edm::SystemTimeKeeper::startProcessingLoop(), edm::SystemTimeKeeper::stopEvent(), edm::SystemTimeKeeper::stopModuleEvent(), edm::SystemTimeKeeper::stopPath(), edm::SystemTimeKeeper::stopProcessingLoop(), streamSchedules_, AlCaHLTBitMon_QueryRunRegistry::string, summaryTimeKeeper_, groupFilesInBlocks::temp, create_public_lumi_plots::transform, and wantSummary_.

382  :
383  //Only create a resultsInserter if there is a trigger path
384  resultsInserter_{tns.getTrigPaths().empty()? std::shared_ptr<TriggerResultInserter>{} :makeInserter(proc_pset,prealloc,preg,actions,areg,processConfiguration)},
385  moduleRegistry_(new ModuleRegistry()),
387  preallocConfig_(prealloc),
388  wantSummary_(tns.wantSummary()),
389  endpathsAreActive_(true)
390  {
391  assert(0<prealloc.numberOfStreams());
392  streamSchedules_.reserve(prealloc.numberOfStreams());
393  for(unsigned int i=0; i<prealloc.numberOfStreams();++i) {
394  streamSchedules_.emplace_back(std::make_shared<StreamSchedule>(
395  resultsInserter(),
396  moduleRegistry(),
397  proc_pset,tns,prealloc,preg,
398  branchIDListHelper,actions,
399  areg,processConfiguration,
400  !hasSubprocesses,
401  StreamID{i},
402  processContext));
403  }
404 
405  //TriggerResults are injected automatically by StreamSchedules and are
406  // unknown to the ModuleRegistry
407  const std::string kTriggerResults("TriggerResults");
408  std::vector<std::string> modulesToUse;
409  modulesToUse.reserve(streamSchedules_[0]->allWorkers().size());
410  for(auto const& worker : streamSchedules_[0]->allWorkers()) {
411  if(worker->description().moduleLabel() != kTriggerResults) {
412  modulesToUse.push_back(worker->description().moduleLabel());
413  }
414  }
415  //The unscheduled modules are at the end of the list, but we want them at the front
416  unsigned int n = streamSchedules_[0]->numberOfUnscheduledModules();
417  if(n>0) {
418  std::vector<std::string> temp;
419  temp.reserve(modulesToUse.size());
420  auto itBeginUnscheduled = modulesToUse.begin()+modulesToUse.size()-n;
421  std::copy(itBeginUnscheduled,modulesToUse.end(),
422  std::back_inserter(temp));
423  std::copy(modulesToUse.begin(),itBeginUnscheduled,std::back_inserter(temp));
424  temp.swap(modulesToUse);
425  }
426 
427  // propagate_const<T> has no reset() function
428  globalSchedule_ = std::make_unique<GlobalSchedule>(
429  resultsInserter(),
430  moduleRegistry(),
431  modulesToUse,
432  proc_pset, preg, prealloc,
433  actions,areg,processConfiguration,processContext);
434 
435  //TriggerResults is not in the top level ParameterSet so the call to
436  // reduceParameterSet would fail to find it. Just remove it up front.
437  std::set<std::string> usedModuleLabels;
438  for(auto const& worker: allWorkers()) {
439  if(worker->description().moduleLabel() != kTriggerResults) {
440  usedModuleLabels.insert(worker->description().moduleLabel());
441  }
442  }
443  std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string> >("@all_modules"));
444  std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
445  reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels,
446  outputModulePathPositions);
447  processEDAliases(proc_pset, processConfiguration->processName(), preg);
448  proc_pset.registerIt();
449  processConfiguration->setParameterSetID(proc_pset.id());
450  processConfiguration->setProcessConfigurationID();
451 
452  // This is used for a little sanity-check to make sure no code
453  // modifications alter the number of workers at a later date.
454  size_t all_workers_count = allWorkers().size();
455 
456  moduleRegistry_->forAllModuleHolders([this](maker::ModuleHolder* iHolder){
457  auto comm = iHolder->createOutputModuleCommunicator();
458  if (comm) {
459  all_output_communicators_.emplace_back(std::shared_ptr<OutputModuleCommunicator>{comm.release()});
460  }
461  });
462  // Now that the output workers are filled in, set any output limits or information.
463  limitOutput(proc_pset, branchIDListHelper.branchIDLists());
464 
465  // Sanity check: make sure nobody has added a worker after we've
466  // already relied on the WorkerManager being full.
467  assert (all_workers_count == allWorkers().size());
468 
469  branchIDListHelper.updateFromRegistry(preg);
470 
471  for(auto const& worker : streamSchedules_[0]->allWorkers()) {
472  worker->registerThinnedAssociations(preg, thinnedAssociationsHelper);
473  }
474  thinnedAssociationsHelper.sort();
475 
476  // The output modules consume products in kept branches.
477  // So we must set this up before freezing.
478  for (auto& c : all_output_communicators_) {
479  c->selectProducts(preg, thinnedAssociationsHelper);
480  }
481 
482  {
483  // We now get a collection of types that may be consumed.
484  std::set<TypeID> productTypesConsumed;
485  std::set<TypeID> elementTypesConsumed;
486  // Loop over all modules
487  for (auto const& worker : allWorkers()) {
488  for (auto const& consumesInfo : worker->consumesInfo()) {
489  if (consumesInfo.kindOfType() == PRODUCT_TYPE) {
490  productTypesConsumed.emplace(consumesInfo.type());
491  } else {
492  elementTypesConsumed.emplace(consumesInfo.type());
493  }
494  }
495  }
496  // The SubProcess class is not a module, yet it may consume.
497  if(hasSubprocesses) {
498  productTypesConsumed.emplace(typeid(TriggerResults));
499  }
500  // The RandomNumberGeneratorService is not a module, yet it consumes.
501  {
502  RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed);
503  }
504  preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
505  }
506 
507  for (auto& c : all_output_communicators_) {
508  c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
509  }
510 
511  if(wantSummary_) {
512  std::vector<const ModuleDescription*> modDesc;
513  const auto& workers = allWorkers();
514  modDesc.reserve(workers.size());
515 
516  std::transform(workers.begin(),workers.end(),
517  std::back_inserter(modDesc),
518  [](const Worker* iWorker) -> const ModuleDescription* {
519  return iWorker->descPtr();
520  });
521 
522  // propagate_const<T> has no reset() function
523  summaryTimeKeeper_ = std::make_unique<SystemTimeKeeper>(
524  prealloc.numberOfStreams(),
525  modDesc,
526  tns,
527  processContext);
528  auto timeKeeperPtr = summaryTimeKeeper_.get();
529 
530  areg->watchPreModuleEvent(timeKeeperPtr, &SystemTimeKeeper::startModuleEvent);
531  areg->watchPostModuleEvent(timeKeeperPtr, &SystemTimeKeeper::stopModuleEvent);
532  areg->watchPreModuleEventDelayedGet(timeKeeperPtr, &SystemTimeKeeper::pauseModuleEvent);
533  areg->watchPostModuleEventDelayedGet(timeKeeperPtr,&SystemTimeKeeper::restartModuleEvent);
534 
535  areg->watchPreSourceEvent(timeKeeperPtr, &SystemTimeKeeper::startEvent);
536  areg->watchPostEvent(timeKeeperPtr, &SystemTimeKeeper::stopEvent);
537 
538  areg->watchPrePathEvent(timeKeeperPtr, &SystemTimeKeeper::startPath);
539  areg->watchPostPathEvent(timeKeeperPtr, &SystemTimeKeeper::stopPath);
540 
541  areg->watchPostBeginJob(timeKeeperPtr, &SystemTimeKeeper::startProcessingLoop);
542  areg->watchPreEndJob(timeKeeperPtr, &SystemTimeKeeper::stopProcessingLoop);
543  //areg->preModuleEventSignal_.connect([timeKeeperPtr](StreamContext const& iContext, ModuleCallingContext const& iMod) {
544  //timeKeeperPtr->startModuleEvent(iContext,iMod);
545  //});
546  }
547 
548  } // Schedule::Schedule
size
Write out results.
int i
Definition: DBlmapReader.cc:9
void stopEvent(StreamContext const &)
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1017
roAction_t actions[nactions]
Definition: GenABIO.cc:187
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::shared_ptr< ModuleRegistry const > moduleRegistry() const
Definition: Schedule.h:271
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:283
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:278
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists)
Definition: Schedule.cc:552
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:274
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:275
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:281
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
volatile bool endpathsAreActive_
Definition: Schedule.h:287
std::shared_ptr< TriggerResultInserter const > resultsInserter() const
Definition: Schedule.h:269
void startPath(StreamContext const &, PathContext const &)
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:280
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
bool wantSummary_
Definition: Schedule.h:285

Member Function Documentation

Schedule::AllWorkers const & edm::Schedule::allWorkers ( ) const

returns the collection of pointers to workers

Definition at line 1017 of file Schedule.cc.

References globalSchedule_.

Referenced by changeModule(), edm::PathsAndConsumesOfModules::doConsumesInfo(), fillModuleAndConsumesInfo(), getAllModuleDescriptions(), postForkReacquireResources(), preForkReleaseResources(), respondToCloseInputFile(), respondToOpenInputFile(), and Schedule().

1017  {
1018  return globalSchedule_->allWorkers();
1019  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:278
void edm::Schedule::availablePaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all paths in the process

Definition at line 1022 of file Schedule.cc.

References streamSchedules_.

Referenced by edm::ScheduleInfo::availablePaths().

1022  {
1023  streamSchedules_[0]->availablePaths(oLabelsToFill);
1024  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
void edm::Schedule::beginJob ( ProductRegistry const &  iRegistry)

Definition at line 938 of file Schedule.cc.

References globalSchedule_.

938  {
939  globalSchedule_->beginJob(iRegistry);
940  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:278
void edm::Schedule::beginStream ( unsigned int  iStreamID)

Definition at line 942 of file Schedule.cc.

References streamSchedules_.

942  {
943  assert(iStreamID<streamSchedules_.size());
944  streamSchedules_[iStreamID]->beginStream();
945  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
bool edm::Schedule::changeModule ( std::string const &  iLabel,
ParameterSet const &  iPSet,
const ProductRegistry iRegistry 
)

clone the type of module with label iLabel but configure with iPSet. Returns true if successful.

Definition at line 969 of file Schedule.cc.

References allWorkers(), runEdmFileComparison::found, globalSchedule_, edm::InEvent, edm::InLumi, edm::InRun, moduleRegistry_, preallocConfig_, edm::ProductRegistry::productLookup(), streamSchedules_, and edm::Worker::updateLookup().

971  {
972  Worker* found = nullptr;
973  for (auto const& worker : allWorkers()) {
974  if (worker->description().moduleLabel() == iLabel) {
975  found = worker;
976  break;
977  }
978  }
979  if (nullptr == found) {
980  return false;
981  }
982 
983  auto newMod = moduleRegistry_->replaceModule(iLabel,iPSet,preallocConfig_);
984 
985  globalSchedule_->replaceModule(newMod,iLabel);
986 
987  for(auto& s: streamSchedules_) {
988  s->replaceModule(newMod,iLabel);
989  }
990 
991  {
992  //Need to updateLookup in order to make getByToken work
993  auto const runLookup = iRegistry.productLookup(InRun);
994  auto const lumiLookup = iRegistry.productLookup(InLumi);
995  auto const eventLookup = iRegistry.productLookup(InEvent);
996  found->updateLookup(InRun,*runLookup);
997  found->updateLookup(InLumi,*lumiLookup);
998  found->updateLookup(InEvent,*eventLookup);
999  }
1000 
1001  return true;
1002  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1017
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:278
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:275
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:281
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1148 of file Schedule.cc.

References streamSchedules_.

1148  {
1149  for(auto& s: streamSchedules_) {
1150  s->clearCounters();
1151  }
1152  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
void edm::Schedule::closeOutputFiles ( )

Definition at line 895 of file Schedule.cc.

References all_output_communicators_, edm::OutputModuleCommunicator::closeFile(), and edm::for_all().

895  {
896  using std::placeholders::_1;
898  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:280
void edm::Schedule::enableEndPaths ( bool  active)

Turn end_paths "off" if "active" is false; turn end_paths "on" if "active" is true.

Definition at line 1089 of file Schedule.cc.

References endpathsAreActive_, and streamSchedules_.

1089  {
1090  endpathsAreActive_ = active;
1091  for(auto& s : streamSchedules_) {
1092  s->enableEndPaths(active);
1093  }
1094  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
volatile bool endpathsAreActive_
Definition: Schedule.h:287
void edm::Schedule::endJob ( ExceptionCollector collector)

Definition at line 607 of file Schedule.cc.

References constexpr, edm::EventTimingSummary::cpuTime, edm::TriggerTimingReport::endPathSummaries, edm::TriggerReport::endPathSummaries, edm::TriggerTimingReport::eventSummary, edm::TriggerReport::eventSummary, alignBH_cfg::fixed, getTriggerReport(), getTriggerTimingReport(), globalSchedule_, edm::ExceptionCollector::hasThrown(), hpstanc_transforms::max, mod(), edm::PreallocationConfiguration::numberOfThreads(), AlCaHLTBitMon_ParallelJobs::p, preallocConfig_, edm::EventTimingSummary::realTime, streamSchedules_, edm::EventTimingSummary::sumStreamRealTime, edm::EventTimingSummary::totalEvents, edm::EventSummary::totalEvents, totalEvents(), edm::EventSummary::totalEventsFailed, edm::EventSummary::totalEventsPassed, edm::TriggerTimingReport::trigPathSummaries, edm::TriggerReport::trigPathSummaries, wantSummary_, edm::TriggerTimingReport::workerSummaries, and edm::TriggerReport::workerSummaries.

607  {
608  globalSchedule_->endJob(collector);
609  if (collector.hasThrown()) {
610  return;
611  }
612 
613  if (wantSummary_ == false) return;
614  {
615  TriggerReport tr;
616  getTriggerReport(tr);
617 
618  // The trigger report (pass/fail etc.):
619 
620  LogVerbatim("FwkSummary") << "";
621  if(streamSchedules_[0]->context().processContext()->isSubProcess()) {
622  LogVerbatim("FwkSummary") << "TrigReport Process: "<<streamSchedules_[0]->context().processContext()->processName();
623  }
624  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Event Summary ------------";
625  if(!tr.trigPathSummaries.empty()) {
626  LogVerbatim("FwkSummary") << "TrigReport"
627  << " Events total = " << tr.eventSummary.totalEvents
628  << " passed = " << tr.eventSummary.totalEventsPassed
629  << " failed = " << tr.eventSummary.totalEventsFailed
630  << "";
631  } else {
632  LogVerbatim("FwkSummary") << "TrigReport"
633  << " Events total = " << tr.eventSummary.totalEvents
634  << " passed = " << tr.eventSummary.totalEvents
635  << " failed = 0";
636  }
637 
638  LogVerbatim("FwkSummary") << "";
639  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Path Summary ------------";
640  LogVerbatim("FwkSummary") << "TrigReport "
641  << std::right << std::setw(10) << "Trig Bit#" << " "
642  << std::right << std::setw(10) << "Executed" << " "
643  << std::right << std::setw(10) << "Passed" << " "
644  << std::right << std::setw(10) << "Failed" << " "
645  << std::right << std::setw(10) << "Error" << " "
646  << "Name" << "";
647  for (auto const& p: tr.trigPathSummaries) {
648  LogVerbatim("FwkSummary") << "TrigReport "
649  << std::right << std::setw(5) << 1
650  << std::right << std::setw(5) << p.bitPosition << " "
651  << std::right << std::setw(10) << p.timesRun << " "
652  << std::right << std::setw(10) << p.timesPassed << " "
653  << std::right << std::setw(10) << p.timesFailed << " "
654  << std::right << std::setw(10) << p.timesExcept << " "
655  << p.name << "";
656  }
657 
658  /*
659  std::vector<int>::const_iterator epi = empty_trig_paths_.begin();
660  std::vector<int>::const_iterator epe = empty_trig_paths_.end();
661  std::vector<std::string>::const_iterator epn = empty_trig_path_names_.begin();
662  for (; epi != epe; ++epi, ++epn) {
663 
664  LogVerbatim("FwkSummary") << "TrigReport "
665  << std::right << std::setw(5) << 1
666  << std::right << std::setw(5) << *epi << " "
667  << std::right << std::setw(10) << totalEvents() << " "
668  << std::right << std::setw(10) << totalEvents() << " "
669  << std::right << std::setw(10) << 0 << " "
670  << std::right << std::setw(10) << 0 << " "
671  << *epn << "";
672  }
673  */
674 
675  LogVerbatim("FwkSummary") << "";
676  LogVerbatim("FwkSummary") << "TrigReport " << "-------End-Path Summary ------------";
677  LogVerbatim("FwkSummary") << "TrigReport "
678  << std::right << std::setw(10) << "Trig Bit#" << " "
679  << std::right << std::setw(10) << "Executed" << " "
680  << std::right << std::setw(10) << "Passed" << " "
681  << std::right << std::setw(10) << "Failed" << " "
682  << std::right << std::setw(10) << "Error" << " "
683  << "Name" << "";
684  for (auto const& p: tr.endPathSummaries) {
685  LogVerbatim("FwkSummary") << "TrigReport "
686  << std::right << std::setw(5) << 0
687  << std::right << std::setw(5) << p.bitPosition << " "
688  << std::right << std::setw(10) << p.timesRun << " "
689  << std::right << std::setw(10) << p.timesPassed << " "
690  << std::right << std::setw(10) << p.timesFailed << " "
691  << std::right << std::setw(10) << p.timesExcept << " "
692  << p.name << "";
693  }
694 
695  for (auto const& p: tr.trigPathSummaries) {
696  LogVerbatim("FwkSummary") << "";
697  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Modules in Path: " << p.name << " ------------";
698  LogVerbatim("FwkSummary") << "TrigReport "
699  << std::right << std::setw(10) << "Trig Bit#" << " "
700  << std::right << std::setw(10) << "Visited" << " "
701  << std::right << std::setw(10) << "Passed" << " "
702  << std::right << std::setw(10) << "Failed" << " "
703  << std::right << std::setw(10) << "Error" << " "
704  << "Name" << "";
705 
706  unsigned int bitpos = 0;
707  for (auto const& mod: p.moduleInPathSummaries) {
708  LogVerbatim("FwkSummary") << "TrigReport "
709  << std::right << std::setw(5) << 1
710  << std::right << std::setw(5) << bitpos << " "
711  << std::right << std::setw(10) << mod.timesVisited << " "
712  << std::right << std::setw(10) << mod.timesPassed << " "
713  << std::right << std::setw(10) << mod.timesFailed << " "
714  << std::right << std::setw(10) << mod.timesExcept << " "
715  << mod.moduleLabel << "";
716  ++bitpos;
717  }
718  }
719 
720  for (auto const& p: tr.endPathSummaries) {
721  LogVerbatim("FwkSummary") << "";
722  LogVerbatim("FwkSummary") << "TrigReport " << "------ Modules in End-Path: " << p.name << " ------------";
723  LogVerbatim("FwkSummary") << "TrigReport "
724  << std::right << std::setw(10) << "Trig Bit#" << " "
725  << std::right << std::setw(10) << "Visited" << " "
726  << std::right << std::setw(10) << "Passed" << " "
727  << std::right << std::setw(10) << "Failed" << " "
728  << std::right << std::setw(10) << "Error" << " "
729  << "Name" << "";
730 
731  unsigned int bitpos=0;
732  for (auto const& mod: p.moduleInPathSummaries) {
733  LogVerbatim("FwkSummary") << "TrigReport "
734  << std::right << std::setw(5) << 0
735  << std::right << std::setw(5) << bitpos << " "
736  << std::right << std::setw(10) << mod.timesVisited << " "
737  << std::right << std::setw(10) << mod.timesPassed << " "
738  << std::right << std::setw(10) << mod.timesFailed << " "
739  << std::right << std::setw(10) << mod.timesExcept << " "
740  << mod.moduleLabel << "";
741  ++bitpos;
742  }
743  }
744 
745  LogVerbatim("FwkSummary") << "";
746  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Module Summary ------------";
747  LogVerbatim("FwkSummary") << "TrigReport "
748  << std::right << std::setw(10) << "Visited" << " "
749  << std::right << std::setw(10) << "Executed" << " "
750  << std::right << std::setw(10) << "Passed" << " "
751  << std::right << std::setw(10) << "Failed" << " "
752  << std::right << std::setw(10) << "Error" << " "
753  << "Name" << "";
754  for (auto const& worker : tr.workerSummaries) {
755  LogVerbatim("FwkSummary") << "TrigReport "
756  << std::right << std::setw(10) << worker.timesVisited << " "
757  << std::right << std::setw(10) << worker.timesRun << " "
758  << std::right << std::setw(10) << worker.timesPassed << " "
759  << std::right << std::setw(10) << worker.timesFailed << " "
760  << std::right << std::setw(10) << worker.timesExcept << " "
761  << worker.moduleLabel << "";
762  }
763  LogVerbatim("FwkSummary") << "";
764  }
765  // The timing report (CPU and Real Time):
766  TriggerTimingReport tr;
768 
769  const int totalEvents = std::max(1, tr.eventSummary.totalEvents);
770 
771  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Event Summary ---[sec]----";
772  LogVerbatim("FwkSummary") << "TimeReport"
773  << std::setprecision(6) << std::fixed
774  << " event loop CPU/event = " << tr.eventSummary.cpuTime/totalEvents;
775  LogVerbatim("FwkSummary") << "TimeReport"
776  << std::setprecision(6) << std::fixed
777  << " event loop Real/event = " << tr.eventSummary.realTime/totalEvents;
778  LogVerbatim("FwkSummary") << "TimeReport"
779  << std::setprecision(6) << std::fixed
780  << " sum Streams Real/event = " << tr.eventSummary.sumStreamRealTime/totalEvents;
781  LogVerbatim("FwkSummary") << "TimeReport"
782  << std::setprecision(6) << std::fixed
783  << " efficiency CPU/Real/thread = " << tr.eventSummary.cpuTime/tr.eventSummary.realTime/preallocConfig_.numberOfThreads();
784 
785  constexpr int kColumn1Size = 10;
786  constexpr int kColumn2Size = 12;
787  constexpr int kColumn3Size = 12;
788  LogVerbatim("FwkSummary") << "";
789  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Path Summary ---[Real sec]----";
790  LogVerbatim("FwkSummary") << "TimeReport "
791  << std::right << std::setw(kColumn1Size) << "per event"<<" "
792  << std::right << std::setw(kColumn2Size) << "per exec"
793  << " Name";
794  for (auto const& p: tr.trigPathSummaries) {
795  const int timesRun = std::max(1, p.timesRun);
796  LogVerbatim("FwkSummary") << "TimeReport "
797  << std::setprecision(6) << std::fixed
798  << std::right << std::setw(kColumn1Size) << p.realTime/totalEvents << " "
799  << std::right << std::setw(kColumn2Size) << p.realTime/timesRun << " "
800  << p.name << "";
801  }
802  LogVerbatim("FwkSummary") << "TimeReport "
803  << std::right << std::setw(kColumn1Size) << "per event"<<" "
804  << std::right << std::setw(kColumn2Size) << "per exec"
805  << " Name" << "";
806 
807  LogVerbatim("FwkSummary") << "";
808  LogVerbatim("FwkSummary") << "TimeReport " << "-------End-Path Summary ---[Real sec]----";
809  LogVerbatim("FwkSummary") << "TimeReport "
810  << std::right << std::setw(kColumn1Size) << "per event" <<" "
811  << std::right << std::setw(kColumn2Size) << "per exec"
812  << " Name" << "";
813  for (auto const& p: tr.endPathSummaries) {
814  const int timesRun = std::max(1, p.timesRun);
815 
816  LogVerbatim("FwkSummary") << "TimeReport "
817  << std::setprecision(6) << std::fixed
818  << std::right << std::setw(kColumn1Size) << p.realTime/totalEvents << " "
819  << std::right << std::setw(kColumn2Size) << p.realTime/timesRun << " "
820  << p.name << "";
821  }
822  LogVerbatim("FwkSummary") << "TimeReport "
823  << std::right << std::setw(kColumn1Size) << "per event" <<" "
824  << std::right << std::setw(kColumn2Size) << "per exec"
825  << " Name" << "";
826 
827  for (auto const& p: tr.trigPathSummaries) {
828  LogVerbatim("FwkSummary") << "";
829  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Modules in Path: " << p.name << " ---[Real sec]----";
830  LogVerbatim("FwkSummary") << "TimeReport "
831  << std::right << std::setw(kColumn1Size) << "per event" <<" "
832  << std::right << std::setw(kColumn2Size) << "per visit"
833  << " Name" << "";
834  for (auto const& mod: p.moduleInPathSummaries) {
835  LogVerbatim("FwkSummary") << "TimeReport "
836  << std::setprecision(6) << std::fixed
837  << std::right << std::setw(kColumn1Size) << mod.realTime/totalEvents << " "
838  << std::right << std::setw(kColumn2Size) << mod.realTime/std::max(1, mod.timesVisited) << " "
839  << mod.moduleLabel << "";
840  }
841  }
842  if(not tr.trigPathSummaries.empty()) {
843  LogVerbatim("FwkSummary") << "TimeReport "
844  << std::right << std::setw(kColumn1Size) << "per event" <<" "
845  << std::right << std::setw(kColumn2Size) << "per visit"
846  << " Name" << "";
847  }
848  for (auto const& p: tr.endPathSummaries) {
849  LogVerbatim("FwkSummary") << "";
850  LogVerbatim("FwkSummary") << "TimeReport " << "------ Modules in End-Path: " << p.name << " ---[Real sec]----";
851  LogVerbatim("FwkSummary") << "TimeReport "
852  << std::right << std::setw(kColumn1Size) << "per event" <<" "
853  << std::right << std::setw(kColumn2Size) << "per visit"
854  << " Name" << "";
855  for (auto const& mod: p.moduleInPathSummaries) {
856  LogVerbatim("FwkSummary") << "TimeReport "
857  << std::setprecision(6) << std::fixed
858  << std::right << std::setw(kColumn1Size) << mod.realTime/totalEvents << " "
859  << std::right << std::setw(kColumn2Size) << mod.realTime/std::max(1, mod.timesVisited) << " "
860  << mod.moduleLabel << "";
861  }
862  }
863  if(not tr.endPathSummaries.empty()) {
864  LogVerbatim("FwkSummary") << "TimeReport "
865  << std::right << std::setw(kColumn1Size) << "per event" <<" "
866  << std::right << std::setw(kColumn2Size) << "per visit"
867  << " Name" << "";
868  }
869  LogVerbatim("FwkSummary") << "";
870  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Module Summary ---[Real sec]----";
871  LogVerbatim("FwkSummary") << "TimeReport "
872  << std::right << std::setw(kColumn1Size) << "per event" <<" "
873  << std::right << std::setw(kColumn2Size) << "per exec" <<" "
874  << std::right << std::setw(kColumn3Size) << "per visit"
875  << " Name" << "";
876  for (auto const& worker : tr.workerSummaries) {
877  LogVerbatim("FwkSummary") << "TimeReport "
878  << std::setprecision(6) << std::fixed
879  << std::right << std::setw(kColumn1Size) << worker.realTime/totalEvents << " "
880  << std::right << std::setw(kColumn2Size) << worker.realTime/std::max(1, worker.timesRun) << " "
881  << std::right << std::setw(kColumn3Size) << worker.realTime/std::max(1, worker.timesVisited) << " "
882  << worker.moduleLabel << "";
883  }
884  LogVerbatim("FwkSummary") << "TimeReport "
885  << std::right << std::setw(kColumn1Size) << "per event" <<" "
886  << std::right << std::setw(kColumn2Size) << "per exec" <<" "
887  << std::right << std::setw(kColumn3Size) << "per visit"
888  << " Name" << "";
889 
890  LogVerbatim("FwkSummary") << "";
891  LogVerbatim("FwkSummary") << "T---Report end!" << "";
892  LogVerbatim("FwkSummary") << "";
893  }
#define constexpr
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:278
int totalEvents() const
Definition: Schedule.cc:1120
void getTriggerReport(TriggerReport &rep) const
Definition: Schedule.cc:1102
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:281
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
bool wantSummary_
Definition: Schedule.h:285
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void getTriggerTimingReport(TriggerTimingReport &rep) const
Definition: Schedule.cc:1112
void edm::Schedule::endPaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all end paths in the process

Definition at line 1032 of file Schedule.cc.

References streamSchedules_.

Referenced by edm::PathsAndConsumesOfModules::initialize().

1032  {
1033  streamSchedules_[0]->endPaths(oLabelsToFill);
1034  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
bool edm::Schedule::endPathsEnabled ( ) const

Return true if end_paths are active, and false if they are inactive.

Definition at line 1097 of file Schedule.cc.

References endpathsAreActive_.

1097  {
1098  return endpathsAreActive_;
1099  }
volatile bool endpathsAreActive_
Definition: Schedule.h:287
void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 947 of file Schedule.cc.

References streamSchedules_.

947  {
948  assert(iStreamID<streamSchedules_.size());
949  streamSchedules_[iStreamID]->endStream();
950  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
void edm::Schedule::fillModuleAndConsumesInfo ( std::vector< ModuleDescription const * > &  allModuleDescriptions,
std::vector< std::pair< unsigned int, unsigned int > > &  moduleIDToIndex,
std::vector< std::vector< ModuleDescription const * > > &  modulesWhoseProductsAreConsumedBy,
ProductRegistry const &  preg 
) const

Definition at line 1057 of file Schedule.cc.

References allWorkers(), i, edm::ModuleDescription::id(), edm::ModuleDescription::moduleLabel(), AlCaHLTBitMon_ParallelJobs::p, findQualityFiles::size, and edm::sort_all().

Referenced by edm::PathsAndConsumesOfModules::initialize().

1060  {
1061  allModuleDescriptions.clear();
1062  moduleIDToIndex.clear();
1063  modulesWhoseProductsAreConsumedBy.clear();
1064 
1065  allModuleDescriptions.reserve(allWorkers().size());
1066  moduleIDToIndex.reserve(allWorkers().size());
1067  modulesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1068 
1069  std::map<std::string, ModuleDescription const*> labelToDesc;
1070  unsigned int i = 0;
1071  for (auto const& worker : allWorkers()) {
1072  ModuleDescription const* p = worker->descPtr();
1073  allModuleDescriptions.push_back(p);
1074  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1075  labelToDesc[p->moduleLabel()] = p;
1076  ++i;
1077  }
1078  sort_all(moduleIDToIndex);
1079 
1080  i = 0;
1081  for (auto const& worker : allWorkers()) {
1082  std::vector<ModuleDescription const*>& modules = modulesWhoseProductsAreConsumedBy.at(i);
1083  worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1084  ++i;
1085  }
1086  }
size
Write out results.
int i
Definition: DBlmapReader.cc:9
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1017
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
std::vector< ModuleDescription const * > edm::Schedule::getAllModuleDescriptions ( ) const

Return a vector allowing const access to all the ModuleDescriptions for this Schedule. *** N.B. *** Ownership of the ModuleDescriptions is not *** passed to the caller. Do not call delete on these *** pointers!

Definition at line 1005 of file Schedule.cc.

References allWorkers(), AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and findQualityFiles::size.

Referenced by edm::ScheduleInfo::availableModuleLabels(), and edm::ScheduleInfo::parametersForModule().

1005  {
1006  std::vector<ModuleDescription const*> result;
1007  result.reserve(allWorkers().size());
1008 
1009  for (auto const& worker : allWorkers()) {
1010  ModuleDescription const* p = worker->descPtr();
1011  result.push_back(p);
1012  }
1013  return result;
1014  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1017
void edm::Schedule::getTriggerReport ( TriggerReport rep) const

Return the trigger report information on paths, modules-in-path, modules-in-endpath, and modules.

Definition at line 1102 of file Schedule.cc.

References edm::TriggerReport::eventSummary, streamSchedules_, edm::EventSummary::totalEvents, edm::EventSummary::totalEventsFailed, and edm::EventSummary::totalEventsPassed.

Referenced by endJob().

1102  {
1103  rep.eventSummary.totalEvents = 0;
1104  rep.eventSummary.totalEventsPassed = 0;
1105  rep.eventSummary.totalEventsFailed = 0;
1106  for(auto& s: streamSchedules_) {
1107  s->getTriggerReport(rep);
1108  }
1109  }
rep
Definition: cuy.py:1188
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
void edm::Schedule::getTriggerTimingReport ( TriggerTimingReport rep) const

Return the trigger timing report information on paths, modules-in-path, modules-in-endpath, and modules.

Definition at line 1112 of file Schedule.cc.

References edm::EventTimingSummary::cpuTime, edm::TriggerTimingReport::eventSummary, edm::EventTimingSummary::realTime, summaryTimeKeeper_, and edm::EventTimingSummary::totalEvents.

Referenced by endJob().

1112  {
1113  rep.eventSummary.totalEvents = 0;
1114  rep.eventSummary.cpuTime = 0.;
1115  rep.eventSummary.realTime = 0.;
1116  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1117  }
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:283
rep
Definition: cuy.py:1188
void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists 
)
private

Definition at line 552 of file Schedule.cc.

References all_output_communicators_, EnergyCorrector::c, edm::errors::Configuration, edm::ParameterSet::empty(), Exception, edm::ParameterSet::getParameterNamesForType(), edm::ParameterSet::getParameterSetNames(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), edm::OutputModuleDescription::maxEvents_, convertSQLitetoXML_cfg::output, edm::search_all(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by Schedule().

552  {
553  std::string const output("output");
554 
555  ParameterSet const& maxEventsPSet = proc_pset.getUntrackedParameterSet("maxEvents", ParameterSet());
556  int maxEventSpecs = 0;
557  int maxEventsOut = -1;
558  ParameterSet const* vMaxEventsOut = 0;
559  std::vector<std::string> intNamesE = maxEventsPSet.getParameterNamesForType<int>(false);
560  if (search_all(intNamesE, output)) {
561  maxEventsOut = maxEventsPSet.getUntrackedParameter<int>(output);
562  ++maxEventSpecs;
563  }
564  std::vector<std::string> psetNamesE;
565  maxEventsPSet.getParameterSetNames(psetNamesE, false);
566  if (search_all(psetNamesE, output)) {
567  vMaxEventsOut = &maxEventsPSet.getUntrackedParameterSet(output);
568  ++maxEventSpecs;
569  }
570 
571  if (maxEventSpecs > 1) {
573  "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
574  }
575 
576  for (auto& c : all_output_communicators_) {
577  OutputModuleDescription desc(branchIDLists, maxEventsOut);
578  if (vMaxEventsOut != 0 && !vMaxEventsOut->empty()) {
579  std::string const& moduleLabel = c->description().moduleLabel();
580  try {
581  desc.maxEvents_ = vMaxEventsOut->getUntrackedParameter<int>(moduleLabel);
582  } catch (Exception const&) {
584  "\nNo entry in 'maxEvents' for output module label '" << moduleLabel << "'.\n";
585  }
586  }
587  c->configure(desc);
588  }
589  }
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:46
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:280
void edm::Schedule::moduleDescriptionsInEndPath ( std::string const &  iEndPathLabel,
std::vector< ModuleDescription const * > &  descriptions,
unsigned int  hint 
) const

adds the ModuleDescriptions into the vector for the modules scheduled in path iEndPathLabel hint is a performance optimization if you might know the position of the module in the path

Definition at line 1050 of file Schedule.cc.

References streamSchedules_.

Referenced by edm::PathsAndConsumesOfModules::initialize().

1052  {
1053  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1054  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
void edm::Schedule::moduleDescriptionsInPath ( std::string const &  iPathLabel,
std::vector< ModuleDescription const * > &  descriptions,
unsigned int  hint 
) const

adds the ModuleDescriptions into the vector for the modules scheduled in path iPathLabel hint is a performance optimization if you might know the position of the module in the path

Definition at line 1043 of file Schedule.cc.

References streamSchedules_.

Referenced by edm::PathsAndConsumesOfModules::initialize().

1045  {
1046  streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1047  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
std::shared_ptr<ModuleRegistry const> edm::Schedule::moduleRegistry ( ) const
inlineprivate

Definition at line 271 of file Schedule.h.

References edm::get_underlying_safe().

Referenced by Schedule().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:275
std::shared_ptr<ModuleRegistry>& edm::Schedule::moduleRegistry ( )
inlineprivate

Definition at line 272 of file Schedule.h.

References edm::get_underlying_safe().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:275
void edm::Schedule::modulesInPath ( std::string const &  iPathLabel,
std::vector< std::string > &  oLabelsToFill 
) const

adds to oLabelsToFill in execution order the labels of all modules in path iPathLabel

Definition at line 1037 of file Schedule.cc.

References streamSchedules_.

Referenced by edm::ScheduleInfo::modulesInPath().

1038  {
1039  streamSchedules_[0]->modulesInPath(iPathLabel,oLabelsToFill);
1040  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
void edm::Schedule::openNewOutputFilesIfNeeded ( )

Definition at line 900 of file Schedule.cc.

References all_output_communicators_, edm::for_all(), and edm::OutputModuleCommunicator::openNewFileIfNeeded().

900  {
901  using std::placeholders::_1;
903  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
virtual void openNewFileIfNeeded()=0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:280
void edm::Schedule::openOutputFiles ( FileBlock fb)

Definition at line 905 of file Schedule.cc.

References all_output_communicators_, edm::for_all(), and edm::OutputModuleCommunicator::openFile().

905  {
906  using std::placeholders::_1;
908  }
virtual void openFile(FileBlock const &fb)=0
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:280
void edm::Schedule::postForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)

Definition at line 964 of file Schedule.cc.

References allWorkers(), edm::for_all(), and edm::Worker::postForkReacquireResources().

964  {
965  using std::placeholders::_1;
966  for_all(allWorkers(), std::bind(&Worker::postForkReacquireResources, _1, iChildIndex, iNumberOfChildren));
967  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1017
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
Definition: Worker.h:110
void edm::Schedule::preForkReleaseResources ( )

Definition at line 960 of file Schedule.cc.

References allWorkers(), edm::for_all(), and edm::Worker::preForkReleaseResources().

960  {
961  using std::placeholders::_1;
963  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1017
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void preForkReleaseResources()
Definition: Worker.h:109
void edm::Schedule::processOneEventAsync ( WaitingTaskHolder  iTask,
unsigned int  iStreamID,
EventPrincipal principal,
EventSetup const &  eventSetup 
)

Definition at line 952 of file Schedule.cc.

References eostools::move(), and streamSchedules_.

955  {
956  assert(iStreamID<streamSchedules_.size());
957  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask),ep,es);
958  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
def move(src, dest)
Definition: eostools.py:510
template<typename T >
void edm::Schedule::processOneGlobal ( typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 301 of file Schedule.h.

303  {
304  globalSchedule_->processOneGlobal<T>(ep,es,cleaningUpAfterException);
305  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:278
long double T
template<typename T >
void edm::Schedule::processOneStream ( unsigned int  iStreamID,
typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 292 of file Schedule.h.

295  {
296  assert(iStreamID<streamSchedules_.size());
297  streamSchedules_[iStreamID]->processOneStream<T>(ep,es,cleaningUpAfterException);
298  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
long double T
void edm::Schedule::respondToCloseInputFile ( FileBlock const &  fb)

Definition at line 933 of file Schedule.cc.

References allWorkers(), edm::for_all(), and edm::Worker::respondToCloseInputFile().

933  {
934  using std::placeholders::_1;
935  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
936  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1017
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:107
void edm::Schedule::respondToOpenInputFile ( FileBlock const &  fb)

Definition at line 928 of file Schedule.cc.

References allWorkers(), edm::for_all(), and edm::Worker::respondToOpenInputFile().

928  {
929  using std::placeholders::_1;
930  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
931  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1017
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:106
std::shared_ptr<TriggerResultInserter const> edm::Schedule::resultsInserter ( ) const
inlineprivate

Definition at line 269 of file Schedule.h.

References edm::get_underlying_safe().

Referenced by Schedule().

edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:274
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr<TriggerResultInserter>& edm::Schedule::resultsInserter ( )
inlineprivate

Definition at line 270 of file Schedule.h.

References edm::get_underlying_safe().

edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:274
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
bool edm::Schedule::shouldWeCloseOutput ( ) const

Definition at line 920 of file Schedule.cc.

References all_output_communicators_, and edm::OutputModuleCommunicator::shouldWeCloseFile().

920  {
921  using std::placeholders::_1;
922  // Return true iff at least one output module returns true.
923  return (std::find_if (all_output_communicators_.begin(), all_output_communicators_.end(),
925  != all_output_communicators_.end());
926  }
virtual bool shouldWeCloseFile() const =0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:280
bool edm::Schedule::terminate ( void  ) const

Return whether each output module has reached its maximum count.

Definition at line 591 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

591  {
592  if (all_output_communicators_.empty()) {
593  return false;
594  }
595  for (auto& c : all_output_communicators_) {
596  if (!c->limitReached()) {
597  // Found an output module that has not reached output event count.
598  return false;
599  }
600  }
601  LogInfo("SuccessfulTermination")
602  << "The job is terminating successfully because each output module\n"
603  << "has reached its configured limit.\n";
604  return true;
605  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:280
int edm::Schedule::totalEvents ( ) const

Return the number of events this Schedule has tried to process (inclues both successes and failures, including failures due to exceptions during processing).

Definition at line 1120 of file Schedule.cc.

References streamSchedules_.

Referenced by endJob().

1120  {
1121  int returnValue = 0;
1122  for(auto& s: streamSchedules_) {
1123  returnValue += s->totalEvents();
1124  }
1125  return returnValue;
1126  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
int edm::Schedule::totalEventsFailed ( ) const

Return the number of events that have not passed any trigger. (N.B. totalEventsFailed() + totalEventsPassed() == totalEvents()

Definition at line 1138 of file Schedule.cc.

References streamSchedules_.

1138  {
1139  int returnValue = 0;
1140  for(auto& s: streamSchedules_) {
1141  returnValue += s->totalEventsFailed();
1142  }
1143  return returnValue;
1144  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
int edm::Schedule::totalEventsPassed ( ) const

Return the number of events which have been passed by one or more trigger paths.

Definition at line 1129 of file Schedule.cc.

References streamSchedules_.

1129  {
1130  int returnValue = 0;
1131  for(auto& s: streamSchedules_) {
1132  returnValue += s->totalEventsPassed();
1133  }
1134  return returnValue;
1135  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
void edm::Schedule::triggerPaths ( std::vector< std::string > &  oLabelsToFill) const

Adds to oLabelsToFill the labels for all trigger paths in the process. This is different from availablePaths because it includes the empty paths to match the entries in TriggerResults exactly.

Definition at line 1027 of file Schedule.cc.

References streamSchedules_.

Referenced by edm::PathsAndConsumesOfModules::initialize().

1027  {
1028  streamSchedules_[0]->triggerPaths(oLabelsToFill);
1029  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:276
void edm::Schedule::writeLumi ( LuminosityBlockPrincipal const &  lbp,
ProcessContext const *  processContext 
)

Definition at line 915 of file Schedule.cc.

References all_output_communicators_, edm::for_all(), and edm::OutputModuleCommunicator::writeLumi().

915  {
916  using std::placeholders::_1;
917  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::writeLumi, _1, std::cref(lbp), processContext));
918  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
virtual void writeLumi(LuminosityBlockPrincipal const &lbp, ProcessContext const *)=0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:280
void edm::Schedule::writeRun ( RunPrincipal const &  rp,
ProcessContext const *  processContext 
)

Definition at line 910 of file Schedule.cc.

References all_output_communicators_, edm::for_all(), and edm::OutputModuleCommunicator::writeRun().

910  {
911  using std::placeholders::_1;
912  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::writeRun, _1, std::cref(rp), processContext));
913  }
virtual void writeRun(RunPrincipal const &rp, ProcessContext const *)=0
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:280

Member Data Documentation

AllOutputModuleCommunicators edm::Schedule::all_output_communicators_
private
volatile bool edm::Schedule::endpathsAreActive_
private

Definition at line 287 of file Schedule.h.

Referenced by enableEndPaths(), endPathsEnabled(), and Schedule().

edm::propagate_const<std::unique_ptr<GlobalSchedule> > edm::Schedule::globalSchedule_
private

Definition at line 278 of file Schedule.h.

Referenced by allWorkers(), beginJob(), changeModule(), endJob(), and Schedule().

edm::propagate_const<std::shared_ptr<ModuleRegistry> > edm::Schedule::moduleRegistry_
private

Definition at line 275 of file Schedule.h.

Referenced by changeModule(), and Schedule().

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 281 of file Schedule.h.

Referenced by changeModule(), endJob(), and Schedule().

edm::propagate_const<std::shared_ptr<TriggerResultInserter> > edm::Schedule::resultsInserter_
private

Definition at line 274 of file Schedule.h.

std::vector<edm::propagate_const<std::shared_ptr<StreamSchedule> > > edm::Schedule::streamSchedules_
private
edm::propagate_const<std::unique_ptr<SystemTimeKeeper> > edm::Schedule::summaryTimeKeeper_
private

Definition at line 283 of file Schedule.h.

Referenced by getTriggerTimingReport(), and Schedule().

bool edm::Schedule::wantSummary_
private

Definition at line 285 of file Schedule.h.

Referenced by endJob(), and Schedule().