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 &, eventsetup::ESRecordsToProxyIndices const &)
 
void beginStream (unsigned int)
 
bool changeModule (std::string const &iLabel, ParameterSet const &iPSet, const ProductRegistry &iRegistry, eventsetup::ESRecordsToProxyIndices const &)
 
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, EventSetupImpl const &eventSetup, ServiceToken const &token)
 
template<typename T >
void processOneGlobalAsync (WaitingTaskHolder iTask, typename T::MyPrincipal &principal, EventSetupImpl const &eventSetup, ServiceToken const &token, bool cleaningUpAfterException=false)
 
template<typename T >
void processOneStreamAsync (WaitingTaskHolder iTask, unsigned int iStreamID, typename T::MyPrincipal &principal, EventSetupImpl const &eventSetup, ServiceToken const &token, bool cleaningUpAfterException=false)
 
void respondToCloseInputFile (FileBlock const &fb)
 
void respondToOpenInputFile (FileBlock const &fb)
 
 Schedule (ParameterSet &proc_pset, service::TriggerNamesService const &tns, ProductRegistry &pregistry, BranchIDListHelper &branchIDListHelper, ThinnedAssociationsHelper &thinnedAssociationsHelper, SubProcessParentageHelper const *subProcessParentageHelper, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration > processConfiguration, bool hasSubprocesses, PreallocationConfiguration const &config, ProcessContext const *processContext)
 
bool shouldWeCloseOutput () const
 
bool terminate () const
 Return whether each output module has reached its maximum count. More...
 
int totalEvents () const
 
int totalEventsFailed () const
 
int totalEventsPassed () const
 
void triggerPaths (std::vector< std::string > &oLabelsToFill) const
 
void writeLumiAsync (WaitingTaskHolder iTask, LuminosityBlockPrincipal const &lbp, ProcessContext const *, ActivityRegistry *)
 
void writeRunAsync (WaitingTaskHolder iTask, RunPrincipal const &rp, ProcessContext const *, ActivityRegistry *, MergeableRunProductMetadata const *)
 

Private Member Functions

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

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 122 of file Schedule.h.

Member Typedef Documentation

◆ AllOutputModuleCommunicators

Definition at line 126 of file Schedule.h.

◆ AllWorkers

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

Definition at line 125 of file Schedule.h.

◆ vstring

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

Definition at line 124 of file Schedule.h.

◆ Workers

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

Definition at line 128 of file Schedule.h.

Constructor & Destructor Documentation

◆ Schedule()

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 584 of file Schedule.cc.

