CMS 3D CMS Logo

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

#include <Schedule.h>

Public Types

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

Public Member Functions

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

Private Member Functions

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

Private Attributes

AllOutputModuleCommunicators all_output_communicators_
 
std::vector< std::string > const * endPathNames_
 
volatile bool endpathsAreActive_
 
std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter > > > endPathStatusInserters_
 
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
 
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
 
std::vector< std::string > const * pathNames_
 
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
 
PreallocationConfiguration preallocConfig_
 
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
 
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
 
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
 
bool wantSummary_
 

Detailed Description

Definition at line 118 of file Schedule.h.

Member Typedef Documentation

Definition at line 122 of file Schedule.h.

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

Definition at line 121 of file Schedule.h.

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

Definition at line 120 of file Schedule.h.

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

Definition at line 124 of file Schedule.h.

Constructor & Destructor Documentation

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

Definition at line 433 of file Schedule.cc.

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

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

Member Function Documentation

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

returns the collection of pointers to workers

Definition at line 1089 of file Schedule.cc.

References globalSchedule_.

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

1089  {
1090  return globalSchedule_->allWorkers();
1091  }
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 1100 of file Schedule.cc.

References streamSchedules_.

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

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

Definition at line 1019 of file Schedule.cc.

References globalSchedule_.

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

Definition at line 1023 of file Schedule.cc.

References streamSchedules_.

1023  {
1024  assert(iStreamID<streamSchedules_.size());
1025  streamSchedules_[iStreamID]->beginStream();
1026  }
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 1041 of file Schedule.cc.

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

