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 convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
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 openOutputFiles (FileBlock &fb)
 
void processOneEventAsync (WaitingTaskHolder iTask, unsigned int iStreamID, EventPrincipal &principal, EventSetup const &eventSetup)
 
template<typename T >
void processOneGlobalAsync (WaitingTaskHolder iTask, typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
 
template<typename T >
void processOneStreamAsync (WaitingTaskHolder iTask, 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 const &tns, ProductRegistry &pregistry, BranchIDListHelper &branchIDListHelper, ThinnedAssociationsHelper &thinnedAssociationsHelper, SubProcessParentageHelper const *subProcessParentageHelper, 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, SubProcessParentageHelper const *subProcessParentageHelper)
 
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_
 
std::vector< std::string > const * endPathNames_
 
volatile bool endpathsAreActive_
 
std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter > > > endPathStatusInserters_
 
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
 
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
 
std::vector< std::string > const * pathNames_
 
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
 
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 118 of file Schedule.h.

Member Typedef Documentation

Definition at line 122 of file Schedule.h.

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

Definition at line 121 of file Schedule.h.

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

Definition at line 120 of file Schedule.h.

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

Definition at line 124 of file Schedule.h.

Constructor & Destructor Documentation

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

Definition at line 434 of file Schedule.cc.

References actions, all_output_communicators_, allWorkers(), EnergyCorrector::c, popcon2dropbox::copy(), edm::maker::ModuleHolder::createOutputModuleCommunicator(), endPathNames_, endpathsAreActive_, endPathStatusInserters_, edm::service::TriggerNamesService::getTrigPaths(), globalSchedule_, mps_fire::i, limitOutput(), moduleRegistry(), moduleRegistry_, gen::n, pathNames_, pathStatusInserters_, 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_.

445  :
446  //Only create a resultsInserter if there is a trigger path
447  resultsInserter_{tns.getTrigPaths().empty()? std::shared_ptr<TriggerResultInserter>{} :makeInserter(proc_pset,prealloc,preg,actions,areg,processConfiguration)},
448  moduleRegistry_(new ModuleRegistry()),
450  preallocConfig_(prealloc),
451  pathNames_(&tns.getTrigPaths()),
452  endPathNames_(&tns.getEndPaths()),
453  wantSummary_(tns.wantSummary()),
454  endpathsAreActive_(true)
455  {
456  makePathStatusInserters(pathStatusInserters_,
457  *pathNames_,
458  prealloc,
459  preg,
460  areg,
461  processConfiguration,
462  std::string("PathStatusInserter"));
463 
464  makePathStatusInserters(endPathStatusInserters_,
465  *endPathNames_,
466  prealloc,
467  preg,
468  areg,
469  processConfiguration,
470  std::string("EndPathStatusInserter"));
471 
472  assert(0<prealloc.numberOfStreams());
473  streamSchedules_.reserve(prealloc.numberOfStreams());
474  for(unsigned int i=0; i<prealloc.numberOfStreams();++i) {
475  streamSchedules_.emplace_back(std::make_shared<StreamSchedule>(
476  resultsInserter(),
479  moduleRegistry(),
480  proc_pset,tns,prealloc,preg,
481  branchIDListHelper,actions,
482  areg,processConfiguration,
483  !hasSubprocesses,
484  StreamID{i},
485  processContext));
486  }
487 
488  //TriggerResults are injected automatically by StreamSchedules and are
489  // unknown to the ModuleRegistry
490  const std::string kTriggerResults("TriggerResults");
491  std::vector<std::string> modulesToUse;
492  modulesToUse.reserve(streamSchedules_[0]->allWorkers().size());
493  for(auto const& worker : streamSchedules_[0]->allWorkers()) {
494  if(worker->description().moduleLabel() != kTriggerResults) {
495  modulesToUse.push_back(worker->description().moduleLabel());
496  }
497  }
498  //The unscheduled modules are at the end of the list, but we want them at the front
499  unsigned int n = streamSchedules_[0]->numberOfUnscheduledModules();
500  if(n>0) {
501  std::vector<std::string> temp;
502  temp.reserve(modulesToUse.size());
503  auto itBeginUnscheduled = modulesToUse.begin()+modulesToUse.size()-n;
504  std::copy(itBeginUnscheduled,modulesToUse.end(),
505  std::back_inserter(temp));
506  std::copy(modulesToUse.begin(),itBeginUnscheduled,std::back_inserter(temp));
507  temp.swap(modulesToUse);
508  }
509 
510  // propagate_const<T> has no reset() function
511  globalSchedule_ = std::make_unique<GlobalSchedule>(
512  resultsInserter(),
515  moduleRegistry(),
516  modulesToUse,
517  proc_pset, preg, prealloc,
518  actions,areg,processConfiguration,processContext);
519 
520  //TriggerResults is not in the top level ParameterSet so the call to
521  // reduceParameterSet would fail to find it. Just remove it up front.
522  std::set<std::string> usedModuleLabels;
523  for(auto const& worker: allWorkers()) {
524  if(worker->description().moduleLabel() != kTriggerResults) {
525  usedModuleLabels.insert(worker->description().moduleLabel());
526  }
527  }
528  std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string> >("@all_modules"));
529  std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
530  reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels,
531  outputModulePathPositions);
532  processEDAliases(proc_pset, processConfiguration->processName(), preg);
533  proc_pset.registerIt();
534  processConfiguration->setParameterSetID(proc_pset.id());
535  processConfiguration->setProcessConfigurationID();
536 
537  // This is used for a little sanity-check to make sure no code
538  // modifications alter the number of workers at a later date.
539  size_t all_workers_count = allWorkers().size();
540 
541  moduleRegistry_->forAllModuleHolders([this](maker::ModuleHolder* iHolder){
542  auto comm = iHolder->createOutputModuleCommunicator();
543  if (comm) {
544  all_output_communicators_.emplace_back(std::shared_ptr<OutputModuleCommunicator>{comm.release()});
545  }
546  });
547  // Now that the output workers are filled in, set any output limits or information.
548  limitOutput(proc_pset, branchIDListHelper.branchIDLists(), subProcessParentageHelper);
549 
550  // Sanity check: make sure nobody has added a worker after we've
551  // already relied on the WorkerManager being full.
552  assert (all_workers_count == allWorkers().size());
553 
554  branchIDListHelper.updateFromRegistry(preg);
555 
556  for(auto const& worker : streamSchedules_[0]->allWorkers()) {
557  worker->registerThinnedAssociations(preg, thinnedAssociationsHelper);
558  }
559  thinnedAssociationsHelper.sort();
560 
561  // The output modules consume products in kept branches.
562  // So we must set this up before freezing.
563  for (auto& c : all_output_communicators_) {
564  c->selectProducts(preg, thinnedAssociationsHelper);
565  }
566 
567  {
568  // We now get a collection of types that may be consumed.
569  std::set<TypeID> productTypesConsumed;
570  std::set<TypeID> elementTypesConsumed;
571  // Loop over all modules
572  for (auto const& worker : allWorkers()) {
573  for (auto const& consumesInfo : worker->consumesInfo()) {
574  if (consumesInfo.kindOfType() == PRODUCT_TYPE) {
575  productTypesConsumed.emplace(consumesInfo.type());
576  } else {
577  elementTypesConsumed.emplace(consumesInfo.type());
578  }
579  }
580  }
581  // The SubProcess class is not a module, yet it may consume.
582  if(hasSubprocesses) {
583  productTypesConsumed.emplace(typeid(TriggerResults));
584  }
585  // The RandomNumberGeneratorService is not a module, yet it consumes.
586  {
587  RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed);
588  }
589  preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
590  }
591 
592  for (auto& c : all_output_communicators_) {
593  c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
594  }
595 
596  if(wantSummary_) {
597  std::vector<const ModuleDescription*> modDesc;
598  const auto& workers = allWorkers();
599  modDesc.reserve(workers.size());
600 
601  std::transform(workers.begin(),workers.end(),
602  std::back_inserter(modDesc),
603  [](const Worker* iWorker) -> const ModuleDescription* {
604  return iWorker->descPtr();
605  });
606 
607  // propagate_const<T> has no reset() function
608  summaryTimeKeeper_ = std::make_unique<SystemTimeKeeper>(
609  prealloc.numberOfStreams(),
610  modDesc,
611  tns,
612  processContext);
613  auto timeKeeperPtr = summaryTimeKeeper_.get();
614 
615  areg->watchPreModuleEvent(timeKeeperPtr, &SystemTimeKeeper::startModuleEvent);
616  areg->watchPostModuleEvent(timeKeeperPtr, &SystemTimeKeeper::stopModuleEvent);
617  areg->watchPreModuleEventDelayedGet(timeKeeperPtr, &SystemTimeKeeper::pauseModuleEvent);
618  areg->watchPostModuleEventDelayedGet(timeKeeperPtr,&SystemTimeKeeper::restartModuleEvent);
619 
620  areg->watchPreSourceEvent(timeKeeperPtr, &SystemTimeKeeper::startEvent);
621  areg->watchPostEvent(timeKeeperPtr, &SystemTimeKeeper::stopEvent);
622 
623  areg->watchPrePathEvent(timeKeeperPtr, &SystemTimeKeeper::startPath);
624  areg->watchPostPathEvent(timeKeeperPtr, &SystemTimeKeeper::stopPath);
625 
626  areg->watchPostBeginJob(timeKeeperPtr, &SystemTimeKeeper::startProcessingLoop);
627  areg->watchPreEndJob(timeKeeperPtr, &SystemTimeKeeper::stopProcessingLoop);
628  //areg->preModuleEventSignal_.connect([timeKeeperPtr](StreamContext const& iContext, ModuleCallingContext const& iMod) {
629  //timeKeeperPtr->startModuleEvent(iContext,iMod);
630  //});
631  }
632 
633  } // Schedule::Schedule
size
Write out results.
void stopEvent(StreamContext const &)
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1100
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:277
std::vector< std::string > const * pathNames_
Definition: Schedule.h:293
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:291
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:286
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:281
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:280
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists, SubProcessParentageHelper const *subProcessParentageHelper)
Definition: Schedule.cc:637
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:283
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:289
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
volatile bool endpathsAreActive_
Definition: Schedule.h:297
std::shared_ptr< TriggerResultInserter const > resultsInserter() const
Definition: Schedule.h:275
void startPath(StreamContext const &, PathContext const &)
std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter > > > endPathStatusInserters_
Definition: Schedule.h:282
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:288
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
bool wantSummary_
Definition: Schedule.h:295
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:294