596  : //Only create a resultsInserter if there is a trigger path
597  resultsInserter_{tns.getTrigPaths().empty()
598  ? std::shared_ptr<TriggerResultInserter>{}
599  : makeInserter(proc_pset, prealloc, preg, actions, areg, processConfiguration)},
600  moduleRegistry_(new ModuleRegistry()),
602  preallocConfig_(prealloc),
603  pathNames_(&tns.getTrigPaths()),
604  endPathNames_(&tns.getEndPaths()),
605  wantSummary_(tns.wantSummary()),
606  endpathsAreActive_(true) {
607  makePathStatusInserters(pathStatusInserters_,
608  *pathNames_,
609  prealloc,
610  preg,
611  areg,
612  processConfiguration,
613  std::string("PathStatusInserter"));
614 
615  makePathStatusInserters(endPathStatusInserters_,
616  *endPathNames_,
617  prealloc,
618  preg,
619  areg,
620  processConfiguration,
621  std::string("EndPathStatusInserter"));
622 
623  assert(0 < prealloc.numberOfStreams());
624  streamSchedules_.reserve(prealloc.numberOfStreams());
625  for (unsigned int i = 0; i < prealloc.numberOfStreams(); ++i) {
626  streamSchedules_.emplace_back(make_shared_noexcept_false<StreamSchedule>(resultsInserter(),
629  moduleRegistry(),
630  proc_pset,
631  tns,
632  prealloc,
633  preg,
634  branchIDListHelper,
635  actions,
636  areg,
637  processConfiguration,
638  !hasSubprocesses,
639  StreamID{i},
640  processContext));
641  }
642 
643  //TriggerResults are injected automatically by StreamSchedules and are
644  // unknown to the ModuleRegistry
645  const std::string kTriggerResults("TriggerResults");
646  std::vector<std::string> modulesToUse;
647  modulesToUse.reserve(streamSchedules_[0]->allWorkers().size());
648  for (auto const& worker : streamSchedules_[0]->allWorkers()) {
649  if (worker->description().moduleLabel() != kTriggerResults) {
650  modulesToUse.push_back(worker->description().moduleLabel());
651  }
652  }
653  //The unscheduled modules are at the end of the list, but we want them at the front
654  unsigned int const nUnscheduledModules = streamSchedules_[0]->numberOfUnscheduledModules();
655  if (nUnscheduledModules > 0) {
656  std::vector<std::string> temp;
657  temp.reserve(modulesToUse.size());
658  auto itBeginUnscheduled = modulesToUse.begin() + modulesToUse.size() - nUnscheduledModules;
659  std::copy(itBeginUnscheduled, modulesToUse.end(), std::back_inserter(temp));
660  std::copy(modulesToUse.begin(), itBeginUnscheduled, std::back_inserter(temp));
661  temp.swap(modulesToUse);
662  }
663 
664  // propagate_const<T> has no reset() function
665  globalSchedule_ = std::make_unique<GlobalSchedule>(resultsInserter(),
668  moduleRegistry(),
669  modulesToUse,
670  proc_pset,
671  preg,
672  prealloc,
673  actions,
674  areg,
675  processConfiguration,
676  processContext);
677 
678  //TriggerResults is not in the top level ParameterSet so the call to
679  // reduceParameterSet would fail to find it. Just remove it up front.
680  std::set<std::string> usedModuleLabels;
681  for (auto const& worker : allWorkers()) {
682  if (worker->description().moduleLabel() != kTriggerResults) {
683  usedModuleLabels.insert(worker->description().moduleLabel());
684  }
685  }
686  std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string>>("@all_modules"));
687  std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
688  reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels, outputModulePathPositions);
689  processEDAliases(proc_pset, processConfiguration->processName(), preg);
690 
691  // At this point all BranchDescriptions are created. Mark now the
692  // ones of unscheduled workers to be on-demand.
693  if (nUnscheduledModules > 0) {
694  std::set<std::string> unscheduledModules(modulesToUse.begin(), modulesToUse.begin() + nUnscheduledModules);
695  preg.setUnscheduledProducts(unscheduledModules);
696  }
697 
698  processSwitchProducers(proc_pset, processConfiguration->processName(), preg);
699  proc_pset.registerIt();
700  processConfiguration->setParameterSetID(proc_pset.id());
701  processConfiguration->setProcessConfigurationID();
702 
703  // This is used for a little sanity-check to make sure no code
704  // modifications alter the number of workers at a later date.
705  size_t all_workers_count = allWorkers().size();
706 
707  moduleRegistry_->forAllModuleHolders([this](maker::ModuleHolder* iHolder) {
708  auto comm = iHolder->createOutputModuleCommunicator();
709  if (comm) {
710  all_output_communicators_.emplace_back(std::shared_ptr<OutputModuleCommunicator>{comm.release()});
711  }
712  });
713  // Now that the output workers are filled in, set any output limits or information.
714  limitOutput(proc_pset, branchIDListHelper.branchIDLists(), subProcessParentageHelper);
715 
716  // Sanity check: make sure nobody has added a worker after we've
717  // already relied on the WorkerManager being full.
718  assert(all_workers_count == allWorkers().size());
719 
720  branchIDListHelper.updateFromRegistry(preg);
721 
722  for (auto const& worker : streamSchedules_[0]->allWorkers()) {
723  worker->registerThinnedAssociations(preg, thinnedAssociationsHelper);
724  }
725  thinnedAssociationsHelper.sort();
726 
727  // The output modules consume products in kept branches.
728  // So we must set this up before freezing.
729  for (auto& c : all_output_communicators_) {
730  c->selectProducts(preg, thinnedAssociationsHelper);
731  }
732 
733  for (auto& product : preg.productListUpdator()) {
734  setIsMergeable(product.second);
735  }
736 
737  {
738  // We now get a collection of types that may be consumed.
739  std::set<TypeID> productTypesConsumed;
740  std::set<TypeID> elementTypesConsumed;
741  // Loop over all modules
742  for (auto const& worker : allWorkers()) {
743  for (auto const& consumesInfo : worker->consumesInfo()) {
744  if (consumesInfo.kindOfType() == PRODUCT_TYPE) {
745  productTypesConsumed.emplace(consumesInfo.type());
746  } else {
747  elementTypesConsumed.emplace(consumesInfo.type());
748  }
749  }
750  }
751  // The SubProcess class is not a module, yet it may consume.
752  if (hasSubprocesses) {
753  productTypesConsumed.emplace(typeid(TriggerResults));
754  }
755  // The RandomNumberGeneratorService is not a module, yet it consumes.
756  { RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed); }
757  preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
758  }
759 
760  for (auto& c : all_output_communicators_) {
761  c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
762  }
763 
764  if (wantSummary_) {
765  std::vector<const ModuleDescription*> modDesc;
766  const auto& workers = allWorkers();
767  modDesc.reserve(workers.size());
768 
769  std::transform(workers.begin(),
770  workers.end(),
771  std::back_inserter(modDesc),
772  [](const Worker* iWorker) -> const ModuleDescription* { return iWorker->descPtr(); });
773 
774  // propagate_const<T> has no reset() function
775  summaryTimeKeeper_ = std::make_unique<SystemTimeKeeper>(prealloc.numberOfStreams(), modDesc, tns, processContext);
776  auto timeKeeperPtr = summaryTimeKeeper_.get();
777 
778  areg->watchPreModuleEvent(timeKeeperPtr, &SystemTimeKeeper::startModuleEvent);
779  areg->watchPostModuleEvent(timeKeeperPtr, &SystemTimeKeeper::stopModuleEvent);
780  areg->watchPreModuleEventAcquire(timeKeeperPtr, &SystemTimeKeeper::restartModuleEvent);
781  areg->watchPostModuleEventAcquire(timeKeeperPtr, &SystemTimeKeeper::stopModuleEvent);
782  areg->watchPreModuleEventDelayedGet(timeKeeperPtr, &SystemTimeKeeper::pauseModuleEvent);
783  areg->watchPostModuleEventDelayedGet(timeKeeperPtr, &SystemTimeKeeper::restartModuleEvent);
784 
785  areg->watchPreSourceEvent(timeKeeperPtr, &SystemTimeKeeper::startEvent);
786  areg->watchPostEvent(timeKeeperPtr, &SystemTimeKeeper::stopEvent);
787 
788  areg->watchPrePathEvent(timeKeeperPtr, &SystemTimeKeeper::startPath);
789  areg->watchPostPathEvent(timeKeeperPtr, &SystemTimeKeeper::stopPath);
790 
791  areg->watchPostBeginJob(timeKeeperPtr, &SystemTimeKeeper::startProcessingLoop);
792  areg->watchPreEndJob(timeKeeperPtr, &SystemTimeKeeper::stopProcessingLoop);
793  //areg->preModuleEventSignal_.connect([timeKeeperPtr](StreamContext const& iContext, ModuleCallingContext const& iMod) {
794  //timeKeeperPtr->startModuleEvent(iContext,iMod);
795  //});
796  }
797 
798  } // Schedule::Schedule

References actions, and edm::service::TriggerNamesService::getTrigPaths().

Member Function Documentation

◆ allWorkers()

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

◆ availablePaths()

void edm::Schedule::availablePaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all paths in the process

Definition at line 1330 of file Schedule.cc.

1330  {
1331  streamSchedules_[0]->availablePaths(oLabelsToFill);
1332  }

References streamSchedules_.

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

◆ beginJob()

void edm::Schedule::beginJob ( ProductRegistry const &  iRegistry,
eventsetup::ESRecordsToProxyIndices const &  iESIndices 
)

Definition at line 1243 of file Schedule.cc.

1243  {
1244  globalSchedule_->beginJob(iRegistry, iESIndices);
1245  }

References globalSchedule_.

◆ beginStream()

void edm::Schedule::beginStream ( unsigned int  iStreamID)

Definition at line 1247 of file Schedule.cc.