1043  {
1044  Worker* found = nullptr;
1045  for (auto const& worker : allWorkers()) {
1046  if (worker->description().moduleLabel() == iLabel) {
1047  found = worker;
1048  break;
1049  }
1050  }
1051  if (nullptr == found) {
1052  return false;
1053  }
1054 
1055  auto newMod = moduleRegistry_->replaceModule(iLabel,iPSet,preallocConfig_);
1056 
1057  globalSchedule_->replaceModule(newMod,iLabel);
1058 
1059  for(auto& s: streamSchedules_) {
1060  s->replaceModule(newMod,iLabel);
1061  }
1062 
1063  {
1064  //Need to updateLookup in order to make getByToken work
1065  auto const runLookup = iRegistry.productLookup(InRun);
1066  auto const lumiLookup = iRegistry.productLookup(InLumi);
1067  auto const eventLookup = iRegistry.productLookup(InEvent);
1068  found->updateLookup(InRun,*runLookup);
1069  found->updateLookup(InLumi,*lumiLookup);
1070  found->updateLookup(InEvent,*eventLookup);
1071  }
1072 
1073  return true;
1074  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1089
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 1228 of file Schedule.cc.

References streamSchedules_.

1228  {
1229  for(auto& s: streamSchedules_) {
1230  s->clearCounters();
1231  }
1232  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:295
void edm::Schedule::closeOutputFiles ( )

Definition at line 981 of file Schedule.cc.

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

981  {
982  using std::placeholders::_1;
984  }
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 1093 of file Schedule.cc.

References allWorkers().

1093  {
1094  for (auto const& worker : allWorkers()) {
1095  worker->convertCurrentProcessAlias(processName);
1096  }
1097  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1089
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 1168 of file Schedule.cc.

References endpathsAreActive_, and streamSchedules_.

1168  {
1169  endpathsAreActive_ = active;
1170  for(auto& s : streamSchedules_) {
1171  s->enableEndPaths(active);
1172  }
1173  }
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 693 of file Schedule.cc.

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

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

References endPathNames_.

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

1111  {
1112  oLabelsToFill = *endPathNames_;
1113  }
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 1176 of file Schedule.cc.

References endpathsAreActive_.

1176  {
1177  return endpathsAreActive_;
1178  }
volatile bool endpathsAreActive_
Definition: Schedule.h:308
void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 1028 of file Schedule.cc.

References streamSchedules_.

1028  {
1029  assert(iStreamID<streamSchedules_.size());
1030  streamSchedules_[iStreamID]->endStream();
1031  }
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 1136 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().

1139  {
1140  allModuleDescriptions.clear();
1141  moduleIDToIndex.clear();
1142  modulesWhoseProductsAreConsumedBy.clear();
1143 
1144  allModuleDescriptions.reserve(allWorkers().size());
1145  moduleIDToIndex.reserve(allWorkers().size());
1146  modulesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1147 
1148  std::map<std::string, ModuleDescription const*> labelToDesc;
1149  unsigned int i = 0;
1150  for (auto const& worker : allWorkers()) {
1151  ModuleDescription const* p = worker->descPtr();
1152  allModuleDescriptions.push_back(p);
1153  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1154  labelToDesc[p->moduleLabel()] = p;
1155  ++i;
1156  }
1157  sort_all(moduleIDToIndex);
1158 
1159  i = 0;
1160  for (auto const& worker : allWorkers()) {
1161  std::vector<ModuleDescription const*>& modules = modulesWhoseProductsAreConsumedBy.at(i);
1162  worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1163  ++i;
1164  }
1165  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1089
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 1077 of file Schedule.cc.

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

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

1077  {
1078  std::vector<ModuleDescription const*> result;
1079  result.reserve(allWorkers().size());
1080 
1081  for (auto const& worker : allWorkers()) {
1082  ModuleDescription const* p = worker->descPtr();
1083  result.push_back(p);
1084  }
1085  return result;
1086  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1089
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 1181 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().

1181  {
1182  rep.eventSummary.totalEvents = 0;
1183  rep.eventSummary.totalEventsPassed = 0;
1184  rep.eventSummary.totalEventsFailed = 0;
1185  for(auto& s: streamSchedules_) {
1186  s->getTriggerReport(rep);
1187  }
1188  sort_all(rep.workerSummaries);
1189  }
rep
Definition: cuy.py:1188
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 1192 of file Schedule.cc.

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

Referenced by endJob().

1192  {
1193  rep.eventSummary.totalEvents = 0;
1194  rep.eventSummary.cpuTime = 0.;
1195  rep.eventSummary.realTime = 0.;
1196  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1197  }
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:302
rep
Definition: cuy.py:1188
void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists,
SubProcessParentageHelper const *  subProcessParentageHelper 
)
private

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

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

References streamSchedules_.

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

1131  {
1132  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1133  }
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 1122 of file Schedule.cc.

References streamSchedules_.

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

1124  {
1125  streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1126  }
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 1116 of file Schedule.cc.

References streamSchedules_.

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

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

Definition at line 986 of file Schedule.cc.

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

986  {
987  using std::placeholders::_1;
989  }
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 
)

Definition at line 1033 of file Schedule.cc.

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

1036  {
1037  assert(iStreamID<streamSchedules_.size());
1038  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask),ep,es,pathStatusInserters_);
1039  }
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:510
template<typename T >
void edm::Schedule::processOneGlobal ( typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 333 of file Schedule.h.

335  {
336  globalSchedule_->processOneGlobal<T>(ep,es,cleaningUpAfterException);
337  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:297
long double T
template<typename T >
void edm::Schedule::processOneGlobalAsync ( WaitingTaskHolder  iTask,
typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 341 of file Schedule.h.

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

344  {
345  globalSchedule_->processOneGlobalAsync<T>(iTaskHolder,ep,es,cleaningUpAfterException);
346  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:297
long double T
template<typename T >
void edm::Schedule::processOneStream ( unsigned int  iStreamID,
typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 313 of file Schedule.h.

316  {
317  assert(iStreamID<streamSchedules_.size());
318  streamSchedules_[iStreamID]->processOneStream<T>(ep,es,cleaningUpAfterException);
319  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
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,
bool  cleaningUpAfterException = false 
)

Definition at line 322 of file Schedule.h.

References eostools::move().

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

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

Definition at line 1014 of file Schedule.cc.

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

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

Definition at line 1009 of file Schedule.cc.

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

1009  {
1010  using std::placeholders::_1;
1011  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
1012  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1089
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:123
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 1001 of file Schedule.cc.

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

1001  {
1002  using std::placeholders::_1;
1003  // Return true iff at least one output module returns true.
1004  return (std::find_if (all_output_communicators_.begin(), all_output_communicators_.end(),
1006  != all_output_communicators_.end());
1007  }
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 677 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

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

References streamSchedules_.

Referenced by endJob().

1200  {
1201  int returnValue = 0;
1202  for(auto& s: streamSchedules_) {
1203  returnValue += s->totalEvents();
1204  }
1205  return returnValue;
1206  }
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 1218 of file Schedule.cc.

References streamSchedules_.

1218  {
1219  int returnValue = 0;
1220  for(auto& s: streamSchedules_) {
1221  returnValue += s->totalEventsFailed();
1222  }
1223  return returnValue;
1224  }
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 1209 of file Schedule.cc.

References streamSchedules_.

1209  {
1210  int returnValue = 0;
1211  for(auto& s: streamSchedules_) {
1212  returnValue += s->totalEventsPassed();
1213  }
1214  return returnValue;
1215  }
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 1105 of file Schedule.cc.

References pathNames_.

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

1105  {
1106  oLabelsToFill = *pathNames_;
1107 
1108  }
std::vector< std::string > const * pathNames_
Definition: Schedule.h:304
void edm::Schedule::writeLumi ( LuminosityBlockPrincipal const &  lbp,
ProcessContext const *  processContext 
)

Definition at line 996 of file Schedule.cc.

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

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

Definition at line 991 of file Schedule.cc.

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

991  {
992  using std::placeholders::_1;
993  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::writeRun, _1, std::cref(rp), processContext));
994  }
virtual void writeRun(RunPrincipal const &rp, ProcessContext const *)=0
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h: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().