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 *, MergeableRunProductMetadata 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 119 of file Schedule.h.

Member Typedef Documentation

Definition at line 123 of file Schedule.h.

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

Definition at line 122 of file Schedule.h.

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

Definition at line 121 of file Schedule.h.

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

Definition at line 125 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 439 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(), edm::setIsMergeable(), 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.

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

Member Function Documentation

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

returns the collection of pointers to workers

Definition at line 1121 of file Schedule.cc.

References globalSchedule_.

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

1121  {
1122  return globalSchedule_->allWorkers();
1123  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:297
void edm::Schedule::availablePaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all paths in the process

Definition at line 1132 of file Schedule.cc.

References streamSchedules_.

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

1132  {
1133  streamSchedules_[0]->availablePaths(oLabelsToFill);
1134  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
void edm::Schedule::beginJob ( ProductRegistry const &  iRegistry)

Definition at line 1040 of file Schedule.cc.

References globalSchedule_.

1040  {
1041  globalSchedule_->beginJob(iRegistry);
1042  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:297
void edm::Schedule::beginStream ( unsigned int  iStreamID)

Definition at line 1044 of file Schedule.cc.

References streamSchedules_.

1044  {
1045  assert(iStreamID<streamSchedules_.size());
1046  streamSchedules_[iStreamID]->beginStream();
1047  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
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 1063 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().

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

Clear all the counters in the trigger report.

Definition at line 1260 of file Schedule.cc.

References streamSchedules_.

1260  {
1261  for(auto& s: streamSchedules_) {
1262  s->clearCounters();
1263  }
1264  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
void edm::Schedule::closeOutputFiles ( )

Definition at line 993 of file Schedule.cc.

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

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

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

Definition at line 1125 of file Schedule.cc.

References allWorkers().

1125  {
1126  for (auto const& worker : allWorkers()) {
1127  worker->convertCurrentProcessAlias(processName);
1128  }
1129  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1121
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 1200 of file Schedule.cc.

References endpathsAreActive_, and streamSchedules_.

1200  {
1201  endpathsAreActive_ = active;
1202  for(auto& s : streamSchedules_) {
1203  s->enableEndPaths(active);
1204  }
1205  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
volatile bool endpathsAreActive_
Definition: Schedule.h:308
void edm::Schedule::endJob ( ExceptionCollector collector)

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

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

References endPathNames_.

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

1143  {
1144  oLabelsToFill = *endPathNames_;
1145  }
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:305
bool edm::Schedule::endPathsEnabled ( ) const

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

Definition at line 1208 of file Schedule.cc.

References endpathsAreActive_.

1208  {
1209  return endpathsAreActive_;
1210  }
volatile bool endpathsAreActive_
Definition: Schedule.h:308
void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 1049 of file Schedule.cc.

References streamSchedules_.

1049  {
1050  assert(iStreamID<streamSchedules_.size());
1051  streamSchedules_[iStreamID]->endStream();
1052  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
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 1168 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().

1171  {
1172  allModuleDescriptions.clear();
1173  moduleIDToIndex.clear();
1174  modulesWhoseProductsAreConsumedBy.clear();
1175 
1176  allModuleDescriptions.reserve(allWorkers().size());
1177  moduleIDToIndex.reserve(allWorkers().size());
1178  modulesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1179 
1180  std::map<std::string, ModuleDescription const*> labelToDesc;
1181  unsigned int i = 0;
1182  for (auto const& worker : allWorkers()) {
1183  ModuleDescription const* p = worker->descPtr();
1184  allModuleDescriptions.push_back(p);
1185  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1186  labelToDesc[p->moduleLabel()] = p;
1187  ++i;
1188  }
1189  sort_all(moduleIDToIndex);
1190 
1191  i = 0;
1192  for (auto const& worker : allWorkers()) {
1193  std::vector<ModuleDescription const*>& modules = modulesWhoseProductsAreConsumedBy.at(i);
1194  worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1195  ++i;
1196  }
1197  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1121
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 1109 of file Schedule.cc.

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

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

1109  {
1110  std::vector<ModuleDescription const*> result;
1111  result.reserve(allWorkers().size());
1112 
1113  for (auto const& worker : allWorkers()) {
1114  ModuleDescription const* p = worker->descPtr();
1115  result.push_back(p);
1116  }
1117  return result;
1118  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1121
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 1213 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().

1213  {
1214  rep.eventSummary.totalEvents = 0;
1215  rep.eventSummary.totalEventsPassed = 0;
1216  rep.eventSummary.totalEventsFailed = 0;
1217  for(auto& s: streamSchedules_) {
1218  s->getTriggerReport(rep);
1219  }
1220  sort_all(rep.workerSummaries);
1221  }
rep
Definition: cuy.py:1190
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
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 1224 of file Schedule.cc.

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

Referenced by endJob().

1224  {
1225  rep.eventSummary.totalEvents = 0;
1226  rep.eventSummary.cpuTime = 0.;
1227  rep.eventSummary.realTime = 0.;
1228  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1229  }
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:302
rep
Definition: cuy.py:1190
void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists,
SubProcessParentageHelper const *  subProcessParentageHelper 
)
private

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

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

References streamSchedules_.

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

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

References streamSchedules_.

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

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

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

Definition at line 289 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:294
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 1148 of file Schedule.cc.

References streamSchedules_.

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

1149  {
1150  streamSchedules_[0]->modulesInPath(iPathLabel,oLabelsToFill);
1151  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
void edm::Schedule::openOutputFiles ( FileBlock fb)

Definition at line 998 of file Schedule.cc.

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

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

Definition at line 1054 of file Schedule.cc.

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

1058  {
1059  assert(iStreamID<streamSchedules_.size());
1060  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask),ep,es,token,pathStatusInserters_);
1061  }
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:292
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
def move(src, dest)
Definition: eostools.py:511
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 325 of file Schedule.h.

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

329  {
330  globalSchedule_->processOneGlobalAsync<T>(iTaskHolder,ep,es,token,cleaningUpAfterException);
331  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:297
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 313 of file Schedule.h.

References eostools::move().

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

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

Definition at line 1035 of file Schedule.cc.

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

1035  {
1036  using std::placeholders::_1;
1037  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
1038  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1121
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 1030 of file Schedule.cc.

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

1030  {
1031  using std::placeholders::_1;
1032  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
1033  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1121
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 286 of file Schedule.h.

References edm::get_underlying_safe().

Referenced by Schedule().

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

References edm::get_underlying_safe().

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

Definition at line 1022 of file Schedule.cc.

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

1022  {
1023  using std::placeholders::_1;
1024  // Return true iff at least one output module returns true.
1025  return (std::find_if (all_output_communicators_.begin(), all_output_communicators_.end(),
1027  != all_output_communicators_.end());
1028  }
virtual bool shouldWeCloseFile() const =0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:299
bool edm::Schedule::terminate ( void  ) const

Return whether each output module has reached its maximum count.

Definition at line 689 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

689  {
690  if (all_output_communicators_.empty()) {
691  return false;
692  }
693  for (auto& c : all_output_communicators_) {
694  if (!c->limitReached()) {
695  // Found an output module that has not reached output event count.
696  return false;
697  }
698  }
699  LogInfo("SuccessfulTermination")
700  << "The job is terminating successfully because each output module\n"
701  << "has reached its configured limit.\n";
702  return true;
703  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:299
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 1232 of file Schedule.cc.

References streamSchedules_.

Referenced by endJob().

1232  {
1233  int returnValue = 0;
1234  for(auto& s: streamSchedules_) {
1235  returnValue += s->totalEvents();
1236  }
1237  return returnValue;
1238  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
int edm::Schedule::totalEventsFailed ( ) const

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

Definition at line 1250 of file Schedule.cc.

References streamSchedules_.

1250  {
1251  int returnValue = 0;
1252  for(auto& s: streamSchedules_) {
1253  returnValue += s->totalEventsFailed();
1254  }
1255  return returnValue;
1256  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
int edm::Schedule::totalEventsPassed ( ) const

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

Definition at line 1241 of file Schedule.cc.

References streamSchedules_.

1241  {
1242  int returnValue = 0;
1243  for(auto& s: streamSchedules_) {
1244  returnValue += s->totalEventsPassed();
1245  }
1246  return returnValue;
1247  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
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 1137 of file Schedule.cc.

References pathNames_.

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

1137  {
1138  oLabelsToFill = *pathNames_;
1139 
1140  }
std::vector< std::string > const * pathNames_
Definition: Schedule.h:304
void edm::Schedule::writeLumiAsync ( WaitingTaskHolder  iTask,
LuminosityBlockPrincipal const &  lbp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry 
)

Definition at line 1013 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

1016  {
1017  for(auto& c: all_output_communicators_) {
1018  c->writeLumiAsync(task, lbp, processContext, activityRegistry);
1019  }
1020  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:299
void edm::Schedule::writeRunAsync ( WaitingTaskHolder  iTask,
RunPrincipal const &  rp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry,
MergeableRunProductMetadata const *  mergeableRunProductMetadata 
)

Definition at line 1003 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

1007  {
1008  for(auto& c: all_output_communicators_) {
1009  c->writeRunAsync(task, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1010  }
1011  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:299

Member Data Documentation

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

Definition at line 305 of file Schedule.h.

Referenced by endPaths(), and Schedule().

volatile bool edm::Schedule::endpathsAreActive_
private

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

Referenced by Schedule().

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

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

Referenced by changeModule(), and Schedule().

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

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

Referenced by processOneEventAsync(), and Schedule().

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 300 of file Schedule.h.

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

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

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

Referenced by getTriggerTimingReport(), and Schedule().

bool edm::Schedule::wantSummary_
private

Definition at line 306 of file Schedule.h.

Referenced by endJob(), and Schedule().