1247  {
1248  assert(iStreamID < streamSchedules_.size());
1249  streamSchedules_[iStreamID]->beginStream();
1250  }

References cms::cuda::assert(), and streamSchedules_.

◆ changeModule()

bool edm::Schedule::changeModule ( std::string const &  iLabel,
ParameterSet const &  iPSet,
const ProductRegistry iRegistry,
eventsetup::ESRecordsToProxyIndices const &  iIndices 
)

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

Definition at line 1266 of file Schedule.cc.

1269  {
1270  Worker* found = nullptr;
1271  for (auto const& worker : allWorkers()) {
1272  if (worker->description().moduleLabel() == iLabel) {
1273  found = worker;
1274  break;
1275  }
1276  }
1277  if (nullptr == found) {
1278  return false;
1279  }
1280 
1281  auto newMod = moduleRegistry_->replaceModule(iLabel, iPSet, preallocConfig_);
1282 
1283  globalSchedule_->replaceModule(newMod, iLabel);
1284 
1285  for (auto& s : streamSchedules_) {
1286  s->replaceModule(newMod, iLabel);
1287  }
1288 
1289  {
1290  //Need to updateLookup in order to make getByToken work
1291  auto const runLookup = iRegistry.productLookup(InRun);
1292  auto const lumiLookup = iRegistry.productLookup(InLumi);
1293  auto const eventLookup = iRegistry.productLookup(InEvent);
1294  found->updateLookup(InRun, *runLookup);
1295  found->updateLookup(InLumi, *lumiLookup);
1296  found->updateLookup(InEvent, *eventLookup);
1297  found->updateLookup(iIndices);
1298 
1299  auto const& processName = newMod->moduleDescription().processName();
1300  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1301  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1302  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1303  found->resolvePutIndicies(InRun, runModuleToIndicies);
1304  found->resolvePutIndicies(InLumi, lumiModuleToIndicies);
1305  found->resolvePutIndicies(InEvent, eventModuleToIndicies);
1306  }
1307 
1308  return true;
1309  }

References allWorkers(), newFWLiteAna::found, globalSchedule_, edm::InEvent, edm::InLumi, edm::InRun, moduleRegistry_, preallocConfig_, SimL1EmulatorRepack_CalouGT_cff::processName, edm::ProductRegistry::productLookup(), alignCSCRings::s, and streamSchedules_.

◆ clearCounters()

void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1436 of file Schedule.cc.

1436  {
1437  for (auto& s : streamSchedules_) {
1438  s->clearCounters();
1439  }
1440  }

References alignCSCRings::s, and streamSchedules_.

◆ closeOutputFiles()

void edm::Schedule::closeOutputFiles ( )

Definition at line 1137 of file Schedule.cc.

1137  {
1138  using std::placeholders::_1;
1140  }

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

◆ convertCurrentProcessAlias()

void edm::Schedule::convertCurrentProcessAlias ( std::string const &  processName)

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

Definition at line 1324 of file Schedule.cc.

1324  {
1325  for (auto const& worker : allWorkers()) {
1326  worker->convertCurrentProcessAlias(processName);
1327  }
1328  }

References allWorkers(), and SimL1EmulatorRepack_CalouGT_cff::processName.

◆ enableEndPaths()

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 1386 of file Schedule.cc.

1386  {
1387  endpathsAreActive_ = active;
1388  for (auto& s : streamSchedules_) {
1389  s->enableEndPaths(active);
1390  }
1391  }

References endpathsAreActive_, alignCSCRings::s, and streamSchedules_.

◆ endJob()

void edm::Schedule::endJob ( ExceptionCollector collector)

Definition at line 856 of file Schedule.cc.

