CMS 3D CMS Logo

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

#include <Schedule.h>

Public Types

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

Public Member Functions

AllWorkers const & allWorkers () const
 returns the collection of pointers to workers More...
 
void availablePaths (std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill the labels for all paths in the process More...
 
void beginJob (ProductRegistry const &)
 
void beginStream (unsigned int)
 
bool changeModule (std::string const &iLabel, ParameterSet const &iPSet, const ProductRegistry &iRegistry)
 
void clearCounters ()
 Clear all the counters in the trigger report. More...
 
void closeOutputFiles ()
 
void enableEndPaths (bool active)
 
void endJob (ExceptionCollector &collector)
 
void endPaths (std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill the labels for all end paths in the process More...
 
bool endPathsEnabled () const
 
void endStream (unsigned int)
 
void fillModuleAndConsumesInfo (std::vector< ModuleDescription const * > &allModuleDescriptions, std::vector< std::pair< unsigned int, unsigned int > > &moduleIDToIndex, std::vector< std::vector< ModuleDescription const * > > &modulesWhoseProductsAreConsumedBy, ProductRegistry const &preg) const
 
std::vector< ModuleDescription const * > getAllModuleDescriptions () const
 
void getTriggerReport (TriggerReport &rep) const
 
void getTriggerTimingReport (TriggerTimingReport &rep) const
 
void moduleDescriptionsInEndPath (std::string const &iEndPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
 
void moduleDescriptionsInPath (std::string const &iPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
 
void modulesInPath (std::string const &iPathLabel, std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill in execution order the labels of all modules in path iPathLabel More...
 
void openNewOutputFilesIfNeeded ()
 
void openOutputFiles (FileBlock &fb)
 
void postForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
 
void preForkReleaseResources ()
 
void processOneEventAsync (WaitingTaskHolder iTask, unsigned int iStreamID, EventPrincipal &principal, EventSetup const &eventSetup)
 
template<typename T >
void processOneGlobal (typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
 
template<typename T >
void 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 &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_
 
volatile bool endpathsAreActive_
 
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
 
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
 
PreallocationConfiguration preallocConfig_
 
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
 
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
 
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
 
bool wantSummary_
 

Detailed Description

Definition at line 115 of file Schedule.h.

Member Typedef Documentation

Definition at line 119 of file Schedule.h.

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

Definition at line 118 of file Schedule.h.

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

Definition at line 117 of file Schedule.h.

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

Definition at line 121 of file Schedule.h.

Constructor & Destructor Documentation

edm::Schedule::Schedule ( ParameterSet proc_pset,
service::TriggerNamesService 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 372 of file Schedule.cc.

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

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

Member Function Documentation

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

returns the collection of pointers to workers

Definition at line 1020 of file Schedule.cc.

References globalSchedule_.

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

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

adds to oLabelsToFill the labels for all paths in the process

Definition at line 1025 of file Schedule.cc.

References streamSchedules_.

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

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

Definition at line 941 of file Schedule.cc.

References globalSchedule_.

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

Definition at line 945 of file Schedule.cc.

References streamSchedules_.

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

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

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

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

Clear all the counters in the trigger report.

Definition at line 1152 of file Schedule.cc.

References streamSchedules_.

1152  {
1153  for(auto& s: streamSchedules_) {
1154  s->clearCounters();
1155  }
1156  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
void edm::Schedule::closeOutputFiles ( )

Definition at line 898 of file Schedule.cc.

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

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

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

Definition at line 1092 of file Schedule.cc.

References endpathsAreActive_, and streamSchedules_.

1092  {
1093  endpathsAreActive_ = active;
1094  for(auto& s : streamSchedules_) {
1095  s->enableEndPaths(active);
1096  }
1097  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
volatile bool endpathsAreActive_
Definition: Schedule.h:304
void edm::Schedule::endJob ( ExceptionCollector collector)

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

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

References streamSchedules_.

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

1035  {
1036  streamSchedules_[0]->endPaths(oLabelsToFill);
1037  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
bool edm::Schedule::endPathsEnabled ( ) const

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

Definition at line 1100 of file Schedule.cc.

References endpathsAreActive_.

1100  {
1101  return endpathsAreActive_;
1102  }
volatile bool endpathsAreActive_
Definition: Schedule.h:304
void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 950 of file Schedule.cc.

References streamSchedules_.

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

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

1063  {
1064  allModuleDescriptions.clear();
1065  moduleIDToIndex.clear();
1066  modulesWhoseProductsAreConsumedBy.clear();
1067 
1068  allModuleDescriptions.reserve(allWorkers().size());
1069  moduleIDToIndex.reserve(allWorkers().size());
1070  modulesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1071 
1072  std::map<std::string, ModuleDescription const*> labelToDesc;
1073  unsigned int i = 0;
1074  for (auto const& worker : allWorkers()) {
1075  ModuleDescription const* p = worker->descPtr();
1076  allModuleDescriptions.push_back(p);
1077  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1078  labelToDesc[p->moduleLabel()] = p;
1079  ++i;
1080  }
1081  sort_all(moduleIDToIndex);
1082 
1083  i = 0;
1084  for (auto const& worker : allWorkers()) {
1085  std::vector<ModuleDescription const*>& modules = modulesWhoseProductsAreConsumedBy.at(i);
1086  worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1087  ++i;
1088  }
1089  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1020
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 1008 of file Schedule.cc.

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

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

1008  {
1009  std::vector<ModuleDescription const*> result;
1010  result.reserve(allWorkers().size());
1011 
1012  for (auto const& worker : allWorkers()) {
1013  ModuleDescription const* p = worker->descPtr();
1014  result.push_back(p);
1015  }
1016  return result;
1017  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1020
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 1105 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().

1105  {
1106  rep.eventSummary.totalEvents = 0;
1107  rep.eventSummary.totalEventsPassed = 0;
1108  rep.eventSummary.totalEventsFailed = 0;
1109  for(auto& s: streamSchedules_) {
1110  s->getTriggerReport(rep);
1111  }
1112  sort_all(rep.workerSummaries);
1113  }
rep
Definition: cuy.py:1188
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
void edm::Schedule::getTriggerTimingReport ( TriggerTimingReport rep) const

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

Definition at line 1116 of file Schedule.cc.

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

Referenced by endJob().

1116  {
1117  rep.eventSummary.totalEvents = 0;
1118  rep.eventSummary.cpuTime = 0.;
1119  rep.eventSummary.realTime = 0.;
1120  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1121  }
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:300
rep
Definition: cuy.py:1188
void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists,
SubProcessParentageHelper const *  subProcessParentageHelper 
)
private

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

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

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

Definition at line 1053 of file Schedule.cc.

References streamSchedules_.

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

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

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

Definition at line 1046 of file Schedule.cc.

References streamSchedules_.

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

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

Definition at line 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:292
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:292
void edm::Schedule::modulesInPath ( std::string const &  iPathLabel,
std::vector< std::string > &  oLabelsToFill 
) const

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

Definition at line 1040 of file Schedule.cc.

References streamSchedules_.

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

1041  {
1042  streamSchedules_[0]->modulesInPath(iPathLabel,oLabelsToFill);
1043  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
void edm::Schedule::openNewOutputFilesIfNeeded ( )

Definition at line 903 of file Schedule.cc.

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

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

Definition at line 908 of file Schedule.cc.

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

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

Definition at line 967 of file Schedule.cc.

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

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

Definition at line 963 of file Schedule.cc.

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

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

Definition at line 955 of file Schedule.cc.

References eostools::move(), and streamSchedules_.

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

Definition at line 329 of file Schedule.h.

331  {
332  globalSchedule_->processOneGlobal<T>(ep,es,cleaningUpAfterException);
333  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:295
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 337 of file Schedule.h.

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

340  {
341  globalSchedule_->processOneGlobalAsync<T>(iTaskHolder,ep,es,cleaningUpAfterException);
342  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:295
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 309 of file Schedule.h.

312  {
313  assert(iStreamID<streamSchedules_.size());
314  streamSchedules_[iStreamID]->processOneStream<T>(ep,es,cleaningUpAfterException);
315  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
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 318 of file Schedule.h.

References eostools::move().

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

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

Definition at line 936 of file Schedule.cc.

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

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

Definition at line 931 of file Schedule.cc.

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

931  {
932  using std::placeholders::_1;
933  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
934  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1020
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:115
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 923 of file Schedule.cc.

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

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

Return whether each output module has reached its maximum count.

Definition at line 594 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

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

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

Definition at line 1124 of file Schedule.cc.

References streamSchedules_.

Referenced by endJob().

1124  {
1125  int returnValue = 0;
1126  for(auto& s: streamSchedules_) {
1127  returnValue += s->totalEvents();
1128  }
1129  return returnValue;
1130  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
int edm::Schedule::totalEventsFailed ( ) const

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

Definition at line 1142 of file Schedule.cc.

References streamSchedules_.

1142  {
1143  int returnValue = 0;
1144  for(auto& s: streamSchedules_) {
1145  returnValue += s->totalEventsFailed();
1146  }
1147  return returnValue;
1148  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
int edm::Schedule::totalEventsPassed ( ) const

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

Definition at line 1133 of file Schedule.cc.

References streamSchedules_.

1133  {
1134  int returnValue = 0;
1135  for(auto& s: streamSchedules_) {
1136  returnValue += s->totalEventsPassed();
1137  }
1138  return returnValue;
1139  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:293
void edm::Schedule::triggerPaths ( std::vector< std::string > &  oLabelsToFill) const

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

Definition at line 1030 of file Schedule.cc.

References streamSchedules_.

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

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

Definition at line 918 of file Schedule.cc.

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

918  {
919  using std::placeholders::_1;
920  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::writeLumi, _1, std::cref(lbp), processContext));
921  }
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:297
void edm::Schedule::writeRun ( RunPrincipal const &  rp,
ProcessContext const *  processContext 
)

Definition at line 913 of file Schedule.cc.

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

913  {
914  using std::placeholders::_1;
915  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::writeRun, _1, std::cref(rp), processContext));
916  }
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:297

Member Data Documentation

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

Definition at line 304 of file Schedule.h.

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

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

Definition at line 295 of file Schedule.h.

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

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

Definition at line 292 of file Schedule.h.

Referenced by changeModule(), and Schedule().

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 298 of file Schedule.h.

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

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

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

Referenced by getTriggerTimingReport(), and Schedule().

bool edm::Schedule::wantSummary_
private

Definition at line 302 of file Schedule.h.

Referenced by endJob(), and Schedule().