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 const > moduleRegistry () const
 
std::shared_ptr< ModuleRegistry > & moduleRegistry ()
 
std::shared_ptr< TriggerResultInserter const > resultsInserter () const
 
std::shared_ptr< TriggerResultInserter > & resultsInserter ()
 

Private Attributes

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

Detailed Description

Definition at line 122 of file Schedule.h.

Member Typedef Documentation

Definition at line 126 of file Schedule.h.

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

Definition at line 125 of file Schedule.h.

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

Definition at line 124 of file Schedule.h.

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

Definition at line 128 of file Schedule.h.

Constructor & Destructor Documentation

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

Definition at line 569 of file Schedule.cc.

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

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

Member Function Documentation

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

returns the collection of pointers to workers

Definition at line 1249 of file Schedule.cc.

References globalSchedule_.

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

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

adds to oLabelsToFill the labels for all paths in the process

Definition at line 1257 of file Schedule.cc.

References streamSchedules_.

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

1257  {
1258  streamSchedules_[0]->availablePaths(oLabelsToFill);
1259  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
void edm::Schedule::beginJob ( ProductRegistry const &  iRegistry,
eventsetup::ESRecordsToProxyIndices const &  iESIndices 
)

Definition at line 1170 of file Schedule.cc.

References globalSchedule_.

1170  {
1171  globalSchedule_->beginJob(iRegistry, iESIndices);
1172  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:303
void edm::Schedule::beginStream ( unsigned int  iStreamID)

Definition at line 1174 of file Schedule.cc.

References streamSchedules_.

1174  {
1175  assert(iStreamID < streamSchedules_.size());
1176  streamSchedules_[iStreamID]->beginStream();
1177  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
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 1193 of file Schedule.cc.

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

1196  {
1197  Worker* found = nullptr;
1198  for (auto const& worker : allWorkers()) {
1199  if (worker->description().moduleLabel() == iLabel) {
1200  found = worker;
1201  break;
1202  }
1203  }
1204  if (nullptr == found) {
1205  return false;
1206  }
1207 
1208  auto newMod = moduleRegistry_->replaceModule(iLabel, iPSet, preallocConfig_);
1209 
1210  globalSchedule_->replaceModule(newMod, iLabel);
1211 
1212  for (auto& s : streamSchedules_) {
1213  s->replaceModule(newMod, iLabel);
1214  }
1215 
1216  {
1217  //Need to updateLookup in order to make getByToken work
1218  auto const runLookup = iRegistry.productLookup(InRun);
1219  auto const lumiLookup = iRegistry.productLookup(InLumi);
1220  auto const eventLookup = iRegistry.productLookup(InEvent);
1221  found->updateLookup(InRun, *runLookup);
1222  found->updateLookup(InLumi, *lumiLookup);
1223  found->updateLookup(InEvent, *eventLookup);
1224  found->updateLookup(iIndices);
1225 
1226  auto const& processName = newMod->moduleDescription().processName();
1227  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1228  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1229  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1230  found->resolvePutIndicies(InRun, runModuleToIndicies);
1231  found->resolvePutIndicies(InLumi, lumiModuleToIndicies);
1232  found->resolvePutIndicies(InEvent, eventModuleToIndicies);
1233  }
1234 
1235  return true;
1236  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1249
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:303
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:300
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:306
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1363 of file Schedule.cc.

References streamSchedules_.

1363  {
1364  for (auto& s : streamSchedules_) {
1365  s->clearCounters();
1366  }
1367  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
void edm::Schedule::closeOutputFiles ( )

Definition at line 1122 of file Schedule.cc.

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

1122  {
1123  using std::placeholders::_1;
1125  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:305
void edm::Schedule::convertCurrentProcessAlias ( std::string const &  processName)

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

Definition at line 1251 of file Schedule.cc.

References allWorkers().

1251  {
1252  for (auto const& worker : allWorkers()) {
1253  worker->convertCurrentProcessAlias(processName);
1254  }
1255  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1249
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 1313 of file Schedule.cc.

References endpathsAreActive_, and streamSchedules_.

1313  {
1314  endpathsAreActive_ = active;
1315  for (auto& s : streamSchedules_) {
1316  s->enableEndPaths(active);
1317  }
1318  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
volatile bool endpathsAreActive_
Definition: Schedule.h:314
void edm::Schedule::endJob ( ExceptionCollector collector)

Definition at line 841 of file Schedule.cc.

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

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

References endPathNames_.

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

1263 { oLabelsToFill = *endPathNames_; }
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:311
bool edm::Schedule::endPathsEnabled ( ) const

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

Definition at line 1320 of file Schedule.cc.

References endpathsAreActive_.

1320 { return endpathsAreActive_; }
volatile bool endpathsAreActive_
Definition: Schedule.h:314
void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 1179 of file Schedule.cc.

References streamSchedules_.

1179  {
1180  assert(iStreamID < streamSchedules_.size());
1181  streamSchedules_[iStreamID]->endStream();
1182  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
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 1281 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().

1285  {
1286  allModuleDescriptions.clear();
1287  moduleIDToIndex.clear();
1288  modulesWhoseProductsAreConsumedBy.clear();
1289 
1290  allModuleDescriptions.reserve(allWorkers().size());
1291  moduleIDToIndex.reserve(allWorkers().size());
1292  modulesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1293 
1294  std::map<std::string, ModuleDescription const*> labelToDesc;
1295  unsigned int i = 0;
1296  for (auto const& worker : allWorkers()) {
1297  ModuleDescription const* p = worker->descPtr();
1298  allModuleDescriptions.push_back(p);
1299  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1300  labelToDesc[p->moduleLabel()] = p;
1301  ++i;
1302  }
1303  sort_all(moduleIDToIndex);
1304 
1305  i = 0;
1306  for (auto const& worker : allWorkers()) {
1307  std::vector<ModuleDescription const*>& modules = modulesWhoseProductsAreConsumedBy.at(i);
1308  worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1309  ++i;
1310  }
1311  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1249
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
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 1238 of file Schedule.cc.

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

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

1238  {
1239  std::vector<ModuleDescription const*> result;
1240  result.reserve(allWorkers().size());
1241 
1242  for (auto const& worker : allWorkers()) {
1243  ModuleDescription const* p = worker->descPtr();
1244  result.push_back(p);
1245  }
1246  return result;
1247  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1249
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 1322 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().

1322  {
1323  rep.eventSummary.totalEvents = 0;
1324  rep.eventSummary.totalEventsPassed = 0;
1325  rep.eventSummary.totalEventsFailed = 0;
1326  for (auto& s : streamSchedules_) {
1327  s->getTriggerReport(rep);
1328  }
1329  sort_all(rep.workerSummaries);
1330  }
rep
Definition: cuy.py:1190
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
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 1332 of file Schedule.cc.

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

Referenced by endJob().

1332  {
1333  rep.eventSummary.totalEvents = 0;
1334  rep.eventSummary.cpuTime = 0.;
1335  rep.eventSummary.realTime = 0.;
1336  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1337  }
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:308
rep
Definition: cuy.py:1190
void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists,
SubProcessParentageHelper const *  subProcessParentageHelper 
)
private

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

787  {
788  std::string const output("output");
789 
790  ParameterSet const& maxEventsPSet = proc_pset.getUntrackedParameterSet("maxEvents");
791  int maxEventSpecs = 0;
792  int maxEventsOut = -1;
793  ParameterSet const* vMaxEventsOut = nullptr;
794  std::vector<std::string> intNamesE = maxEventsPSet.getParameterNamesForType<int>(false);
795  if (search_all(intNamesE, output)) {
796  maxEventsOut = maxEventsPSet.getUntrackedParameter<int>(output);
797  ++maxEventSpecs;
798  }
799  std::vector<std::string> psetNamesE;
800  maxEventsPSet.getParameterSetNames(psetNamesE, false);
801  if (search_all(psetNamesE, output)) {
802  vMaxEventsOut = &maxEventsPSet.getUntrackedParameterSet(output);
803  ++maxEventSpecs;
804  }
805 
806  if (maxEventSpecs > 1) {
808  << "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
809  }
810 
811  for (auto& c : all_output_communicators_) {
812  OutputModuleDescription desc(branchIDLists, maxEventsOut, subProcessParentageHelper);
813  if (vMaxEventsOut != nullptr && !vMaxEventsOut->empty()) {
814  std::string const& moduleLabel = c->description().moduleLabel();
815  try {
816  desc.maxEvents_ = vMaxEventsOut->getUntrackedParameter<int>(moduleLabel);
817  } catch (Exception const&) {
819  << "\nNo entry in 'maxEvents' for output module label '" << moduleLabel << "'.\n";
820  }
821  }
822  c->configure(desc);
823  }
824  }
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:36
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:305
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 1275 of file Schedule.cc.

References streamSchedules_.

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

1277  {
1278  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1279  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
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 1269 of file Schedule.cc.

References streamSchedules_.

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

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

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

Definition at line 295 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:300
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 1265 of file Schedule.cc.

References streamSchedules_.

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

1265  {
1266  streamSchedules_[0]->modulesInPath(iPathLabel, oLabelsToFill);
1267  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
void edm::Schedule::openOutputFiles ( FileBlock fb)

Definition at line 1127 of file Schedule.cc.

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

1127  {
1128  using std::placeholders::_1;
1130  }
virtual void openFile(FileBlock const &fb)=0
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:305
void edm::Schedule::processOneEventAsync ( WaitingTaskHolder  iTask,
unsigned int  iStreamID,
EventPrincipal principal,
EventSetupImpl const &  eventSetup,
ServiceToken const &  token 
)

Definition at line 1184 of file Schedule.cc.

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

1188  {
1189  assert(iStreamID < streamSchedules_.size());
1190  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask), ep, es, token, pathStatusInserters_);
1191  }
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:298
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
def move(src, dest)
Definition: eostools.py:511
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.

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

334  {
335  globalSchedule_->processOneGlobalAsync<T>(iTaskHolder, ep, es, token, cleaningUpAfterException);
336  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:303
long double T
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.

References eostools::move().

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

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

Definition at line 1165 of file Schedule.cc.

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

1165  {
1166  using std::placeholders::_1;
1167  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
1168  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1249
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:174
void edm::Schedule::respondToOpenInputFile ( FileBlock const &  fb)

Definition at line 1160 of file Schedule.cc.

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

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

Definition at line 290 of file Schedule.h.

References edm::get_underlying_safe().

Referenced by Schedule().

290  {
292  }
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:297
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 293 of file Schedule.h.

References edm::get_underlying_safe().

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

Definition at line 1151 of file Schedule.cc.

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

1151  {
1152  using std::placeholders::_1;
1153  // Return true iff at least one output module returns true.
1154  return (std::find_if(all_output_communicators_.begin(),
1158  }
virtual bool shouldWeCloseFile() const =0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:305
bool edm::Schedule::terminate ( void  ) const

Return whether each output module has reached its maximum count.

Definition at line 826 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

826  {
827  if (all_output_communicators_.empty()) {
828  return false;
829  }
830  for (auto& c : all_output_communicators_) {
831  if (!c->limitReached()) {
832  // Found an output module that has not reached output event count.
833  return false;
834  }
835  }
836  LogInfo("SuccessfulTermination") << "The job is terminating successfully because each output module\n"
837  << "has reached its configured limit.\n";
838  return true;
839  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:305
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 1339 of file Schedule.cc.

References streamSchedules_.

Referenced by endJob().

1339  {
1340  int returnValue = 0;
1341  for (auto& s : streamSchedules_) {
1342  returnValue += s->totalEvents();
1343  }
1344  return returnValue;
1345  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
int edm::Schedule::totalEventsFailed ( ) const

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

Definition at line 1355 of file Schedule.cc.

References streamSchedules_.

1355  {
1356  int returnValue = 0;
1357  for (auto& s : streamSchedules_) {
1358  returnValue += s->totalEventsFailed();
1359  }
1360  return returnValue;
1361  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
int edm::Schedule::totalEventsPassed ( ) const

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

Definition at line 1347 of file Schedule.cc.

References streamSchedules_.

1347  {
1348  int returnValue = 0;
1349  for (auto& s : streamSchedules_) {
1350  returnValue += s->totalEventsPassed();
1351  }
1352  return returnValue;
1353  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
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 1261 of file Schedule.cc.

References pathNames_.

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

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

Definition at line 1142 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

1145  {
1146  for (auto& c : all_output_communicators_) {
1147  c->writeLumiAsync(task, lbp, processContext, activityRegistry);
1148  }
1149  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:305
void edm::Schedule::writeRunAsync ( WaitingTaskHolder  iTask,
RunPrincipal const &  rp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry,
MergeableRunProductMetadata const *  mergeableRunProductMetadata 
)

Definition at line 1132 of file Schedule.cc.

References all_output_communicators_, and EnergyCorrector::c.

1136  {
1137  for (auto& c : all_output_communicators_) {
1138  c->writeRunAsync(task, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1139  }
1140  }
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:305

Member Data Documentation

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

Definition at line 311 of file Schedule.h.

Referenced by endPaths(), and Schedule().

volatile bool edm::Schedule::endpathsAreActive_
private

Definition at line 314 of file Schedule.h.

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

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

Definition at line 299 of file Schedule.h.

Referenced by Schedule().

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 Schedule().

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

Definition at line 300 of file Schedule.h.

Referenced by changeModule(), and Schedule().

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

Definition at line 310 of file Schedule.h.

Referenced by Schedule(), and triggerPaths().

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

Definition at line 298 of file Schedule.h.

Referenced by processOneEventAsync(), and Schedule().

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 306 of file Schedule.h.

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

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

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

Referenced by getTriggerTimingReport(), and Schedule().

bool edm::Schedule::wantSummary_
private

Definition at line 312 of file Schedule.h.

Referenced by endJob(), and Schedule().