856  {
857  globalSchedule_->endJob(collector);
858  if (collector.hasThrown()) {
859  return;
860  }
861 
862  if (wantSummary_ == false)
863  return;
864  {
865  TriggerReport tr;
866  getTriggerReport(tr);
867 
868  // The trigger report (pass/fail etc.):
869 
870  LogVerbatim("FwkSummary") << "";
871  if (streamSchedules_[0]->context().processContext()->isSubProcess()) {
872  LogVerbatim("FwkSummary") << "TrigReport Process: "
873  << streamSchedules_[0]->context().processContext()->processName();
874  }
875  LogVerbatim("FwkSummary") << "TrigReport "
876  << "---------- Event Summary ------------";
877  if (!tr.trigPathSummaries.empty()) {
878  LogVerbatim("FwkSummary") << "TrigReport"
879  << " Events total = " << tr.eventSummary.totalEvents
880  << " passed = " << tr.eventSummary.totalEventsPassed
881  << " failed = " << tr.eventSummary.totalEventsFailed << "";
882  } else {
883  LogVerbatim("FwkSummary") << "TrigReport"
884  << " Events total = " << tr.eventSummary.totalEvents
885  << " passed = " << tr.eventSummary.totalEvents << " failed = 0";
886  }
887 
888  LogVerbatim("FwkSummary") << "";
889  LogVerbatim("FwkSummary") << "TrigReport "
890  << "---------- Path Summary ------------";
891  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
892  << " " << std::right << std::setw(10) << "Executed"
893  << " " << std::right << std::setw(10) << "Passed"
894  << " " << std::right << std::setw(10) << "Failed"
895  << " " << std::right << std::setw(10) << "Error"
896  << " "
897  << "Name"
898  << "";
899  for (auto const& p : tr.trigPathSummaries) {
900  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
901  << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " "
902  << std::right << std::setw(10) << p.timesPassed << " " << std::right << std::setw(10)
903  << p.timesFailed << " " << std::right << std::setw(10) << p.timesExcept << " "
904  << p.name << "";
905  }
906 
907  /*
908  std::vector<int>::const_iterator epi = empty_trig_paths_.begin();
909  std::vector<int>::const_iterator epe = empty_trig_paths_.end();
910  std::vector<std::string>::const_iterator epn = empty_trig_path_names_.begin();
911  for (; epi != epe; ++epi, ++epn) {
912 
913  LogVerbatim("FwkSummary") << "TrigReport "
914  << std::right << std::setw(5) << 1
915  << std::right << std::setw(5) << *epi << " "
916  << std::right << std::setw(10) << totalEvents() << " "
917  << std::right << std::setw(10) << totalEvents() << " "
918  << std::right << std::setw(10) << 0 << " "
919  << std::right << std::setw(10) << 0 << " "
920  << *epn << "";
921  }
922  */
923 
924  LogVerbatim("FwkSummary") << "";
925  LogVerbatim("FwkSummary") << "TrigReport "
926  << "-------End-Path Summary ------------";
927  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
928  << " " << std::right << std::setw(10) << "Executed"
929  << " " << std::right << std::setw(10) << "Passed"
930  << " " << std::right << std::setw(10) << "Failed"
931  << " " << std::right << std::setw(10) << "Error"
932  << " "
933  << "Name"
934  << "";
935  for (auto const& p : tr.endPathSummaries) {
936  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
937  << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " "
938  << std::right << std::setw(10) << p.timesPassed << " " << std::right << std::setw(10)
939  << p.timesFailed << " " << std::right << std::setw(10) << p.timesExcept << " "
940  << p.name << "";
941  }
942 
943  for (auto const& p : tr.trigPathSummaries) {
944  LogVerbatim("FwkSummary") << "";
945  LogVerbatim("FwkSummary") << "TrigReport "
946  << "---------- Modules in Path: " << p.name << " ------------";
947  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
948  << " " << std::right << std::setw(10) << "Visited"
949  << " " << std::right << std::setw(10) << "Passed"
950  << " " << std::right << std::setw(10) << "Failed"
951  << " " << std::right << std::setw(10) << "Error"
952  << " "
953  << "Name"
954  << "";
955 
956  unsigned int bitpos = 0;
957  for (auto const& mod : p.moduleInPathSummaries) {
958  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
959  << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " "
960  << std::right << std::setw(10) << mod.timesPassed << " " << std::right
961  << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10)
962  << mod.timesExcept << " " << mod.moduleLabel << "";
963  ++bitpos;
964  }
965  }
966 
967  for (auto const& p : tr.endPathSummaries) {
968  LogVerbatim("FwkSummary") << "";
969  LogVerbatim("FwkSummary") << "TrigReport "
970  << "------ Modules in End-Path: " << p.name << " ------------";
971  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
972  << " " << std::right << std::setw(10) << "Visited"
973  << " " << std::right << std::setw(10) << "Passed"
974  << " " << std::right << std::setw(10) << "Failed"
975  << " " << std::right << std::setw(10) << "Error"
976  << " "
977  << "Name"
978  << "";
979 
980  unsigned int bitpos = 0;
981  for (auto const& mod : p.moduleInPathSummaries) {
982  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
983  << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " "
984  << std::right << std::setw(10) << mod.timesPassed << " " << std::right
985  << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10)
986  << mod.timesExcept << " " << mod.moduleLabel << "";
987  ++bitpos;
988  }
989  }
990 
991  LogVerbatim("FwkSummary") << "";
992  LogVerbatim("FwkSummary") << "TrigReport "
993  << "---------- Module Summary ------------";
994  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Visited"
995  << " " << std::right << std::setw(10) << "Executed"
996  << " " << std::right << std::setw(10) << "Passed"
997  << " " << std::right << std::setw(10) << "Failed"
998  << " " << std::right << std::setw(10) << "Error"
999  << " "
1000  << "Name"
1001  << "";
1002  for (auto const& worker : tr.workerSummaries) {
1003  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << worker.timesVisited << " "
1004  << std::right << std::setw(10) << worker.timesRun << " " << std::right
1005  << std::setw(10) << worker.timesPassed << " " << std::right << std::setw(10)
1006  << worker.timesFailed << " " << std::right << std::setw(10) << worker.timesExcept
1007  << " " << worker.moduleLabel << "";
1008  }
1009  LogVerbatim("FwkSummary") << "";
1010  }
1011  // The timing report (CPU and Real Time):
1012  TriggerTimingReport tr;
1014 
1015  const int totalEvents = std::max(1, tr.eventSummary.totalEvents);
1016 
1017  LogVerbatim("FwkSummary") << "TimeReport "
1018  << "---------- Event Summary ---[sec]----";
1019  LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1020  << " event loop CPU/event = " << tr.eventSummary.cpuTime / totalEvents;
1021  LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1022  << " event loop Real/event = " << tr.eventSummary.realTime / totalEvents;
1023  LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1024  << " sum Streams Real/event = " << tr.eventSummary.sumStreamRealTime / totalEvents;
1025  LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed << " efficiency CPU/Real/thread = "
1026  << tr.eventSummary.cpuTime / tr.eventSummary.realTime / preallocConfig_.numberOfThreads();
1027 
1028  constexpr int kColumn1Size = 10;
1029  constexpr int kColumn2Size = 12;
1030  constexpr int kColumn3Size = 12;
1031  LogVerbatim("FwkSummary") << "";
1032  LogVerbatim("FwkSummary") << "TimeReport "
1033  << "---------- Path Summary ---[Real sec]----";
1034  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1035  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1036  << " Name";
1037  for (auto const& p : tr.trigPathSummaries) {
1038  const int timesRun = std::max(1, p.timesRun);
1039  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1040  << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right
1041  << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << "";
1042  }
1043  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1044  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1045  << " Name"
1046  << "";
1047 
1048  LogVerbatim("FwkSummary") << "";
1049  LogVerbatim("FwkSummary") << "TimeReport "
1050  << "-------End-Path Summary ---[Real sec]----";
1051  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1052  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1053  << " Name"
1054  << "";
1055  for (auto const& p : tr.endPathSummaries) {
1056  const int timesRun = std::max(1, p.timesRun);
1057 
1058  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1059  << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right
1060  << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << "";
1061  }
1062  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1063  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1064  << " Name"
1065  << "";
1066 
1067  for (auto const& p : tr.trigPathSummaries) {
1068  LogVerbatim("FwkSummary") << "";
1069  LogVerbatim("FwkSummary") << "TimeReport "
1070  << "---------- Modules in Path: " << p.name << " ---[Real sec]----";
1071  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1072  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1073  << " Name"
1074  << "";
1075  for (auto const& mod : p.moduleInPathSummaries) {
1076  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1077  << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right
1078  << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " "
1079  << mod.moduleLabel << "";
1080  }
1081  }
1082  if (not tr.trigPathSummaries.empty()) {
1083  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1084  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1085  << " Name"
1086  << "";
1087  }
1088  for (auto const& p : tr.endPathSummaries) {
1089  LogVerbatim("FwkSummary") << "";
1090  LogVerbatim("FwkSummary") << "TimeReport "
1091  << "------ Modules in End-Path: " << p.name << " ---[Real sec]----";
1092  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1093  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1094  << " Name"
1095  << "";
1096  for (auto const& mod : p.moduleInPathSummaries) {
1097  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1098  << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right
1099  << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " "
1100  << mod.moduleLabel << "";
1101  }
1102  }
1103  if (not tr.endPathSummaries.empty()) {
1104  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1105  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1106  << " Name"
1107  << "";
1108  }
1109  LogVerbatim("FwkSummary") << "";
1110  LogVerbatim("FwkSummary") << "TimeReport "
1111  << "---------- Module Summary ---[Real sec]----";
1112  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1113  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1114  << " " << std::right << std::setw(kColumn3Size) << "per visit"
1115  << " Name"
1116  << "";
1117  for (auto const& worker : tr.workerSummaries) {
1118  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1119  << std::setw(kColumn1Size) << worker.realTime / totalEvents << " " << std::right
1120  << std::setw(kColumn2Size) << worker.realTime / std::max(1, worker.timesRun) << " "
1121  << std::right << std::setw(kColumn3Size)
1122  << worker.realTime / std::max(1, worker.timesVisited) << " " << worker.moduleLabel
1123  << "";
1124  }
1125  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1126  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1127  << " " << std::right << std::setw(kColumn3Size) << "per visit"
1128  << " Name"
1129  << "";
1130 
1131  LogVerbatim("FwkSummary") << "";
1132  LogVerbatim("FwkSummary") << "T---Report end!"
1133  << "";
1134  LogVerbatim("FwkSummary") << "";
1135  }

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

