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, ServiceToken const &token)
 
template<typename T >
void processOneGlobalAsync (WaitingTaskHolder iTask, typename T::MyPrincipal &principal, EventSetup const &eventSetup, ServiceToken const &token, bool cleaningUpAfterException=false)
 
template<typename T >
void processOneStreamAsync (WaitingTaskHolder iTask, unsigned int iStreamID, typename T::MyPrincipal &principal, EventSetup const &eventSetup, ServiceToken const &token, 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 writeLumiAsync (WaitingTaskHolder iTask, LuminosityBlockPrincipal const &lbp, ProcessContext const *, ActivityRegistry *)
 
void writeRunAsync (WaitingTaskHolder iTask, RunPrincipal const &rp, ProcessContext const *, ActivityRegistry *)
 

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, wantSummary_, and mixOne_premix_on_sim_cfi::workers.

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->watchPreModuleEventAcquire(timeKeeperPtr, &SystemTimeKeeper::restartModuleEvent);
618  areg->watchPostModuleEventAcquire(timeKeeperPtr, &SystemTimeKeeper::stopModuleEvent);
619  areg->watchPreModuleEventDelayedGet(timeKeeperPtr, &SystemTimeKeeper::pauseModuleEvent);
620  areg->watchPostModuleEventDelayedGet(timeKeeperPtr,&SystemTimeKeeper::restartModuleEvent);
621 
622  areg->watchPreSourceEvent(timeKeeperPtr, &SystemTimeKeeper::startEvent);
623  areg->watchPostEvent(timeKeeperPtr, &SystemTimeKeeper::stopEvent);
624 
625  areg->watchPrePathEvent(timeKeeperPtr, &SystemTimeKeeper::startPath);
626  areg->watchPostPathEvent(timeKeeperPtr, &SystemTimeKeeper::stopPath);
627 
628  areg->watchPostBeginJob(timeKeeperPtr, &SystemTimeKeeper::startProcessingLoop);
629  areg->watchPreEndJob(timeKeeperPtr, &SystemTimeKeeper::stopProcessingLoop);
630  //areg->preModuleEventSignal_.connect([timeKeeperPtr](StreamContext const& iContext, ModuleCallingContext const& iMod) {
631  //timeKeeperPtr->startModuleEvent(iContext,iMod);
632  //});
633  }
634 
635  } // Schedule::Schedule
size
Write out results.
void stopEvent(StreamContext const &)
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1111
roAction_t actions[nactions]
Definition: GenABIO.cc:187
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
def copy(args, dbName)
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::shared_ptr< ModuleRegistry const > moduleRegistry() const
Definition: Schedule.h:286
std::vector< std::string > const * pathNames_
Definition: Schedule.h:302
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:300
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:295
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:290
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:289
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists, SubProcessParentageHelper const *subProcessParentageHelper)
Definition: Schedule.cc:639
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:292
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:298
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
volatile bool endpathsAreActive_
Definition: Schedule.h:306
std::shared_ptr< TriggerResultInserter const > resultsInserter() const
Definition: Schedule.h:284
void startPath(StreamContext const &, PathContext const &)
std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter > > > endPathStatusInserters_
Definition: Schedule.h:291
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:297
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
bool wantSummary_
Definition: Schedule.h:304
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:303

Member Function Documentation

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

returns the collection of pointers to workers

Definition at line 1111 of file Schedule.cc.

References globalSchedule_.

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