Member Function Documentation

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

returns the collection of pointers to workers

Definition at line 1100 of file Schedule.cc.

References globalSchedule_.

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

1100  {
1101  return globalSchedule_->allWorkers();
1102  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:286
void edm::Schedule::availablePaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all paths in the process

Definition at line 1111 of file Schedule.cc.

References streamSchedules_.

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

1111  {
1112  streamSchedules_[0]->availablePaths(oLabelsToFill);
1113  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
void edm::Schedule::beginJob ( ProductRegistry const &  iRegistry)

Definition at line 1020 of file Schedule.cc.

References globalSchedule_.

1020  {
1021  globalSchedule_->beginJob(iRegistry);
1022  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:286
void edm::Schedule::beginStream ( unsigned int  iStreamID)

Definition at line 1024 of file Schedule.cc.

References streamSchedules_.

1024  {
1025  assert(iStreamID<streamSchedules_.size());
1026  streamSchedules_[iStreamID]->beginStream();
1027  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
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 1042 of file Schedule.cc.

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

1044  {
1045  Worker* found = nullptr;
1046  for (auto const& worker : allWorkers()) {
1047  if (worker->description().moduleLabel() == iLabel) {
1048  found = worker;
1049  break;
1050  }
1051  }
1052  if (nullptr == found) {
1053  return false;
1054  }
1055 
1056  auto newMod = moduleRegistry_->replaceModule(iLabel,iPSet,preallocConfig_);
1057 
1058  globalSchedule_->replaceModule(newMod,iLabel);
1059 
1060  for(auto& s: streamSchedules_) {
1061  s->replaceModule(newMod,iLabel);
1062  }
1063 
1064  {
1065  //Need to updateLookup in order to make getByToken work
1066  auto const runLookup = iRegistry.productLookup(InRun);
1067  auto const lumiLookup = iRegistry.productLookup(InLumi);
1068  auto const eventLookup = iRegistry.productLookup(InEvent);
1069  found->updateLookup(InRun,*runLookup);
1070  found->updateLookup(InLumi,*lumiLookup);
1071  found->updateLookup(InEvent,*eventLookup);
1072 
1073  auto const& processName = newMod->moduleDescription().processName();
1074  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1075  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1076  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1077  found->resolvePutIndicies(InRun,runModuleToIndicies);
1078  found->resolvePutIndicies(InLumi,lumiModuleToIndicies);
1079  found->resolvePutIndicies(InEvent,eventModuleToIndicies);
1080 
1081 
1082  }
1083 
1084  return true;
1085  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1100
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:286
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:283
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:289
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1239 of file Schedule.cc.

References streamSchedules_.

1239  {
1240  for(auto& s: streamSchedules_) {
1241  s->clearCounters();
1242  }
1243  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
void edm::Schedule::closeOutputFiles ( )

Definition at line 982 of file Schedule.cc.

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

982  {
983  using std::placeholders::_1;
985  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:288
void edm::Schedule::convertCurrentProcessAlias ( std::string const &  processName)

Convert "@currentProcess" in InputTag process names to the actual current process name.

Definition at line 1104 of file Schedule.cc.

References allWorkers().

1104  {
1105  for (auto const& worker : allWorkers()) {
1106  worker->convertCurrentProcessAlias(processName);
1107  }
1108  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1100
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 1179 of file Schedule.cc.

References endpathsAreActive_, and streamSchedules_.

1179  {
1180  endpathsAreActive_ = active;
1181  for(auto& s : streamSchedules_) {
1182  s->enableEndPaths(active);
1183  }
1184  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
volatile bool endpathsAreActive_
Definition: Schedule.h:297
void edm::Schedule::endJob ( ExceptionCollector collector)

Definition at line 694 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(), SiStripPI::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.

694  {
695  globalSchedule_->endJob(collector);
696  if (collector.hasThrown()) {
697  return;
698  }
699 
700  if (wantSummary_ == false) return;
701  {
702  TriggerReport tr;
703  getTriggerReport(tr);
704 
705  // The trigger report (pass/fail etc.):
706 
707  LogVerbatim("FwkSummary") << "";
708  if(streamSchedules_[0]->context().processContext()->isSubProcess()) {
709  LogVerbatim("FwkSummary") << "TrigReport Process: "<<streamSchedules_[0]->context().processContext()->processName();
710  }
711  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Event Summary ------------";
712  if(!tr.trigPathSummaries.empty()) {
713  LogVerbatim("FwkSummary") << "TrigReport"
714  << " Events total = " << tr.eventSummary.totalEvents
715  << " passed = " << tr.eventSummary.totalEventsPassed
716  << " failed = " << tr.eventSummary.totalEventsFailed
717  << "";
718  } else {
719  LogVerbatim("FwkSummary") << "TrigReport"
720  << " Events total = " << tr.eventSummary.totalEvents
721  << " passed = " << tr.eventSummary.totalEvents
722  << " failed = 0";
723  }
724 
725  LogVerbatim("FwkSummary") << "";
726  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Path Summary ------------";
727  LogVerbatim("FwkSummary") << "TrigReport "
728  << std::right << std::setw(10) << "Trig Bit#" << " "
729  << std::right << std::setw(10) << "Executed" << " "
730  << std::right << std::setw(10) << "Passed" << " "
731  << std::right << std::setw(10) << "Failed" << " "
732  << std::right << std::setw(10) << "Error" << " "
733  << "Name" << "";
734  for (auto const& p: tr.trigPathSummaries) {
735  LogVerbatim("FwkSummary") << "TrigReport "
736  << std::right << std::setw(5) << 1
737  << std::right << std::setw(5) << p.bitPosition << " "
738  << std::right << std::setw(10) << p.timesRun << " "
739  << std::right << std::setw(10) << p.timesPassed << " "
740  << std::right << std::setw(10) << p.timesFailed << " "
741  << std::right << std::setw(10) << p.timesExcept << " "
742  << p.name << "";
743  }
744 
745  /*
746  std::vector<int>::const_iterator epi = empty_trig_paths_.begin();
747  std::vector<int>::const_iterator epe = empty_trig_paths_.end();
748  std::vector<std::string>::const_iterator epn = empty_trig_path_names_.begin();
749  for (; epi != epe; ++epi, ++epn) {
750 
751  LogVerbatim("FwkSummary") << "TrigReport "
752  << std::right << std::setw(5) << 1
753  << std::right << std::setw(5) << *epi << " "
754  << std::right << std::setw(10) << totalEvents() << " "
755  << std::right << std::setw(10) << totalEvents() << " "
756  << std::right << std::setw(10) << 0 << " "
757  << std::right << std::setw(10) << 0 << " "
758  << *epn << "";
759  }
760  */
761 
762  LogVerbatim("FwkSummary") << "";
763  LogVerbatim("FwkSummary") << "TrigReport " << "-------End-Path Summary ------------";
764  LogVerbatim("FwkSummary") << "TrigReport "
765  << std::right << std::setw(10) << "Trig Bit#" << " "
766  << std::right << std::setw(10) << "Executed" << " "
767  << std::right << std::setw(10) << "Passed" << " "
768  << std::right << std::setw(10) << "Failed" << " "
769  << std::right << std::setw(10) << "Error" << " "
770  << "Name" << "";
771  for (auto const& p: tr.endPathSummaries) {
772  LogVerbatim("FwkSummary") << "TrigReport "
773  << std::right << std::setw(5) << 0
774  << std::right << std::setw(5) << p.bitPosition << " "
775  << std::right << std::setw(10) << p.timesRun << " "
776  << std::right << std::setw(10) << p.timesPassed << " "
777  << std::right << std::setw(10) << p.timesFailed << " "
778  << std::right << std::setw(10) << p.timesExcept << " "
779  << p.name << "";
780  }
781 
782  for (auto const& p: tr.trigPathSummaries) {
783  LogVerbatim("FwkSummary") << "";
784  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Modules in Path: " << p.name << " ------------";
785  LogVerbatim("FwkSummary") << "TrigReport "
786  << std::right << std::setw(10) << "Trig Bit#" << " "
787  << std::right << std::setw(10) << "Visited" << " "
788  << std::right << std::setw(10) << "Passed" << " "
789  << std::right << std::setw(10) << "Failed" << " "
790  << std::right << std::setw(10) << "Error" << " "
791  << "Name" << "";
792 
793  unsigned int bitpos = 0;
794  for (auto const& mod: p.moduleInPathSummaries) {
795  LogVerbatim("FwkSummary") << "TrigReport "
796  << std::right << std::setw(5) << 1
797  << std::right << std::setw(5) << bitpos << " "
798  << std::right << std::setw(10) << mod.timesVisited << " "
799  << std::right << std::setw(10) << mod.timesPassed << " "
800  << std::right << std::setw(10) << mod.timesFailed << " "
801  << std::right << std::setw(10) << mod.timesExcept << " "
802  << mod.moduleLabel << "";
803  ++bitpos;
804  }
805  }
806 
807  for (auto const& p: tr.endPathSummaries) {
808  LogVerbatim("FwkSummary") << "";
809  LogVerbatim("FwkSummary") << "TrigReport " << "------ Modules in End-Path: " << p.name << " ------------";
810  LogVerbatim("FwkSummary") << "TrigReport "
811  << std::right << std::setw(10) << "Trig Bit#" << " "
812  << std::right << std::setw(10) << "Visited" << " "
813  << std::right << std::setw(10) << "Passed" << " "
814  << std::right << std::setw(10) << "Failed" << " "
815  << std::right << std::setw(10) << "Error" << " "
816  << "Name" << "";
817 
818  unsigned int bitpos=0;
819  for (auto const& mod: p.moduleInPathSummaries) {
820  LogVerbatim("FwkSummary") << "TrigReport "
821  << std::right << std::setw(5) << 0
822  << std::right << std::setw(5) << bitpos << " "
823  << std::right << std::setw(10) << mod.timesVisited << " "
824  << std::right << std::setw(10) << mod.timesPassed << " "
825  << std::right << std::setw(10) << mod.timesFailed << " "
826  << std::right << std::setw(10) << mod.timesExcept << " "
827  << mod.moduleLabel << "";
828  ++bitpos;
829  }
830  }
831 
832  LogVerbatim("FwkSummary") << "";
833  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Module Summary ------------";
834  LogVerbatim("FwkSummary") << "TrigReport "
835  << std::right << std::setw(10) << "Visited" << " "
836  << std::right << std::setw(10) << "Executed" << " "
837  << std::right << std::setw(10) << "Passed" << " "
838  << std::right << std::setw(10) << "Failed" << " "
839  << std::right << std::setw(10) << "Error" << " "
840  << "Name" << "";
841  for (auto const& worker : tr.workerSummaries) {
842  LogVerbatim("FwkSummary") << "TrigReport "
843  << std::right << std::setw(10) << worker.timesVisited << " "
844  << std::right << std::setw(10) << worker.timesRun << " "
845  << std::right << std::setw(10) << worker.timesPassed << " "
846  << std::right << std::setw(10) << worker.timesFailed << " "
847  << std::right << std::setw(10) << worker.timesExcept << " "
848  << worker.moduleLabel << "";
849  }
850  LogVerbatim("FwkSummary") << "";
851  }
852  // The timing report (CPU and Real Time):
853  TriggerTimingReport tr;
855 
856  const int totalEvents = std::max(1, tr.eventSummary.totalEvents);
857 
858  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Event Summary ---[sec]----";
859  LogVerbatim("FwkSummary") << "TimeReport"
860  << std::setprecision(6) << std::fixed
861  << " event loop CPU/event = " << tr.eventSummary.cpuTime/totalEvents;
862  LogVerbatim("FwkSummary") << "TimeReport"
863  << std::setprecision(6) << std::fixed
864  << " event loop Real/event = " << tr.eventSummary.realTime/totalEvents;
865  LogVerbatim("FwkSummary") << "TimeReport"
866  << std::setprecision(6) << std::fixed
867  << " sum Streams Real/event = " << tr.eventSummary.sumStreamRealTime/totalEvents;
868  LogVerbatim("FwkSummary") << "TimeReport"
869  << std::setprecision(6) << std::fixed
870  << " efficiency CPU/Real/thread = " << tr.eventSummary.cpuTime/tr.eventSummary.realTime/preallocConfig_.numberOfThreads();
871 
872  constexpr int kColumn1Size = 10;
873  constexpr int kColumn2Size = 12;
874  constexpr int kColumn3Size = 12;
875  LogVerbatim("FwkSummary") << "";
876  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Path Summary ---[Real sec]----";
877  LogVerbatim("FwkSummary") << "TimeReport "
878  << std::right << std::setw(kColumn1Size) << "per event"<<" "
879  << std::right << std::setw(kColumn2Size) << "per exec"
880  << " Name";
881  for (auto const& p: tr.trigPathSummaries) {
882  const int timesRun = std::max(1, p.timesRun);
883  LogVerbatim("FwkSummary") << "TimeReport "
884  << std::setprecision(6) << std::fixed
885  << std::right << std::setw(kColumn1Size) << p.realTime/totalEvents << " "
886  << std::right << std::setw(kColumn2Size) << p.realTime/timesRun << " "
887  << p.name << "";
888  }
889  LogVerbatim("FwkSummary") << "TimeReport "
890  << std::right << std::setw(kColumn1Size) << "per event"<<" "
891  << std::right << std::setw(kColumn2Size) << "per exec"
892  << " Name" << "";
893 
894  LogVerbatim("FwkSummary") << "";
895  LogVerbatim("FwkSummary") << "TimeReport " << "-------End-Path Summary ---[Real sec]----";
896  LogVerbatim("FwkSummary") << "TimeReport "
897  << std::right << std::setw(kColumn1Size) << "per event" <<" "
898  << std::right << std::setw(kColumn2Size) << "per exec"
899  << " Name" << "";
900  for (auto const& p: tr.endPathSummaries) {
901  const int timesRun = std::max(1, p.timesRun);
902 
903  LogVerbatim("FwkSummary") << "TimeReport "
904  << std::setprecision(6) << std::fixed
905  << std::right << std::setw(kColumn1Size) << p.realTime/totalEvents << " "
906  << std::right << std::setw(kColumn2Size) << p.realTime/timesRun << " "
907  << p.name << "";
908  }
909  LogVerbatim("FwkSummary") << "TimeReport "
910  << std::right << std::setw(kColumn1Size) << "per event" <<" "
911  << std::right << std::setw(kColumn2Size) << "per exec"
912  << " Name" << "";
913 
914  for (auto const& p: tr.trigPathSummaries) {
915  LogVerbatim("FwkSummary") << "";
916  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Modules in Path: " << p.name << " ---[Real sec]----";
917  LogVerbatim("FwkSummary") << "TimeReport "
918  << std::right << std::setw(kColumn1Size) << "per event" <<" "
919  << std::right << std::setw(kColumn2Size) << "per visit"
920  << " Name" << "";
921  for (auto const& mod: p.moduleInPathSummaries) {
922  LogVerbatim("FwkSummary") << "TimeReport "
923  << std::setprecision(6) << std::fixed
924  << std::right << std::setw(kColumn1Size) << mod.realTime/totalEvents << " "
925  << std::right << std::setw(kColumn2Size) << mod.realTime/std::max(1, mod.timesVisited) << " "
926  << mod.moduleLabel << "";
927  }
928  }
929  if(not tr.trigPathSummaries.empty()) {
930  LogVerbatim("FwkSummary") << "TimeReport "
931  << std::right << std::setw(kColumn1Size) << "per event" <<" "
932  << std::right << std::setw(kColumn2Size) << "per visit"
933  << " Name" << "";
934  }
935  for (auto const& p: tr.endPathSummaries) {
936  LogVerbatim("FwkSummary") << "";
937  LogVerbatim("FwkSummary") << "TimeReport " << "------ Modules in End-Path: " << p.name << " ---[Real sec]----";
938  LogVerbatim("FwkSummary") << "TimeReport "
939  << std::right << std::setw(kColumn1Size) << "per event" <<" "
940  << std::right << std::setw(kColumn2Size) << "per visit"
941  << " Name" << "";
942  for (auto const& mod: p.moduleInPathSummaries) {
943  LogVerbatim("FwkSummary") << "TimeReport "
944  << std::setprecision(6) << std::fixed
945  << std::right << std::setw(kColumn1Size) << mod.realTime/totalEvents << " "
946  << std::right << std::setw(kColumn2Size) << mod.realTime/std::max(1, mod.timesVisited) << " "
947  << mod.moduleLabel << "";
948  }
949  }
950  if(not tr.endPathSummaries.empty()) {
951  LogVerbatim("FwkSummary") << "TimeReport "
952  << std::right << std::setw(kColumn1Size) << "per event" <<" "
953  << std::right << std::setw(kColumn2Size) << "per visit"
954  << " Name" << "";
955  }
956  LogVerbatim("FwkSummary") << "";
957  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Module Summary ---[Real sec]----";
958  LogVerbatim("FwkSummary") << "TimeReport "
959  << std::right << std::setw(kColumn1Size) << "per event" <<" "
960  << std::right << std::setw(kColumn2Size) << "per exec" <<" "
961  << std::right << std::setw(kColumn3Size) << "per visit"
962  << " Name" << "";
963  for (auto const& worker : tr.workerSummaries) {
964  LogVerbatim("FwkSummary") << "TimeReport "
965  << std::setprecision(6) << std::fixed
966  << std::right << std::setw(kColumn1Size) << worker.realTime/totalEvents << " "
967  << std::right << std::setw(kColumn2Size) << worker.realTime/std::max(1, worker.timesRun) << " "
968  << std::right << std::setw(kColumn3Size) << worker.realTime/std::max(1, worker.timesVisited) << " "
969  << worker.moduleLabel << "";
970  }
971  LogVerbatim("FwkSummary") << "TimeReport "
972  << std::right << std::setw(kColumn1Size) << "per event" <<" "
973  << std::right << std::setw(kColumn2Size) << "per exec" <<" "
974  << std::right << std::setw(kColumn3Size) << "per visit"
975  << " Name" << "";
976 
977  LogVerbatim("FwkSummary") << "";
978  LogVerbatim("FwkSummary") << "T---Report end!" << "";
979  LogVerbatim("FwkSummary") << "";
980  }
#define constexpr
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:286
int totalEvents() const
Definition: Schedule.cc:1211
void getTriggerReport(TriggerReport &rep) const
Definition: Schedule.cc:1192
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:289
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
bool wantSummary_
Definition: Schedule.h:295
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void getTriggerTimingReport(TriggerTimingReport &rep) const
Definition: Schedule.cc:1203
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 1122 of file Schedule.cc.

References endPathNames_.

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

1122  {
1123  oLabelsToFill = *endPathNames_;
1124  }
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:294
bool edm::Schedule::endPathsEnabled ( ) const

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

Definition at line 1187 of file Schedule.cc.

References endpathsAreActive_.

1187  {
1188  return endpathsAreActive_;
1189  }
volatile bool endpathsAreActive_
Definition: Schedule.h:297
void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 1029 of file Schedule.cc.

References streamSchedules_.

1029  {
1030  assert(iStreamID<streamSchedules_.size());
1031  streamSchedules_[iStreamID]->endStream();
1032  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
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 1147 of file Schedule.cc.

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

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

1150  {
1151  allModuleDescriptions.clear();
1152  moduleIDToIndex.clear();
1153  modulesWhoseProductsAreConsumedBy.clear();
1154 
1155  allModuleDescriptions.reserve(allWorkers().size());
1156  moduleIDToIndex.reserve(allWorkers().size());
1157  modulesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1158 
1159  std::map<std::string, ModuleDescription const*> labelToDesc;
1160  unsigned int i = 0;
1161  for (auto const& worker : allWorkers()) {
1162  ModuleDescription const* p = worker->descPtr();
1163  allModuleDescriptions.push_back(p);
1164  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1165  labelToDesc[p->moduleLabel()] = p;
1166  ++i;
1167  }
1168  sort_all(moduleIDToIndex);
1169 
1170  i = 0;
1171  for (auto const& worker : allWorkers()) {
1172  std::vector<ModuleDescription const*>& modules = modulesWhoseProductsAreConsumedBy.at(i);
1173  worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1174  ++i;
1175  }
1176  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1100
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 1088 of file Schedule.cc.

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

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

1088  {
1089  std::vector<ModuleDescription const*> result;
1090  result.reserve(allWorkers().size());
1091 
1092  for (auto const& worker : allWorkers()) {
1093  ModuleDescription const* p = worker->descPtr();
1094  result.push_back(p);
1095  }
1096  return result;
1097  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1100
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 1192 of file Schedule.cc.

References edm::TriggerReport::eventSummary, edm::sort_all(), streamSchedules_, edm::EventSummary::totalEvents, edm::EventSummary::totalEventsFailed, edm::EventSummary::totalEventsPassed, and edm::TriggerReport::workerSummaries.

Referenced by endJob().

1192  {
1193  rep.eventSummary.totalEvents = 0;
1194  rep.eventSummary.totalEventsPassed = 0;
1195  rep.eventSummary.totalEventsFailed = 0;
1196  for(auto& s: streamSchedules_) {
1197  s->getTriggerReport(rep);
1198  }
1199  sort_all(rep.workerSummaries);
1200  }
rep
Definition: cuy.py:1188
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
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 1203 of file Schedule.cc.

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

Referenced by endJob().

1203  {
1204  rep.eventSummary.totalEvents = 0;
1205  rep.eventSummary.cpuTime = 0.;
1206  rep.eventSummary.realTime = 0.;
1207  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1208  }
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:291
rep
Definition: cuy.py:1188
void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists,
SubProcessParentageHelper const *  subProcessParentageHelper 
)
private

Definition at line 637 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().

639  {
640  std::string const output("output");
641 
642  ParameterSet const& maxEventsPSet = proc_pset.getUntrackedParameterSet("maxEvents", ParameterSet());
643  int maxEventSpecs = 0;
644  int maxEventsOut = -1;
645  ParameterSet const* vMaxEventsOut = nullptr;
646  std::vector<std::string> intNamesE = maxEventsPSet.getParameterNamesForType<int>(false);
647  if (search_all(intNamesE, output)) {
648  maxEventsOut = maxEventsPSet.getUntrackedParameter<int>(output);
649  ++maxEventSpecs;
650  }
651  std::vector<std::string> psetNamesE;
652  maxEventsPSet.getParameterSetNames(psetNamesE, false);
653  if (search_all(psetNamesE, output)) {
654  vMaxEventsOut = &maxEventsPSet.getUntrackedParameterSet(output);
655  ++maxEventSpecs;
656  }
657 
658  if (maxEventSpecs > 1) {
660  "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
661  }
662 
663  for (auto& c : all_output_communicators_) {
664  OutputModuleDescription desc(branchIDLists, maxEventsOut, subProcessParentageHelper);
665  if (vMaxEventsOut != nullptr && !vMaxEventsOut->empty()) {
666  std::string const& moduleLabel = c->description().moduleLabel();
667  try {
668  desc.maxEvents_ = vMaxEventsOut->getUntrackedParameter<int>(moduleLabel);
669  } catch (Exception const&) {
671  "\nNo entry in 'maxEvents' for output module label '" << moduleLabel << "'.\n";
672  }
673  }
674  c->configure(desc);
675  }
676  }
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:46
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:288
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 1140 of file Schedule.cc.

References streamSchedules_.

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

1142  {
1143  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1144  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
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 1133 of file Schedule.cc.

References streamSchedules_.

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

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

Definition at line 277 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:283
std::shared_ptr<ModuleRegistry>& edm::Schedule::moduleRegistry ( )
inlineprivate

Definition at line 278 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:283
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 1127 of file Schedule.cc.

References streamSchedules_.

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

1128  {
1129  streamSchedules_[0]->modulesInPath(iPathLabel,oLabelsToFill);
1130  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
void edm::Schedule::openOutputFiles ( FileBlock fb)

Definition at line 987 of file Schedule.cc.

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

987  {
988  using std::placeholders::_1;
990  }
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:288
void edm::Schedule::processOneEventAsync ( WaitingTaskHolder  iTask,
unsigned int  iStreamID,
EventPrincipal principal,
EventSetup const &  eventSetup 
)

Definition at line 1034 of file Schedule.cc.

References eostools::move(), pathStatusInserters_, and streamSchedules_.

1037  {
1038  assert(iStreamID<streamSchedules_.size());
1039  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask),ep,es,pathStatusInserters_);
1040  }
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:281
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
def move(src, dest)
Definition: eostools.py:510
template<typename T >
void edm::Schedule::processOneGlobalAsync ( WaitingTaskHolder  iTask,
typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 313 of file Schedule.h.

Referenced by edm::beginGlobalTransitionAsync(), and edm::endGlobalTransitionAsync().

316  {
317  globalSchedule_->processOneGlobalAsync<T>(iTaskHolder,ep,es,cleaningUpAfterException);
318  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:286
long double T
template<typename T >
void edm::Schedule::processOneStreamAsync ( WaitingTaskHolder  iTask,
unsigned int  iStreamID,
typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 302 of file Schedule.h.

References eostools::move().

Referenced by edm::beginStreamTransitionAsync(), and edm::endStreamTransitionAsync().

306  {
307  assert(iStreamID<streamSchedules_.size());
308  streamSchedules_[iStreamID]->processOneStreamAsync<T>(std::move(iTaskHolder),ep,es,cleaningUpAfterException);
309  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
long double T
def move(src, dest)
Definition: eostools.py:510
void edm::Schedule::respondToCloseInputFile ( FileBlock const &  fb)

Definition at line 1015 of file Schedule.cc.

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

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

Definition at line 1010 of file Schedule.cc.

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

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

Definition at line 275 of file Schedule.h.

References edm::get_underlying_safe().

Referenced by Schedule().

edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:280
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 276 of file Schedule.h.

References edm::get_underlying_safe().

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

Definition at line 1002 of file Schedule.cc.

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

1002  {
1003  using std::placeholders::_1;
1004  // Return true iff at least one output module returns true.
1005  return (std::find_if (all_output_communicators_.begin(), all_output_communicators_.end(),
1007  != all_output_communicators_.end());
1008  }
virtual bool shouldWeCloseFile() const =0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:288
bool edm::Schedule::terminate ( void  ) const

Return whether each output module has reached its maximum count.

Definition at line 678 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

678  {
679  if (all_output_communicators_.empty()) {
680  return false;
681  }
682  for (auto& c : all_output_communicators_) {
683  if (!c->limitReached()) {
684  // Found an output module that has not reached output event count.
685  return false;
686  }
687  }
688  LogInfo("SuccessfulTermination")
689  << "The job is terminating successfully because each output module\n"
690  << "has reached its configured limit.\n";
691  return true;
692  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:288
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 1211 of file Schedule.cc.

References streamSchedules_.

Referenced by endJob().

1211  {
1212  int returnValue = 0;
1213  for(auto& s: streamSchedules_) {
1214  returnValue += s->totalEvents();
1215  }
1216  return returnValue;
1217  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
int edm::Schedule::totalEventsFailed ( ) const

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

Definition at line 1229 of file Schedule.cc.

References streamSchedules_.

1229  {
1230  int returnValue = 0;
1231  for(auto& s: streamSchedules_) {
1232  returnValue += s->totalEventsFailed();
1233  }
1234  return returnValue;
1235  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
int edm::Schedule::totalEventsPassed ( ) const

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

Definition at line 1220 of file Schedule.cc.

References streamSchedules_.

1220  {
1221  int returnValue = 0;
1222  for(auto& s: streamSchedules_) {
1223  returnValue += s->totalEventsPassed();
1224  }
1225  return returnValue;
1226  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:284
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 1116 of file Schedule.cc.

References pathNames_.

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

1116  {
1117  oLabelsToFill = *pathNames_;
1118 
1119  }
std::vector< std::string > const * pathNames_
Definition: Schedule.h:293
void edm::Schedule::writeLumi ( LuminosityBlockPrincipal const &  lbp,
ProcessContext const *  processContext 
)

Definition at line 997 of file Schedule.cc.

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

997  {
998  using std::placeholders::_1;
999  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::writeLumi, _1, std::cref(lbp), processContext));
1000  }
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:288
void edm::Schedule::writeRun ( RunPrincipal const &  rp,
ProcessContext const *  processContext 
)

Definition at line 992 of file Schedule.cc.

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

992  {
993  using std::placeholders::_1;
994  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::writeRun, _1, std::cref(rp), processContext));
995  }
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:288

Member Data Documentation

AllOutputModuleCommunicators edm::Schedule::all_output_communicators_
private
std::vector<std::string> const* edm::Schedule::endPathNames_
private

Definition at line 294 of file Schedule.h.

Referenced by endPaths(), and Schedule().

volatile bool edm::Schedule::endpathsAreActive_
private

Definition at line 297 of file Schedule.h.

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

std::vector<edm::propagate_const<std::shared_ptr<EndPathStatusInserter> > > edm::Schedule::endPathStatusInserters_
private

Definition at line 282 of file Schedule.h.

Referenced by Schedule().

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

Definition at line 286 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 283 of file Schedule.h.

Referenced by changeModule(), and Schedule().

std::vector<std::string> const* edm::Schedule::pathNames_
private

Definition at line 293 of file Schedule.h.

Referenced by Schedule(), and triggerPaths().

std::vector<edm::propagate_const<std::shared_ptr<PathStatusInserter> > > edm::Schedule::pathStatusInserters_
private

Definition at line 281 of file Schedule.h.

Referenced by processOneEventAsync(), and Schedule().

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 289 of file Schedule.h.

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

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

Definition at line 280 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 291 of file Schedule.h.

Referenced by getTriggerTimingReport(), and Schedule().

bool edm::Schedule::wantSummary_
private

Definition at line 295 of file Schedule.h.

Referenced by endJob(), and Schedule().