◆ endPaths()

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 1336 of file Schedule.cc.

1336 { oLabelsToFill = *endPathNames_; }

References endPathNames_.

◆ endPathsEnabled()

bool edm::Schedule::endPathsEnabled ( ) const

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

Definition at line 1393 of file Schedule.cc.

1393 { return endpathsAreActive_; }

References endpathsAreActive_.

◆ endStream()

void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 1252 of file Schedule.cc.

1252  {
1253  assert(iStreamID < streamSchedules_.size());
1254  streamSchedules_[iStreamID]->endStream();
1255  }

References cms::cuda::assert(), and streamSchedules_.

◆ fillModuleAndConsumesInfo()

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 1354 of file Schedule.cc.

1358  {
1359  allModuleDescriptions.clear();
1360  moduleIDToIndex.clear();
1361  modulesWhoseProductsAreConsumedBy.clear();
1362 
1363  allModuleDescriptions.reserve(allWorkers().size());
1364  moduleIDToIndex.reserve(allWorkers().size());
1365  modulesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1366 
1367  std::map<std::string, ModuleDescription const*> labelToDesc;
1368  unsigned int i = 0;
1369  for (auto const& worker : allWorkers()) {
1370  ModuleDescription const* p = worker->descPtr();
1371  allModuleDescriptions.push_back(p);
1372  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1373  labelToDesc[p->moduleLabel()] = p;
1374  ++i;
1375  }
1376  sort_all(moduleIDToIndex);
1377 
1378  i = 0;
1379  for (auto const& worker : allWorkers()) {
1380  std::vector<ModuleDescription const*>& modules = modulesWhoseProductsAreConsumedBy.at(i);
1381  worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1382  ++i;
1383  }
1384  }

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

◆ getAllModuleDescriptions()

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 1311 of file Schedule.cc.

1311  {
1312  std::vector<ModuleDescription const*> result;
1313  result.reserve(allWorkers().size());
1314 
1315  for (auto const& worker : allWorkers()) {
1316  ModuleDescription const* p = worker->descPtr();
1317  result.push_back(p);
1318  }
1319  return result;
1320  }

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

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

◆ getTriggerReport()

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 1395 of file Schedule.cc.

1395  {
1396  rep.eventSummary.totalEvents = 0;
1397  rep.eventSummary.totalEventsPassed = 0;
1398  rep.eventSummary.totalEventsFailed = 0;
1399  for (auto& s : streamSchedules_) {
1400  s->getTriggerReport(rep);
1401  }
1402  sort_all(rep.workerSummaries);
1403  }

References cuy::rep, alignCSCRings::s, edm::sort_all(), and streamSchedules_.

Referenced by endJob().

◆ getTriggerTimingReport()

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 1405 of file Schedule.cc.

1405  {
1406  rep.eventSummary.totalEvents = 0;
1407  rep.eventSummary.cpuTime = 0.;
1408  rep.eventSummary.realTime = 0.;
1409  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1410  }

References cuy::rep, and summaryTimeKeeper_.

Referenced by endJob().

◆ limitOutput()

void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists,
SubProcessParentageHelper const *  subProcessParentageHelper 
)
private

Definition at line 800 of file Schedule.cc.

802  {
803  std::string const output("output");
804 
805  ParameterSet const& maxEventsPSet = proc_pset.getUntrackedParameterSet("maxEvents");
806  int maxEventSpecs = 0;
807  int maxEventsOut = -1;
808  ParameterSet const* vMaxEventsOut = nullptr;
809  std::vector<std::string> intNamesE = maxEventsPSet.getParameterNamesForType<int>(false);
810  if (search_all(intNamesE, output)) {
811  maxEventsOut = maxEventsPSet.getUntrackedParameter<int>(output);
812  ++maxEventSpecs;
813  }
814  std::vector<std::string> psetNamesE;
815  maxEventsPSet.getParameterSetNames(psetNamesE, false);
816  if (search_all(psetNamesE, output)) {
817  vMaxEventsOut = &maxEventsPSet.getUntrackedParameterSet(output);
818  ++maxEventSpecs;
819  }
820 
821  if (maxEventSpecs > 1) {
823  << "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
824  }
825 
826  for (auto& c : all_output_communicators_) {
827  OutputModuleDescription desc(branchIDLists, maxEventsOut, subProcessParentageHelper);
828  if (vMaxEventsOut != nullptr && !vMaxEventsOut->empty()) {
829  std::string const& moduleLabel = c->description().moduleLabel();
830  try {
831  desc.maxEvents_ = vMaxEventsOut->getUntrackedParameter<int>(moduleLabel);
832  } catch (Exception const&) {
834  << "\nNo entry in 'maxEvents' for output module label '" << moduleLabel << "'.\n";
835  }
836  }
837  c->configure(desc);
838  }
839  }