1111  {
1112  return globalSchedule_->allWorkers();
1113  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:295
void edm::Schedule::availablePaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all paths in the process

Definition at line 1122 of file Schedule.cc.

References streamSchedules_.

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

1122  {
1123  streamSchedules_[0]->availablePaths(oLabelsToFill);
1124  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
void edm::Schedule::beginJob ( ProductRegistry const &  iRegistry)

Definition at line 1030 of file Schedule.cc.

References globalSchedule_.

1030  {
1031  globalSchedule_->beginJob(iRegistry);
1032  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:295
void edm::Schedule::beginStream ( unsigned int  iStreamID)

Definition at line 1034 of file Schedule.cc.

References streamSchedules_.

1034  {
1035  assert(iStreamID<streamSchedules_.size());
1036  streamSchedules_[iStreamID]->beginStream();
1037  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
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 1053 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().

1055  {
1056  Worker* found = nullptr;
1057  for (auto const& worker : allWorkers()) {
1058  if (worker->description().moduleLabel() == iLabel) {
1059  found = worker;
1060  break;
1061  }
1062  }
1063  if (nullptr == found) {
1064  return false;
1065  }
1066 
1067  auto newMod = moduleRegistry_->replaceModule(iLabel,iPSet,preallocConfig_);
1068 
1069  globalSchedule_->replaceModule(newMod,iLabel);
1070 
1071  for(auto& s: streamSchedules_) {
1072  s->replaceModule(newMod,iLabel);
1073  }
1074 
1075  {
1076  //Need to updateLookup in order to make getByToken work
1077  auto const runLookup = iRegistry.productLookup(InRun);
1078  auto const lumiLookup = iRegistry.productLookup(InLumi);
1079  auto const eventLookup = iRegistry.productLookup(InEvent);
1080  found->updateLookup(InRun,*runLookup);
1081  found->updateLookup(InLumi,*lumiLookup);
1082  found->updateLookup(InEvent,*eventLookup);
1083 
1084  auto const& processName = newMod->moduleDescription().processName();
1085  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1086  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1087  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1088  found->resolvePutIndicies(InRun,runModuleToIndicies);
1089  found->resolvePutIndicies(InLumi,lumiModuleToIndicies);
1090  found->resolvePutIndicies(InEvent,eventModuleToIndicies);
1091 
1092 
1093  }
1094 
1095  return true;
1096  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1111
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:295
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:292
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:298
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1250 of file Schedule.cc.

References streamSchedules_.

1250  {
1251  for(auto& s: streamSchedules_) {
1252  s->clearCounters();
1253  }
1254  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
void edm::Schedule::closeOutputFiles ( )

Definition at line 984 of file Schedule.cc.

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

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

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

Definition at line 1115 of file Schedule.cc.

References allWorkers().

1115  {
1116  for (auto const& worker : allWorkers()) {
1117  worker->convertCurrentProcessAlias(processName);
1118  }
1119  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1111
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 1190 of file Schedule.cc.

References endpathsAreActive_, and streamSchedules_.

1190  {
1191  endpathsAreActive_ = active;
1192  for(auto& s : streamSchedules_) {
1193  s->enableEndPaths(active);
1194  }
1195  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
volatile bool endpathsAreActive_
Definition: Schedule.h:306
void edm::Schedule::endJob ( ExceptionCollector collector)

Definition at line 696 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.

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

References endPathNames_.

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

1133  {
1134  oLabelsToFill = *endPathNames_;
1135  }
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:303
bool edm::Schedule::endPathsEnabled ( ) const

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

Definition at line 1198 of file Schedule.cc.

References endpathsAreActive_.

1198  {
1199  return endpathsAreActive_;
1200  }
volatile bool endpathsAreActive_
Definition: Schedule.h:306
void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 1039 of file Schedule.cc.

References streamSchedules_.

1039  {
1040  assert(iStreamID<streamSchedules_.size());
1041  streamSchedules_[iStreamID]->endStream();
1042  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
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 1158 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().

1161  {
1162  allModuleDescriptions.clear();
1163  moduleIDToIndex.clear();
1164  modulesWhoseProductsAreConsumedBy.clear();
1165 
1166  allModuleDescriptions.reserve(allWorkers().size());
1167  moduleIDToIndex.reserve(allWorkers().size());
1168  modulesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1169 
1170  std::map<std::string, ModuleDescription const*> labelToDesc;
1171  unsigned int i = 0;
1172  for (auto const& worker : allWorkers()) {
1173  ModuleDescription const* p = worker->descPtr();
1174  allModuleDescriptions.push_back(p);
1175  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1176  labelToDesc[p->moduleLabel()] = p;
1177  ++i;
1178  }
1179  sort_all(moduleIDToIndex);
1180 
1181  i = 0;
1182  for (auto const& worker : allWorkers()) {
1183  std::vector<ModuleDescription const*>& modules = modulesWhoseProductsAreConsumedBy.at(i);
1184  worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1185  ++i;
1186  }
1187  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1111
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 1099 of file Schedule.cc.

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

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

1099  {
1100  std::vector<ModuleDescription const*> result;
1101  result.reserve(allWorkers().size());
1102 
1103  for (auto const& worker : allWorkers()) {
1104  ModuleDescription const* p = worker->descPtr();
1105  result.push_back(p);
1106  }
1107  return result;
1108  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1111
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 1203 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().

1203  {
1204  rep.eventSummary.totalEvents = 0;
1205  rep.eventSummary.totalEventsPassed = 0;
1206  rep.eventSummary.totalEventsFailed = 0;
1207  for(auto& s: streamSchedules_) {
1208  s->getTriggerReport(rep);
1209  }
1210  sort_all(rep.workerSummaries);
1211  }
rep
Definition: cuy.py:1189
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
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 1214 of file Schedule.cc.

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

Referenced by endJob().

1214  {
1215  rep.eventSummary.totalEvents = 0;
1216  rep.eventSummary.cpuTime = 0.;
1217  rep.eventSummary.realTime = 0.;
1218  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1219  }
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:300
rep
Definition: cuy.py:1189
void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists,
SubProcessParentageHelper const *  subProcessParentageHelper 
)
private

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

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

References streamSchedules_.

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

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

References streamSchedules_.

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

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

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

Definition at line 287 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:292
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 1138 of file Schedule.cc.

References streamSchedules_.

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

1139  {
1140  streamSchedules_[0]->modulesInPath(iPathLabel,oLabelsToFill);
1141  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
void edm::Schedule::openOutputFiles ( FileBlock fb)

Definition at line 989 of file Schedule.cc.

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

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

Definition at line 1044 of file Schedule.cc.

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

1048  {
1049  assert(iStreamID<streamSchedules_.size());
1050  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask),ep,es,token,pathStatusInserters_);
1051  }
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:290
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
def move(src, dest)
Definition: eostools.py:510
template<typename T >
void edm::Schedule::processOneGlobalAsync ( WaitingTaskHolder  iTask,
typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
ServiceToken const &  token,
bool  cleaningUpAfterException = false 
)

Definition at line 323 of file Schedule.h.

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

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

Definition at line 311 of file Schedule.h.

References eostools::move().

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

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

Definition at line 1025 of file Schedule.cc.

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

1025  {
1026  using std::placeholders::_1;
1027  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
1028  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1111
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:174
void edm::Schedule::respondToOpenInputFile ( FileBlock const &  fb)

Definition at line 1020 of file Schedule.cc.

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

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

Definition at line 284 of file Schedule.h.

References edm::get_underlying_safe().

Referenced by Schedule().

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

References edm::get_underlying_safe().

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

Definition at line 1012 of file Schedule.cc.

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

1012  {
1013  using std::placeholders::_1;
1014  // Return true iff at least one output module returns true.
1015  return (std::find_if (all_output_communicators_.begin(), all_output_communicators_.end(),
1017  != all_output_communicators_.end());
1018  }
virtual bool shouldWeCloseFile() const =0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:297
bool edm::Schedule::terminate ( void  ) const

Return whether each output module has reached its maximum count.

Definition at line 680 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

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

References streamSchedules_.

Referenced by endJob().

1222  {
1223  int returnValue = 0;
1224  for(auto& s: streamSchedules_) {
1225  returnValue += s->totalEvents();
1226  }
1227  return returnValue;
1228  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
int edm::Schedule::totalEventsFailed ( ) const

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

Definition at line 1240 of file Schedule.cc.

References streamSchedules_.

1240  {
1241  int returnValue = 0;
1242  for(auto& s: streamSchedules_) {
1243  returnValue += s->totalEventsFailed();
1244  }
1245  return returnValue;
1246  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
int edm::Schedule::totalEventsPassed ( ) const

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

Definition at line 1231 of file Schedule.cc.

References streamSchedules_.

1231  {
1232  int returnValue = 0;
1233  for(auto& s: streamSchedules_) {
1234  returnValue += s->totalEventsPassed();
1235  }
1236  return returnValue;
1237  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
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 1127 of file Schedule.cc.

References pathNames_.

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

1127  {
1128  oLabelsToFill = *pathNames_;
1129 
1130  }
std::vector< std::string > const * pathNames_
Definition: Schedule.h:302
void edm::Schedule::writeLumiAsync ( WaitingTaskHolder  iTask,
LuminosityBlockPrincipal const &  lbp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry 
)

Definition at line 1003 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

1006  {
1007  for(auto& c: all_output_communicators_) {
1008  c->writeLumiAsync(task, lbp, processContext, activityRegistry);
1009  }
1010  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:297
void edm::Schedule::writeRunAsync ( WaitingTaskHolder  iTask,
RunPrincipal const &  rp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry 
)

Definition at line 994 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

997  {
998  for(auto& c: all_output_communicators_) {
999  c->writeRunAsync(task, rp, processContext, activityRegistry);
1000  }
1001  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:297

Member Data Documentation

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

Definition at line 303 of file Schedule.h.

Referenced by endPaths(), and Schedule().

volatile bool edm::Schedule::endpathsAreActive_
private

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

Referenced by Schedule().

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

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

Referenced by changeModule(), and Schedule().

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

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

Referenced by processOneEventAsync(), and Schedule().

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 298 of file Schedule.h.

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

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

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

Referenced by getTriggerTimingReport(), and Schedule().

bool edm::Schedule::wantSummary_
private

Definition at line 304 of file Schedule.h.

Referenced by endJob(), and Schedule().