References all_output_communicators_, HltBtagPostValidation_cff::c, edm::errors::Configuration, edm::ParameterSet::empty(), Exception, edm::ParameterSet::getParameterNamesForType(), edm::ParameterSet::getParameterSetNames(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), edm::OutputModuleDescription::maxEvents_, HerwigMaxPtPartonFilter_cfi::moduleLabel, convertSQLitetoXML_cfg::output, edm::search_all(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ moduleDescriptionsInEndPath()

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 1348 of file Schedule.cc.

1350  {
1351  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1352  }

References streamSchedules_.

◆ moduleDescriptionsInPath()

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 1342 of file Schedule.cc.

1344  {
1345  streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1346  }

References streamSchedules_.

◆ moduleRegistry() [1/2]

std::shared_ptr<ModuleRegistry>& edm::Schedule::moduleRegistry ( )
inlineprivate

Definition at line 295 of file Schedule.h.

References edm::get_underlying_safe(), and moduleRegistry_.

◆ moduleRegistry() [2/2]

std::shared_ptr<ModuleRegistry const> edm::Schedule::moduleRegistry ( ) const
inlineprivate

Definition at line 294 of file Schedule.h.

References edm::get_underlying_safe(), and moduleRegistry_.

◆ modulesInPath()

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 1338 of file Schedule.cc.

1338  {
1339  streamSchedules_[0]->modulesInPath(iPathLabel, oLabelsToFill);
1340  }

References streamSchedules_.

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

◆ openOutputFiles()

void edm::Schedule::openOutputFiles ( FileBlock fb)

Definition at line 1142 of file Schedule.cc.

1142  {
1143  using std::placeholders::_1;
1145  }

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

◆ processOneEventAsync()

void edm::Schedule::processOneEventAsync ( WaitingTaskHolder  iTask,
unsigned int  iStreamID,
EventPrincipal principal,
EventSetupImpl const &  eventSetup,
ServiceToken const &  token 
)

Definition at line 1257 of file Schedule.cc.

1261  {
1262  assert(iStreamID < streamSchedules_.size());
1263  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask), ep, es, token, pathStatusInserters_);
1264  }

References cms::cuda::assert(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, eostools::move(), pathStatusInserters_, streamSchedules_, and unpackBuffers-CaloStage2::token.

◆ processOneGlobalAsync()

template<typename T >
void edm::Schedule::processOneGlobalAsync ( WaitingTaskHolder  iTask,
typename T::MyPrincipal &  principal,
EventSetupImpl const &  eventSetup,
ServiceToken const &  token,
bool  cleaningUpAfterException = false 
)

Definition at line 330 of file Schedule.h.

334  {
335  globalSchedule_->processOneGlobalAsync<T>(iTaskHolder, ep, es, token, cleaningUpAfterException);
336  }

References SiStripBadComponentsDQMServiceTemplate_cfg::ep, globalSchedule_, and unpackBuffers-CaloStage2::token.

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

◆ processOneStreamAsync()

template<typename T >
void edm::Schedule::processOneStreamAsync ( WaitingTaskHolder  iTask,
unsigned int  iStreamID,
typename T::MyPrincipal &  principal,
EventSetupImpl const &  eventSetup,
ServiceToken const &  token,
bool  cleaningUpAfterException = false 
)

Definition at line 318 of file Schedule.h.

323  {
324  assert(iStreamID < streamSchedules_.size());
325  streamSchedules_[iStreamID]->processOneStreamAsync<T>(
326  std::move(iTaskHolder), ep, es, token, cleaningUpAfterException);
327  }

References cms::cuda::assert(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, eostools::move(), streamSchedules_, and unpackBuffers-CaloStage2::token.

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

◆ respondToCloseInputFile()

void edm::Schedule::respondToCloseInputFile ( FileBlock const &  fb)

Definition at line 1238 of file Schedule.cc.

1238  {
1239  using std::placeholders::_1;
1240  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
1241  }

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

◆ respondToOpenInputFile()

void edm::Schedule::respondToOpenInputFile ( FileBlock const &  fb)

Definition at line 1233 of file Schedule.cc.

1233  {
1234  using std::placeholders::_1;
1235  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
1236  }

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

◆ resultsInserter() [1/2]

std::shared_ptr<TriggerResultInserter>& edm::Schedule::resultsInserter ( )
inlineprivate

Definition at line 293 of file Schedule.h.

References edm::get_underlying_safe(), and resultsInserter_.

◆ resultsInserter() [2/2]

std::shared_ptr<TriggerResultInserter const> edm::Schedule::resultsInserter ( ) const
inlineprivate

Definition at line 290 of file Schedule.h.

290  {
292  }

References edm::get_underlying_safe(), and resultsInserter_.

◆ shouldWeCloseOutput()

bool edm::Schedule::shouldWeCloseOutput ( ) const

Definition at line 1224 of file Schedule.cc.

1224  {
1225  using std::placeholders::_1;
1226  // Return true iff at least one output module returns true.
1227  return (std::find_if(all_output_communicators_.begin(),
1231  }

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

◆ terminate()

bool edm::Schedule::terminate ( void  ) const

Return whether each output module has reached its maximum count.

Definition at line 841 of file Schedule.cc.

841  {
842  if (all_output_communicators_.empty()) {
843  return false;
844  }
845  for (auto& c : all_output_communicators_) {
846  if (!c->limitReached()) {
847  // Found an output module that has not reached output event count.
848  return false;
849  }
850  }
851  LogInfo("SuccessfulTermination") << "The job is terminating successfully because each output module\n"
852  << "has reached its configured limit.\n";
853  return true;
854  }

References all_output_communicators_, and HltBtagPostValidation_cff::c.

◆ totalEvents()

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 1412 of file Schedule.cc.

1412  {
1413  int returnValue = 0;
1414  for (auto& s : streamSchedules_) {
1415  returnValue += s->totalEvents();
1416  }
1417  return returnValue;
1418  }

References alignCSCRings::s, and streamSchedules_.

Referenced by endJob().

◆ totalEventsFailed()

int edm::Schedule::totalEventsFailed ( ) const

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

Definition at line 1428 of file Schedule.cc.

1428  {
1429  int returnValue = 0;
1430  for (auto& s : streamSchedules_) {
1431  returnValue += s->totalEventsFailed();
1432  }
1433  return returnValue;
1434  }

References alignCSCRings::s, and streamSchedules_.

◆ totalEventsPassed()

int edm::Schedule::totalEventsPassed ( ) const

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

Definition at line 1420 of file Schedule.cc.

1420  {
1421  int returnValue = 0;
1422  for (auto& s : streamSchedules_) {
1423  returnValue += s->totalEventsPassed();
1424  }
1425  return returnValue;
1426  }

References alignCSCRings::s, and streamSchedules_.

◆ triggerPaths()

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 1334 of file Schedule.cc.

1334 { oLabelsToFill = *pathNames_; }

References pathNames_.

◆ writeLumiAsync()

void edm::Schedule::writeLumiAsync ( WaitingTaskHolder  iTask,
LuminosityBlockPrincipal const &  lbp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry 
)

Definition at line 1186 of file Schedule.cc.

1189  {
1191  GlobalContext globalContext(GlobalContext::Transition::kWriteLuminosityBlock,
1192  lbp.id(),
1193  lbp.runPrincipal().index(),
1194  lbp.index(),
1195  lbp.beginTime(),
1196  processContext);
1197 
1198  auto t =
1199  make_waiting_task(tbb::task::allocate_root(),
1200  [task, activityRegistry, globalContext, token](std::exception_ptr const* iExcept) mutable {
1201  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1202  CMS_SA_ALLOW try {
1203  //services can depend on other services
1205 
1206  activityRegistry->postGlobalWriteLumiSignal_(globalContext);
1207  } catch (...) {
1208  }
1209  std::exception_ptr ptr;
1210  if (iExcept) {
1211  ptr = *iExcept;
1212  }
1213  task.doneWaiting(ptr);
1214  });
1215  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1216  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteLumiSignal_(globalContext); } catch (...) {
1217  }
1218  WaitingTaskHolder tHolder(t);
1219  for (auto& c : all_output_communicators_) {
1220  c->writeLumiAsync(tHolder, lbp, processContext, activityRegistry);
1221  }
1222  }

References all_output_communicators_, edm::LuminosityBlockPrincipal::beginTime(), HltBtagPostValidation_cff::c, CMS_SA_ALLOW, edm::LuminosityBlockPrincipal::id(), edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), edm::ServiceRegistry::instance(), edm::GlobalContext::kWriteLuminosityBlock, edm::make_waiting_task(), edm::ActivityRegistry::postGlobalWriteLumiSignal_, edm::ActivityRegistry::preGlobalWriteLumiSignal_, edm::ServiceRegistry::presentToken(), edm::LuminosityBlockPrincipal::runPrincipal(), OrderedSet::t, TrackValidation_cff::task, and unpackBuffers-CaloStage2::token.

◆ writeRunAsync()

void edm::Schedule::writeRunAsync ( WaitingTaskHolder  iTask,
RunPrincipal const &  rp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry,
MergeableRunProductMetadata const *  mergeableRunProductMetadata 
)

Definition at line 1147 of file Schedule.cc.

1151  {
1153  GlobalContext globalContext(GlobalContext::Transition::kWriteRun,
1154  LuminosityBlockID(rp.run(), 0),
1155  rp.index(),
1157  rp.endTime(),
1158  processContext);
1159  auto t =
1160  make_waiting_task(tbb::task::allocate_root(),
1161  [task, activityRegistry, globalContext, token](std::exception_ptr const* iExcept) mutable {
1162  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1163  CMS_SA_ALLOW try {
1164  //services can depend on other services
1166 
1167  activityRegistry->postGlobalWriteRunSignal_(globalContext);
1168  } catch (...) {
1169  }
1170  std::exception_ptr ptr;
1171  if (iExcept) {
1172  ptr = *iExcept;
1173  }
1174  task.doneWaiting(ptr);
1175  });
1176  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1177  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteRunSignal_(globalContext); } catch (...) {
1178  }
1179  WaitingTaskHolder tHolder(t);
1180 
1181  for (auto& c : all_output_communicators_) {
1182  c->writeRunAsync(tHolder, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1183  }
1184  }

References all_output_communicators_, HltBtagPostValidation_cff::c, CMS_SA_ALLOW, edm::RunPrincipal::endTime(), edm::RunPrincipal::index(), edm::ServiceRegistry::instance(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::GlobalContext::kWriteRun, edm::make_waiting_task(), edm::ActivityRegistry::postGlobalWriteRunSignal_, edm::ActivityRegistry::preGlobalWriteRunSignal_, edm::ServiceRegistry::presentToken(), edm::RunPrincipal::run(), OrderedSet::t, TrackValidation_cff::task, and unpackBuffers-CaloStage2::token.

Member Data Documentation

◆ all_output_communicators_

AllOutputModuleCommunicators edm::Schedule::all_output_communicators_
private

◆ endPathNames_

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

Definition at line 311 of file Schedule.h.

Referenced by endPaths().

◆ endpathsAreActive_

volatile bool edm::Schedule::endpathsAreActive_
private

Definition at line 314 of file Schedule.h.

Referenced by enableEndPaths(), and endPathsEnabled().

◆ endPathStatusInserters_

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

Definition at line 299 of file Schedule.h.

◆ globalSchedule_

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

Definition at line 303 of file Schedule.h.

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

◆ moduleRegistry_

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

Definition at line 300 of file Schedule.h.

Referenced by changeModule(), and moduleRegistry().

◆ pathNames_

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

Definition at line 310 of file Schedule.h.

Referenced by triggerPaths().

◆ pathStatusInserters_

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

Definition at line 298 of file Schedule.h.

Referenced by processOneEventAsync().

◆ preallocConfig_

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 306 of file Schedule.h.

Referenced by changeModule(), and endJob().

◆ resultsInserter_

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

Definition at line 297 of file Schedule.h.

Referenced by resultsInserter().

◆ streamSchedules_

std::vector<edm::propagate_const<std::shared_ptr<StreamSchedule> > > edm::Schedule::streamSchedules_
private

◆ summaryTimeKeeper_

edm::propagate_const<std::unique_ptr<SystemTimeKeeper> > edm::Schedule::summaryTimeKeeper_
private

Definition at line 308 of file Schedule.h.

Referenced by getTriggerTimingReport().

◆ wantSummary_

bool edm::Schedule::wantSummary_
private

Definition at line 312 of file Schedule.h.

Referenced by endJob().

alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
mps_fire.i
i
Definition: mps_fire.py:355
edm::Schedule::limitOutput
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists, SubProcessParentageHelper const *subProcessParentageHelper)
Definition: Schedule.cc:800
edm::Schedule::pathNames_
std::vector< std::string > const * pathNames_
Definition: Schedule.h:310
edm::PRODUCT_TYPE
Definition: ProductKindOfType.h:5
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
edm::Schedule::moduleRegistry
std::shared_ptr< ModuleRegistry const > moduleRegistry() const
Definition: Schedule.h:294
edm::setIsMergeable
void setIsMergeable(BranchDescription &)
Definition: setIsMergeable.cc:15
edm::sort_all
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
edm::PreallocationConfiguration::numberOfThreads
unsigned int numberOfThreads() const
Definition: PreallocationConfiguration.h:34
modules
Definition: ZHLTMatchFilter.cc:17
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
cms::cuda::assert
assert(be >=bs)
edm::Worker::respondToOpenInputFile
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:173
edm::SystemTimeKeeper::startProcessingLoop
void startProcessingLoop()
Definition: SystemTimeKeeper.cc:193
edm::Schedule::endPathStatusInserters_
std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter > > > endPathStatusInserters_
Definition: Schedule.h:299
edm::Schedule::totalEvents
int totalEvents() const
Definition: Schedule.cc:1412
edm::SystemTimeKeeper::stopProcessingLoop
void stopProcessingLoop()
Definition: SystemTimeKeeper.cc:195
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::InRun
Definition: BranchType.h:11
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
edm::Schedule::wantSummary_
bool wantSummary_
Definition: Schedule.h:312
edm::SystemTimeKeeper::startModuleEvent
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:153
edm::for_all
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::SystemTimeKeeper::startEvent
void startEvent(StreamID)
Definition: SystemTimeKeeper.cc:124
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
WaitingTaskHolder
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
edm::InEvent
Definition: BranchType.h:11
OrderedSet.t
t
Definition: OrderedSet.py:90
edm::make_waiting_task
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:87
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Schedule::getTriggerReport
void getTriggerReport(TriggerReport &rep) const
Definition: Schedule.cc:1395
edm::OutputModuleCommunicator::shouldWeCloseFile
virtual bool shouldWeCloseFile() const =0
edm::GlobalContext::Transition::kWriteLuminosityBlock
edm::get_underlying_safe
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
Definition: get_underlying_safe.h:40
edm::ServiceRegistry::Operate
friend class Operate
Definition: ServiceRegistry.h:54
edm::Schedule::streamSchedules_
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
edm::LuminosityBlockIndex::invalidLuminosityBlockIndex
static LuminosityBlockIndex invalidLuminosityBlockIndex()
Definition: LuminosityBlockIndex.cc:9
ParameterSet
Definition: Functions.h:16
edm::InLumi
Definition: BranchType.h:11
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edm::OutputModuleCommunicator::openFile
virtual void openFile(FileBlock const &fb)=0
edm::Schedule::pathStatusInserters_
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:298
edm::ServiceRegistry::presentToken
ServiceToken presentToken() const
Definition: ServiceRegistry.cc:63
Exception
edm::Schedule::endpathsAreActive_
volatile bool endpathsAreActive_
Definition: Schedule.h:314
cuy.rep
rep
Definition: cuy.py:1190
edm::SystemTimeKeeper::stopPath
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
Definition: SystemTimeKeeper.cc:140
edm::GlobalContext::Transition::kWriteRun
edm::Worker::respondToCloseInputFile
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:174
edm::SystemTimeKeeper::stopModuleEvent
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:160
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::Schedule::all_output_communicators_
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:305
edm::ServiceRegistry::instance
static ServiceRegistry & instance()
Definition: ServiceRegistry.cc:90
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::Schedule::endPathNames_
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:311
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::Schedule::allWorkers
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1322
edm::SystemTimeKeeper::startPath
void startPath(StreamContext const &, PathContext const &)
Definition: SystemTimeKeeper.cc:133
edm::Schedule::resultsInserter
std::shared_ptr< TriggerResultInserter const > resultsInserter() const
Definition: Schedule.h:290
edm::Schedule::summaryTimeKeeper_
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:308
T
long double T
Definition: Basic3DVectorLD.h:48
Exception
Definition: hltDiff.cc:246
edm::SystemTimeKeeper::pauseModuleEvent
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:173
edm::OutputModuleCommunicator::closeFile
virtual void closeFile()=0
edm::Schedule::globalSchedule_
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:303
actions
roAction_t actions[nactions]
Definition: GenABIO.cc:181
mps_fire.result
result
Definition: mps_fire.py:303
edm::search_all
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:36
edm::Schedule::moduleRegistry_
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:300
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::SystemTimeKeeper::stopEvent
void stopEvent(StreamContext const &)
Definition: SystemTimeKeeper.cc:129
HLTObjectsMonitor_cfi.TriggerResults
TriggerResults
Definition: HLTObjectsMonitor_cfi.py:9
edm::errors::Configuration
Definition: EDMException.h:36
EcalCalibMonitorClient_cfi.workers
workers
Definition: EcalCalibMonitorClient_cfi.py:19
edm::SystemTimeKeeper::restartModuleEvent
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:186
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
edm::Schedule::preallocConfig_
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:306
edm::Schedule::getTriggerTimingReport
void getTriggerTimingReport(TriggerTimingReport &rep) const
Definition: Schedule.cc:1405
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::Schedule::resultsInserter_
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:297
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316