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::ESRecordsToProductResolverIndices const &, ProcessBlockHelperBase const &)
 
void beginStream (unsigned int)
 
bool changeModule (std::string const &iLabel, ParameterSet const &iPSet, const ProductRegistry &iRegistry, eventsetup::ESRecordsToProductResolverIndices 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 deleteModule (std::string const &iLabel, ActivityRegistry *areg)
 Deletes module with label iLabel. More...
 
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...
 
void endStream (unsigned int)
 
void fillModuleAndConsumesInfo (std::vector< ModuleDescription const *> &allModuleDescriptions, std::vector< std::pair< unsigned int, unsigned int >> &moduleIDToIndex, std::array< std::vector< std::vector< ModuleDescription const *>>, NumBranchTypes > &modulesWhoseProductsAreConsumedBy, std::vector< std::vector< ModuleProcessName >> &modulesInPreviousProcessesWhoseProductsAreConsumedBy, ProductRegistry const &preg) const
 
void finishSetup (ParameterSet &proc_pset, service::TriggerNamesService const &tns, ProductRegistry &preg, BranchIDListHelper &branchIDListHelper, ProcessBlockHelperBase &processBlockHelper, ThinnedAssociationsHelper &thinnedAssociationsHelper, SubProcessParentageHelper const *subProcessParentageHelper, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration > processConfiguration, bool hasSubprocesses, PreallocationConfiguration const &prealloc, ProcessContext const *processContext)
 
std::vector< ModuleDescription const * > getAllModuleDescriptions () const
 
void getTriggerReport (TriggerReport &rep) const
 
void getTriggerTimingReport (TriggerTimingReport &rep) const
 
void initializeEarlyDelete (std::vector< std::string > const &branchesToDeleteEarly, std::multimap< std::string, std::string > const &referencesToBranches, std::vector< std::string > const &modulesToSkip, edm::ProductRegistry const &preg)
 
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, EventTransitionInfo &, ServiceToken const &token)
 
template<typename T >
void processOneGlobalAsync (WaitingTaskHolder iTask, typename T::TransitionInfoType &transitionInfo, ServiceToken const &token, bool cleaningUpAfterException=false)
 
template<typename T >
void processOneStreamAsync (WaitingTaskHolder iTask, unsigned int iStreamID, typename T::TransitionInfoType &transitionInfo, 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, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration const > processConfiguration, PreallocationConfiguration const &config, ProcessContext const *processContext, ModuleTypeResolverMaker const *resolverMaker)
 
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 writeProcessBlockAsync (WaitingTaskHolder iTask, ProcessBlockPrincipal const &, 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_
 
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 124 of file Schedule.h.

Member Typedef Documentation

◆ AllOutputModuleCommunicators

Definition at line 128 of file Schedule.h.

◆ AllWorkers

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

Definition at line 127 of file Schedule.h.

◆ vstring

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

Definition at line 126 of file Schedule.h.

◆ Workers

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

Definition at line 130 of file Schedule.h.

Constructor & Destructor Documentation

◆ Schedule()

edm::Schedule::Schedule ( ParameterSet proc_pset,
service::TriggerNamesService const &  tns,
ProductRegistry pregistry,
ExceptionToActionTable const &  actions,
std::shared_ptr< ActivityRegistry areg,
std::shared_ptr< ProcessConfiguration const >  processConfiguration,
PreallocationConfiguration const &  config,
ProcessContext const *  processContext,
ModuleTypeResolverMaker const *  resolverMaker 
)

Definition at line 486 of file Schedule.cc.

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

495  : //Only create a resultsInserter if there is a trigger path
496  resultsInserter_{tns.getTrigPaths().empty()
497  ? std::shared_ptr<TriggerResultInserter>{}
498  : makeInserter(proc_pset, prealloc, preg, actions, areg, processConfiguration)},
499  moduleRegistry_(std::make_shared<ModuleRegistry>(resolverMaker)),
501  preallocConfig_(prealloc),
502  pathNames_(&tns.getTrigPaths()),
503  endPathNames_(&tns.getEndPaths()),
504  wantSummary_(tns.wantSummary()) {
505  makePathStatusInserters(pathStatusInserters_,
506  *pathNames_,
507  prealloc,
508  preg,
509  areg,
510  processConfiguration,
511  std::string("PathStatusInserter"));
512 
513  makePathStatusInserters(endPathStatusInserters_,
514  *endPathNames_,
515  prealloc,
516  preg,
517  areg,
518  processConfiguration,
519  std::string("EndPathStatusInserter"));
520 
521  assert(0 < prealloc.numberOfStreams());
522  streamSchedules_.reserve(prealloc.numberOfStreams());
523  for (unsigned int i = 0; i < prealloc.numberOfStreams(); ++i) {
524  streamSchedules_.emplace_back(make_shared_noexcept_false<StreamSchedule>(resultsInserter(),
527  moduleRegistry(),
528  proc_pset,
529  tns,
530  prealloc,
531  preg,
532  actions,
533  areg,
534  processConfiguration,
535  StreamID{i},
536  processContext));
537  }
538 
539  //TriggerResults are injected automatically by StreamSchedules and are
540  // unknown to the ModuleRegistry
541  const std::string kTriggerResults("TriggerResults");
542  std::vector<std::string> modulesToUse;
543  modulesToUse.reserve(streamSchedules_[0]->allWorkers().size());
544  for (auto const& worker : streamSchedules_[0]->allWorkers()) {
545  if (worker->description()->moduleLabel() != kTriggerResults) {
546  modulesToUse.push_back(worker->description()->moduleLabel());
547  }
548  }
549  //The unscheduled modules are at the end of the list, but we want them at the front
550  unsigned int const nUnscheduledModules = streamSchedules_[0]->numberOfUnscheduledModules();
551  if (nUnscheduledModules > 0) {
552  std::vector<std::string> temp;
553  temp.reserve(modulesToUse.size());
554  auto itBeginUnscheduled = modulesToUse.begin() + modulesToUse.size() - nUnscheduledModules;
555  std::copy(itBeginUnscheduled, modulesToUse.end(), std::back_inserter(temp));
556  std::copy(modulesToUse.begin(), itBeginUnscheduled, std::back_inserter(temp));
557  temp.swap(modulesToUse);
558  }
559 
560  // propagate_const<T> has no reset() function
561  globalSchedule_ = std::make_unique<GlobalSchedule>(resultsInserter(),
564  moduleRegistry(),
565  modulesToUse,
566  proc_pset,
567  preg,
568  prealloc,
569  actions,
570  areg,
571  processConfiguration,
572  processContext);
573  }
size
Write out results.
roAction_t actions[nactions]
Definition: GenABIO.cc:181
std::vector< std::string > const * pathNames_
Definition: Schedule.h:328
assert(be >=bs)
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:321
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:316
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:315
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:318
std::shared_ptr< ModuleRegistry const > moduleRegistry() const
Definition: Schedule.h:312
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:324
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1280
std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter > > > endPathStatusInserters_
Definition: Schedule.h:317
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:323
bool wantSummary_
Definition: Schedule.h:330
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:329
std::shared_ptr< TriggerResultInserter const > resultsInserter() const
Definition: Schedule.h:308

Member Function Documentation

◆ allWorkers()

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

returns the collection of pointers to workers

Definition at line 1280 of file Schedule.cc.

References globalSchedule_.

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

1280 { return globalSchedule_->allWorkers(); }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:321

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

References streamSchedules_.

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

1288  {
1289  streamSchedules_[0]->availablePaths(oLabelsToFill);
1290  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ beginJob()

void edm::Schedule::beginJob ( ProductRegistry const &  iRegistry,
eventsetup::ESRecordsToProductResolverIndices const &  iESIndices,
ProcessBlockHelperBase const &  processBlockHelperBase 
)

Definition at line 1178 of file Schedule.cc.

References globalSchedule_.

1180  {
1181  globalSchedule_->beginJob(iRegistry, iESIndices, processBlockHelperBase);
1182  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:321

◆ beginStream()

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

Definition at line 1184 of file Schedule.cc.

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

1184  {
1185  assert(iStreamID < streamSchedules_.size());
1186  streamSchedules_[iStreamID]->beginStream();
1187  }
assert(be >=bs)
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ changeModule()

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

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

Definition at line 1202 of file Schedule.cc.

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

1205  {
1206  Worker* found = nullptr;
1207  for (auto const& worker : allWorkers()) {
1208  if (worker->description()->moduleLabel() == iLabel) {
1209  found = worker;
1210  break;
1211  }
1212  }
1213  if (nullptr == found) {
1214  return false;
1215  }
1216 
1217  auto newMod = moduleRegistry_->replaceModule(iLabel, iPSet, preallocConfig_);
1218 
1219  globalSchedule_->replaceModule(newMod, iLabel);
1220 
1221  for (auto& s : streamSchedules_) {
1222  s->replaceModule(newMod, iLabel);
1223  }
1224 
1225  {
1226  //Need to updateLookup in order to make getByToken work
1227  auto const processBlockLookup = iRegistry.productLookup(InProcess);
1228  auto const runLookup = iRegistry.productLookup(InRun);
1229  auto const lumiLookup = iRegistry.productLookup(InLumi);
1230  auto const eventLookup = iRegistry.productLookup(InEvent);
1231  found->updateLookup(InProcess, *runLookup);
1232  found->updateLookup(InRun, *runLookup);
1233  found->updateLookup(InLumi, *lumiLookup);
1234  found->updateLookup(InEvent, *eventLookup);
1235  found->updateLookup(iIndices);
1236 
1237  auto const& processName = newMod->moduleDescription().processName();
1238  auto const& processBlockModuleToIndicies = processBlockLookup->indiciesForModulesInProcess(processName);
1239  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1240  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1241  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1242  found->resolvePutIndicies(InProcess, processBlockModuleToIndicies);
1243  found->resolvePutIndicies(InRun, runModuleToIndicies);
1244  found->resolvePutIndicies(InLumi, lumiModuleToIndicies);
1245  found->resolvePutIndicies(InEvent, eventModuleToIndicies);
1246  }
1247 
1248  return true;
1249  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:321
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:318
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:324
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1280

◆ clearCounters()

void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1404 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

1404  {
1405  for (auto& s : streamSchedules_) {
1406  s->clearCounters();
1407  }
1408  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ closeOutputFiles()

void edm::Schedule::closeOutputFiles ( )

Definition at line 1054 of file Schedule.cc.

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

1054  {
1055  using std::placeholders::_1;
1057  for (auto& worker : allWorkers()) {
1058  worker->respondToCloseOutputFile();
1059  }
1060  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1280
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:323

◆ convertCurrentProcessAlias()

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

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

Definition at line 1282 of file Schedule.cc.

References allWorkers(), and SimL1EmulatorRepack_CalouGT_cff::processName.

1282  {
1283  for (auto const& worker : allWorkers()) {
1284  worker->convertCurrentProcessAlias(processName);
1285  }
1286  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1280

◆ deleteModule()

void edm::Schedule::deleteModule ( std::string const &  iLabel,
ActivityRegistry areg 
)

Deletes module with label iLabel.

Definition at line 1251 of file Schedule.cc.

References globalSchedule_, moduleRegistry_, edm::ActivityRegistry::postModuleDestructionSignal_, edm::ActivityRegistry::preModuleDestructionSignal_, cms::cuda::stream, and streamSchedules_.

1251  {
1252  globalSchedule_->deleteModule(iLabel);
1253  for (auto& stream : streamSchedules_) {
1254  stream->deleteModule(iLabel);
1255  }
1256  moduleRegistry_->deleteModule(iLabel, areg->preModuleDestructionSignal_, areg->postModuleDestructionSignal_);
1257  }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:321
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:318
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ endJob()

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

Definition at line 780 of file Schedule.cc.

References visDQMUpload::context, submitPVResolutionJobs::count, 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.

780  {
781  globalSchedule_->endJob(collector);
782  if (collector.hasThrown()) {
783  return;
784  }
785 
786  if (wantSummary_ == false)
787  return;
788 
789  //Function to loop over items in a container and periodically
790  // flush to the message logger.
791  auto logForEach = [](auto const& iContainer, auto iMessage) {
792  auto logger = LogFwkVerbatim("FwkSummary");
793  int count = 0;
794  for (auto const& element : iContainer) {
795  iMessage(logger, element);
796  if (++count == 10) {
797  logger = LogFwkVerbatim("FwkSummary");
798  count = 0;
799  } else {
800  logger << "\n";
801  }
802  }
803  };
804 
805  {
806  TriggerReport tr;
807  getTriggerReport(tr);
808 
809  // The trigger report (pass/fail etc.):
810 
811  LogFwkVerbatim("FwkSummary") << "";
812  if (streamSchedules_[0]->context().processContext()->isSubProcess()) {
813  LogFwkVerbatim("FwkSummary") << "TrigReport Process: "
814  << streamSchedules_[0]->context().processContext()->processName();
815  }
816  LogFwkVerbatim("FwkSummary") << "TrigReport "
817  << "---------- Event Summary ------------";
818  if (!tr.trigPathSummaries.empty()) {
819  LogFwkVerbatim("FwkSummary") << "TrigReport"
820  << " Events total = " << tr.eventSummary.totalEvents
821  << " passed = " << tr.eventSummary.totalEventsPassed
822  << " failed = " << tr.eventSummary.totalEventsFailed << "";
823  } else {
824  LogFwkVerbatim("FwkSummary") << "TrigReport"
825  << " Events total = " << tr.eventSummary.totalEvents
826  << " passed = " << tr.eventSummary.totalEvents << " failed = 0";
827  }
828 
829  LogFwkVerbatim("FwkSummary") << "";
830  LogFwkVerbatim("FwkSummary") << "TrigReport "
831  << "---------- Path Summary ------------";
832  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
833  << " " << std::right << std::setw(10) << "Executed"
834  << " " << std::right << std::setw(10) << "Passed"
835  << " " << std::right << std::setw(10) << "Failed"
836  << " " << std::right << std::setw(10) << "Error"
837  << " "
838  << "Name"
839  << "";
840  logForEach(tr.trigPathSummaries, [](auto& logger, auto const& p) {
841  logger << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5) << p.bitPosition << " "
842  << std::right << std::setw(10) << p.timesRun << " " << std::right << std::setw(10) << p.timesPassed
843  << " " << std::right << std::setw(10) << p.timesFailed << " " << std::right << std::setw(10)
844  << p.timesExcept << " " << p.name;
845  });
846 
847  /*
848  std::vector<int>::const_iterator epi = empty_trig_paths_.begin();
849  std::vector<int>::const_iterator epe = empty_trig_paths_.end();
850  std::vector<std::string>::const_iterator epn = empty_trig_path_names_.begin();
851  for (; epi != epe; ++epi, ++epn) {
852 
853  LogFwkVerbatim("FwkSummary") << "TrigReport "
854  << std::right << std::setw(5) << 1
855  << std::right << std::setw(5) << *epi << " "
856  << std::right << std::setw(10) << totalEvents() << " "
857  << std::right << std::setw(10) << totalEvents() << " "
858  << std::right << std::setw(10) << 0 << " "
859  << std::right << std::setw(10) << 0 << " "
860  << *epn << "";
861  }
862  */
863 
864  LogFwkVerbatim("FwkSummary") << "\n"
865  << "TrigReport "
866  << "-------End-Path Summary ------------\n"
867  << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
868  << " " << std::right << std::setw(10) << "Executed"
869  << " " << std::right << std::setw(10) << "Passed"
870  << " " << std::right << std::setw(10) << "Failed"
871  << " " << std::right << std::setw(10) << "Error"
872  << " "
873  << "Name";
874  logForEach(tr.endPathSummaries, [](auto& logger, auto const& p) {
875  logger << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5) << p.bitPosition << " "
876  << std::right << std::setw(10) << p.timesRun << " " << std::right << std::setw(10) << p.timesPassed
877  << " " << std::right << std::setw(10) << p.timesFailed << " " << std::right << std::setw(10)
878  << p.timesExcept << " " << p.name;
879  });
880 
881  for (auto const& p : tr.trigPathSummaries) {
882  LogFwkVerbatim("FwkSummary") << "\n"
883  << "TrigReport "
884  << "---------- Modules in Path: " << p.name << " ------------\n"
885  << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
886  << " " << std::right << std::setw(10) << "Visited"
887  << " " << std::right << std::setw(10) << "Passed"
888  << " " << std::right << std::setw(10) << "Failed"
889  << " " << std::right << std::setw(10) << "Error"
890  << " "
891  << "Name";
892 
893  logForEach(p.moduleInPathSummaries, [](auto& logger, auto const& mod) {
894  logger << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5) << mod.bitPosition
895  << " " << std::right << std::setw(10) << mod.timesVisited << " " << std::right << std::setw(10)
896  << mod.timesPassed << " " << std::right << std::setw(10) << mod.timesFailed << " " << std::right
897  << std::setw(10) << mod.timesExcept << " " << mod.moduleLabel;
898  });
899  }
900 
901  for (auto const& p : tr.endPathSummaries) {
902  LogFwkVerbatim("FwkSummary") << "\n"
903  << "TrigReport "
904  << "------ Modules in End-Path: " << p.name << " ------------\n"
905  << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
906  << " " << std::right << std::setw(10) << "Visited"
907  << " " << std::right << std::setw(10) << "Passed"
908  << " " << std::right << std::setw(10) << "Failed"
909  << " " << std::right << std::setw(10) << "Error"
910  << " "
911  << "Name";
912 
913  unsigned int bitpos = 0;
914  logForEach(p.moduleInPathSummaries, [&bitpos](auto& logger, auto const& mod) {
915  logger << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5) << bitpos << " "
916  << std::right << std::setw(10) << mod.timesVisited << " " << std::right << std::setw(10)
917  << mod.timesPassed << " " << std::right << std::setw(10) << mod.timesFailed << " " << std::right
918  << std::setw(10) << mod.timesExcept << " " << mod.moduleLabel;
919  ++bitpos;
920  });
921  }
922 
923  LogFwkVerbatim("FwkSummary") << "\n"
924  << "TrigReport "
925  << "---------- Module Summary ------------\n"
926  << "TrigReport " << std::right << std::setw(10) << "Visited"
927  << " " << std::right << std::setw(10) << "Executed"
928  << " " << std::right << std::setw(10) << "Passed"
929  << " " << std::right << std::setw(10) << "Failed"
930  << " " << std::right << std::setw(10) << "Error"
931  << " "
932  << "Name";
933 
934  logForEach(tr.workerSummaries, [](auto& logger, auto const& worker) {
935  logger << "TrigReport " << std::right << std::setw(10) << worker.timesVisited << " " << std::right
936  << std::setw(10) << worker.timesRun << " " << std::right << std::setw(10) << worker.timesPassed << " "
937  << std::right << std::setw(10) << worker.timesFailed << " " << std::right << std::setw(10)
938  << worker.timesExcept << " " << worker.moduleLabel;
939  });
940  LogFwkVerbatim("FwkSummary") << "";
941  }
942  // The timing report (CPU and Real Time):
943  TriggerTimingReport tr;
945 
946  const int totalEvents = std::max(1, tr.eventSummary.totalEvents);
947 
948  LogFwkVerbatim("FwkSummary") << "TimeReport "
949  << "---------- Event Summary ---[sec]----";
950  LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
951  << " event loop CPU/event = " << tr.eventSummary.cpuTime / totalEvents;
952  LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
953  << " event loop Real/event = " << tr.eventSummary.realTime / totalEvents;
954  LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
955  << " sum Streams Real/event = " << tr.eventSummary.sumStreamRealTime / totalEvents;
956  LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
957  << " efficiency CPU/Real/thread = "
958  << tr.eventSummary.cpuTime / tr.eventSummary.realTime /
960 
961  constexpr int kColumn1Size = 10;
962  constexpr int kColumn2Size = 12;
963  constexpr int kColumn3Size = 12;
964  LogFwkVerbatim("FwkSummary") << "";
965  LogFwkVerbatim("FwkSummary") << "TimeReport "
966  << "---------- Path Summary ---[Real sec]----";
967  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
968  << " " << std::right << std::setw(kColumn2Size) << "per exec"
969  << " Name";
970  logForEach(tr.trigPathSummaries, [&](auto& logger, auto const& p) {
971  const int timesRun = std::max(1, p.timesRun);
972  logger << "TimeReport " << std::setprecision(6) << std::fixed << std::right << std::setw(kColumn1Size)
973  << p.realTime / totalEvents << " " << std::right << std::setw(kColumn2Size) << p.realTime / timesRun
974  << " " << p.name;
975  });
976  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
977  << " " << std::right << std::setw(kColumn2Size) << "per exec"
978  << " Name";
979 
980  LogFwkVerbatim("FwkSummary") << "\n"
981  << "TimeReport "
982  << "-------End-Path Summary ---[Real sec]----\n"
983  << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
984  << " " << std::right << std::setw(kColumn2Size) << "per exec"
985  << " Name";
986  logForEach(tr.endPathSummaries, [&](auto& logger, auto const& p) {
987  const int timesRun = std::max(1, p.timesRun);
988 
989  logger << "TimeReport " << std::setprecision(6) << std::fixed << std::right << std::setw(kColumn1Size)
990  << p.realTime / totalEvents << " " << std::right << std::setw(kColumn2Size) << p.realTime / timesRun
991  << " " << p.name;
992  });
993  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
994  << " " << std::right << std::setw(kColumn2Size) << "per exec"
995  << " Name";
996 
997  for (auto const& p : tr.trigPathSummaries) {
998  LogFwkVerbatim("FwkSummary") << "\n"
999  << "TimeReport "
1000  << "---------- Modules in Path: " << p.name << " ---[Real sec]----\n"
1001  << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1002  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1003  << " Name";
1004  logForEach(p.moduleInPathSummaries, [&](auto& logger, auto const& mod) {
1005  logger << "TimeReport " << std::setprecision(6) << std::fixed << std::right << std::setw(kColumn1Size)
1006  << mod.realTime / totalEvents << " " << std::right << std::setw(kColumn2Size)
1007  << mod.realTime / std::max(1, mod.timesVisited) << " " << mod.moduleLabel;
1008  });
1009  }
1010  if (not tr.trigPathSummaries.empty()) {
1011  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1012  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1013  << " Name";
1014  }
1015  for (auto const& p : tr.endPathSummaries) {
1016  LogFwkVerbatim("FwkSummary") << "\n"
1017  << "TimeReport "
1018  << "------ Modules in End-Path: " << p.name << " ---[Real sec]----\n"
1019  << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1020  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1021  << " Name";
1022  logForEach(p.moduleInPathSummaries, [&](auto& logger, auto const& mod) {
1023  logger << "TimeReport " << std::setprecision(6) << std::fixed << std::right << std::setw(kColumn1Size)
1024  << mod.realTime / totalEvents << " " << std::right << std::setw(kColumn2Size)
1025  << mod.realTime / std::max(1, mod.timesVisited) << " " << mod.moduleLabel;
1026  });
1027  }
1028  if (not tr.endPathSummaries.empty()) {
1029  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1030  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1031  << " Name";
1032  }
1033  LogFwkVerbatim("FwkSummary") << "\n"
1034  << "TimeReport "
1035  << "---------- Module Summary ---[Real sec]----\n"
1036  << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1037  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1038  << " " << std::right << std::setw(kColumn3Size) << "per visit"
1039  << " Name";
1040  logForEach(tr.workerSummaries, [&](auto& logger, auto const& worker) {
1041  logger << "TimeReport " << std::setprecision(6) << std::fixed << std::right << std::setw(kColumn1Size)
1042  << worker.realTime / totalEvents << " " << std::right << std::setw(kColumn2Size)
1043  << worker.realTime / std::max(1, worker.timesRun) << " " << std::right << std::setw(kColumn3Size)
1044  << worker.realTime / std::max(1, worker.timesVisited) << " " << worker.moduleLabel;
1045  });
1046  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1047  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1048  << " " << std::right << std::setw(kColumn3Size) << "per visit"
1049  << " Name";
1050 
1051  LogFwkVerbatim("FwkSummary") << "\nT---Report end!\n\n";
1052  }
void getTriggerTimingReport(TriggerTimingReport &rep) const
Definition: Schedule.cc:1373
int totalEvents() const
Definition: Schedule.cc:1380
void getTriggerReport(TriggerReport &rep) const
Definition: Schedule.cc:1363
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:321
Definition: logger.py:1
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:324
Log< level::FwkInfo, true > LogFwkVerbatim
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319
bool wantSummary_
Definition: Schedule.h:330
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

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

References endPathNames_.

1294 { oLabelsToFill = *endPathNames_; }
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:329

◆ endStream()

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

Definition at line 1189 of file Schedule.cc.

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

1189  {
1190  assert(iStreamID < streamSchedules_.size());
1191  streamSchedules_[iStreamID]->endStream();
1192  }
assert(be >=bs)
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ fillModuleAndConsumesInfo()

void edm::Schedule::fillModuleAndConsumesInfo ( std::vector< ModuleDescription const *> &  allModuleDescriptions,
std::vector< std::pair< unsigned int, unsigned int >> &  moduleIDToIndex,
std::array< std::vector< std::vector< ModuleDescription const *>>, NumBranchTypes > &  modulesWhoseProductsAreConsumedBy,
std::vector< std::vector< ModuleProcessName >> &  modulesInPreviousProcessesWhoseProductsAreConsumedBy,
ProductRegistry const &  preg 
) const

Definition at line 1312 of file Schedule.cc.

References cms::Exception::addContext(), allWorkers(), mps_fire::i, LogMessageMonitor_cff::modules, edm::NumBranchTypes, AlCaHLTBitMon_ParallelJobs::p, edm::sort_all(), and mitigatedMETSequence_cff::U.

1317  {
1318  allModuleDescriptions.clear();
1319  moduleIDToIndex.clear();
1320  for (auto iBranchType = 0U; iBranchType < NumBranchTypes; ++iBranchType) {
1321  modulesWhoseProductsAreConsumedBy[iBranchType].clear();
1322  }
1323  modulesInPreviousProcessesWhoseProductsAreConsumedBy.clear();
1324 
1325  allModuleDescriptions.reserve(allWorkers().size());
1326  moduleIDToIndex.reserve(allWorkers().size());
1327  for (auto iBranchType = 0U; iBranchType < NumBranchTypes; ++iBranchType) {
1328  modulesWhoseProductsAreConsumedBy[iBranchType].resize(allWorkers().size());
1329  }
1330  modulesInPreviousProcessesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1331 
1332  std::map<std::string, ModuleDescription const*> labelToDesc;
1333  unsigned int i = 0;
1334  for (auto const& worker : allWorkers()) {
1335  ModuleDescription const* p = worker->description();
1336  allModuleDescriptions.push_back(p);
1337  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1338  labelToDesc[p->moduleLabel()] = p;
1339  ++i;
1340  }
1341  sort_all(moduleIDToIndex);
1342 
1343  i = 0;
1344  for (auto const& worker : allWorkers()) {
1345  std::array<std::vector<ModuleDescription const*>*, NumBranchTypes> modules;
1346  for (auto iBranchType = 0U; iBranchType < NumBranchTypes; ++iBranchType) {
1347  modules[iBranchType] = &modulesWhoseProductsAreConsumedBy[iBranchType].at(i);
1348  }
1349 
1350  std::vector<ModuleProcessName>& modulesInPreviousProcesses =
1351  modulesInPreviousProcessesWhoseProductsAreConsumedBy.at(i);
1352  try {
1353  worker->modulesWhoseProductsAreConsumed(modules, modulesInPreviousProcesses, preg, labelToDesc);
1354  } catch (cms::Exception& ex) {
1355  ex.addContext("Calling Worker::modulesWhoseProductsAreConsumed() for module " +
1356  worker->description()->moduleLabel());
1357  throw;
1358  }
1359  ++i;
1360  }
1361  }
size
Write out results.
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1280
void addContext(std::string const &context)
Definition: Exception.cc:169

◆ finishSetup()

void edm::Schedule::finishSetup ( ParameterSet proc_pset,
service::TriggerNamesService const &  tns,
ProductRegistry preg,
BranchIDListHelper branchIDListHelper,
ProcessBlockHelperBase processBlockHelper,
ThinnedAssociationsHelper thinnedAssociationsHelper,
SubProcessParentageHelper const *  subProcessParentageHelper,
std::shared_ptr< ActivityRegistry areg,
std::shared_ptr< ProcessConfiguration processConfiguration,
bool  hasSubprocesses,
PreallocationConfiguration const &  prealloc,
ProcessContext const *  processContext 
)

Definition at line 575 of file Schedule.cc.

References all_output_communicators_, allWorkers(), edm::ProductRegistry::anyProductProduced(), cms::cuda::assert(), edm::BranchIDListHelper::branchIDLists(), HltBtagPostValidation_cff::c, edm::maker::ModuleHolder::createOutputModuleCommunicator(), edm::service::TriggerNamesService::getEndPaths(), edm::ParameterSet::getParameter(), edm::ParameterSet::id(), limitOutput(), moduleRegistry_, edm::PreallocationConfiguration::numberOfStreams(), edm::SystemTimeKeeper::pauseModuleEvent(), edm::detail::processEDAliases(), edm::PRODUCT_TYPE, edm::ProductRegistry::productListUpdator(), edm::ParameterSet::registerIt(), edm::SystemTimeKeeper::removeModuleIfExists(), edm::SystemTimeKeeper::restartModuleEvent(), edm::ProductRegistry::setFrozen(), edm::setIsMergeable(), edm::ProductRegistry::setUnscheduledProducts(), 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_, HcalDetIdTransform::transform(), edm::ProcessBlockHelperBase::updateForNewProcess(), edm::BranchIDListHelper::updateFromRegistry(), wantSummary_, and EcalCalibMonitorClient_cfi::workers.

586  {
587  //TriggerResults is not in the top level ParameterSet so the call to
588  // reduceParameterSet would fail to find it. Just remove it up front.
589  const std::string kTriggerResults("TriggerResults");
590 
591  std::set<std::string> usedModuleLabels;
592  for (auto const& worker : allWorkers()) {
593  if (worker->description()->moduleLabel() != kTriggerResults) {
594  usedModuleLabels.insert(worker->description()->moduleLabel());
595  }
596  }
597  std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string>>("@all_modules"));
598  std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
599  reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels, outputModulePathPositions);
600  {
601  std::vector<std::string> aliases = proc_pset.getParameter<std::vector<std::string>>("@all_aliases");
602  detail::processEDAliases(aliases, {}, proc_pset, processConfiguration->processName(), preg);
603  }
604 
605  // At this point all BranchDescriptions are created. Mark now the
606  // ones of unscheduled workers to be on-demand.
607  {
608  auto const& unsched = streamSchedules_[0]->unscheduledWorkers();
609  if (not unsched.empty()) {
610  std::set<std::string> unscheduledModules;
611  std::transform(unsched.begin(),
612  unsched.end(),
613  std::insert_iterator<std::set<std::string>>(unscheduledModules, unscheduledModules.begin()),
614  [](auto worker) { return worker->description()->moduleLabel(); });
615  preg.setUnscheduledProducts(unscheduledModules);
616  }
617  }
618 
619  processSwitchProducers(proc_pset, processConfiguration->processName(), preg);
620  proc_pset.registerIt();
621  processConfiguration->setParameterSetID(proc_pset.id());
622  processConfiguration->setProcessConfigurationID();
623 
624  // This is used for a little sanity-check to make sure no code
625  // modifications alter the number of workers at a later date.
626  size_t all_workers_count = allWorkers().size();
627 
628  moduleRegistry_->forAllModuleHolders([this](maker::ModuleHolder* iHolder) {
629  auto comm = iHolder->createOutputModuleCommunicator();
630  if (comm) {
631  all_output_communicators_.emplace_back(std::shared_ptr<OutputModuleCommunicator>{comm.release()});
632  }
633  });
634  // Now that the output workers are filled in, set any output limits or information.
635  limitOutput(proc_pset, branchIDListHelper.branchIDLists(), subProcessParentageHelper);
636 
637  // Sanity check: make sure nobody has added a worker after we've
638  // already relied on the WorkerManager being full.
639  assert(all_workers_count == allWorkers().size());
640 
641  branchIDListHelper.updateFromRegistry(preg);
642 
643  for (auto const& worker : streamSchedules_[0]->allWorkers()) {
644  worker->registerThinnedAssociations(preg, thinnedAssociationsHelper);
645  }
646 
647  processBlockHelper.updateForNewProcess(preg, processConfiguration->processName());
648 
649  // The output modules consume products in kept branches.
650  // So we must set this up before freezing.
651  for (auto& c : all_output_communicators_) {
652  c->selectProducts(preg, thinnedAssociationsHelper, processBlockHelper);
653  }
654 
655  for (auto& product : preg.productListUpdator()) {
656  setIsMergeable(product.second);
657  }
658 
659  {
660  // We now get a collection of types that may be consumed.
661  std::set<TypeID> productTypesConsumed;
662  std::set<TypeID> elementTypesConsumed;
663  // Loop over all modules
664  for (auto const& worker : allWorkers()) {
665  for (auto const& consumesInfo : worker->consumesInfo()) {
666  if (consumesInfo.kindOfType() == PRODUCT_TYPE) {
667  productTypesConsumed.emplace(consumesInfo.type());
668  } else {
669  elementTypesConsumed.emplace(consumesInfo.type());
670  }
671  }
672  }
673  // The SubProcess class is not a module, yet it may consume.
674  if (hasSubprocesses) {
675  productTypesConsumed.emplace(typeid(TriggerResults));
676  }
677  // The RandomNumberGeneratorService is not a module, yet it consumes.
678  { RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed); }
679  preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
680  }
681 
682  for (auto& c : all_output_communicators_) {
683  c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
684  }
685 
686  if (wantSummary_) {
687  std::vector<const ModuleDescription*> modDesc;
688  const auto& workers = allWorkers();
689  modDesc.reserve(workers.size());
690 
691  std::transform(workers.begin(),
692  workers.end(),
693  std::back_inserter(modDesc),
694  [](const Worker* iWorker) -> const ModuleDescription* { return iWorker->description(); });
695 
696  // propagate_const<T> has no reset() function
697  summaryTimeKeeper_ = std::make_unique<SystemTimeKeeper>(prealloc.numberOfStreams(), modDesc, tns, processContext);
698  auto timeKeeperPtr = summaryTimeKeeper_.get();
699 
700  areg->watchPreModuleDestruction(timeKeeperPtr, &SystemTimeKeeper::removeModuleIfExists);
701 
702  areg->watchPreModuleEvent(timeKeeperPtr, &SystemTimeKeeper::startModuleEvent);
703  areg->watchPostModuleEvent(timeKeeperPtr, &SystemTimeKeeper::stopModuleEvent);
704  areg->watchPreModuleEventAcquire(timeKeeperPtr, &SystemTimeKeeper::restartModuleEvent);
705  areg->watchPostModuleEventAcquire(timeKeeperPtr, &SystemTimeKeeper::stopModuleEvent);
706  areg->watchPreModuleEventDelayedGet(timeKeeperPtr, &SystemTimeKeeper::pauseModuleEvent);
707  areg->watchPostModuleEventDelayedGet(timeKeeperPtr, &SystemTimeKeeper::restartModuleEvent);
708 
709  areg->watchPreSourceEvent(timeKeeperPtr, &SystemTimeKeeper::startEvent);
710  areg->watchPostEvent(timeKeeperPtr, &SystemTimeKeeper::stopEvent);
711 
712  areg->watchPrePathEvent(timeKeeperPtr, &SystemTimeKeeper::startPath);
713  areg->watchPostPathEvent(timeKeeperPtr, &SystemTimeKeeper::stopPath);
714 
715  areg->watchPostBeginJob(timeKeeperPtr, &SystemTimeKeeper::startProcessingLoop);
716  areg->watchPreEndJob(timeKeeperPtr, &SystemTimeKeeper::stopProcessingLoop);
717  //areg->preModuleEventSignal_.connect([timeKeeperPtr](StreamContext const& iContext, ModuleCallingContext const& iMod) {
718  //timeKeeperPtr->startModuleEvent(iContext,iMod);
719  //});
720  }
721 
722  } // Schedule::Schedule
size
Write out results.
void stopEvent(StreamContext const &)
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
void removeModuleIfExists(ModuleDescription const &module)
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:326
assert(be >=bs)
void processEDAliases(std::vector< std::string > const &aliasNamesToProcess, std::unordered_set< std::string > const &aliasModulesToProcess, ParameterSet const &proc_pset, std::string const &processName, ProductRegistry &preg)
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists, SubProcessParentageHelper const *subProcessParentageHelper)
Definition: Schedule.cc:724
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:318
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1280
void startPath(StreamContext const &, PathContext const &)
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:323
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
bool wantSummary_
Definition: Schedule.h:330
void setIsMergeable(BranchDescription &)
unsigned transform(const HcalDetId &id, unsigned transformCode)

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

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

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

1269  {
1270  std::vector<ModuleDescription const*> result;
1271  result.reserve(allWorkers().size());
1272 
1273  for (auto const& worker : allWorkers()) {
1274  ModuleDescription const* p = worker->description();
1275  result.push_back(p);
1276  }
1277  return result;
1278  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1280

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

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

Referenced by endJob().

1363  {
1364  rep.eventSummary.totalEvents = 0;
1365  rep.eventSummary.totalEventsPassed = 0;
1366  rep.eventSummary.totalEventsFailed = 0;
1367  for (auto& s : streamSchedules_) {
1368  s->getTriggerReport(rep);
1369  }
1370  sort_all(rep.workerSummaries);
1371  }
rep
Definition: cuy.py:1189
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92

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

References cuy::rep, and summaryTimeKeeper_.

Referenced by endJob().

1373  {
1374  rep.eventSummary.totalEvents = 0;
1375  rep.eventSummary.cpuTime = 0.;
1376  rep.eventSummary.realTime = 0.;
1377  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1378  }
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:326
rep
Definition: cuy.py:1189

◆ initializeEarlyDelete()

void edm::Schedule::initializeEarlyDelete ( std::vector< std::string > const &  branchesToDeleteEarly,
std::multimap< std::string, std::string > const &  referencesToBranches,
std::vector< std::string > const &  modulesToSkip,
edm::ProductRegistry const &  preg 
)

Definition at line 1259 of file Schedule.cc.

References moduleRegistry(), cms::cuda::stream, and streamSchedules_.

1262  {
1263  for (auto& stream : streamSchedules_) {
1264  stream->initializeEarlyDelete(
1265  *moduleRegistry(), branchesToDeleteEarly, referencesToBranches, modulesToSkip, preg);
1266  }
1267  }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::shared_ptr< ModuleRegistry const > moduleRegistry() const
Definition: Schedule.h:312
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ limitOutput()

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

Definition at line 724 of file Schedule.cc.

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

Referenced by finishSetup().

726  {
727  std::string const output("output");
728 
729  ParameterSet const& maxEventsPSet = proc_pset.getUntrackedParameterSet("maxEvents");
730  int maxEventSpecs = 0;
731  int maxEventsOut = -1;
732  ParameterSet const* vMaxEventsOut = nullptr;
733  std::vector<std::string> intNamesE = maxEventsPSet.getParameterNamesForType<int>(false);
734  if (search_all(intNamesE, output)) {
735  maxEventsOut = maxEventsPSet.getUntrackedParameter<int>(output);
736  ++maxEventSpecs;
737  }
738  std::vector<std::string> psetNamesE;
739  maxEventsPSet.getParameterSetNames(psetNamesE, false);
740  if (search_all(psetNamesE, output)) {
741  vMaxEventsOut = &maxEventsPSet.getUntrackedParameterSet(output);
742  ++maxEventSpecs;
743  }
744 
745  if (maxEventSpecs > 1) {
747  << "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
748  }
749 
750  for (auto& c : all_output_communicators_) {
751  OutputModuleDescription desc(branchIDLists, maxEventsOut, subProcessParentageHelper);
752  if (vMaxEventsOut != nullptr && !vMaxEventsOut->empty()) {
753  std::string const& moduleLabel = c->description().moduleLabel();
754  try {
755  desc.maxEvents_ = vMaxEventsOut->getUntrackedParameter<int>(moduleLabel);
756  } catch (Exception const&) {
758  << "\nNo entry in 'maxEvents' for output module label '" << moduleLabel << "'.\n";
759  }
760  }
761  c->configure(desc);
762  }
763  }
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:36
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:323
Definition: output.py:1

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

References streamSchedules_.

1308  {
1309  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1310  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

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

References streamSchedules_.

1302  {
1303  streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1304  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ moduleRegistry() [1/2]

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

Definition at line 312 of file Schedule.h.

References edm::get_underlying_safe(), and moduleRegistry_.

Referenced by initializeEarlyDelete().

constexpr 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:318

◆ moduleRegistry() [2/2]

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

Definition at line 313 of file Schedule.h.

References edm::get_underlying_safe(), and moduleRegistry_.

constexpr 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:318

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

References streamSchedules_.

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

1296  {
1297  streamSchedules_[0]->modulesInPath(iPathLabel, oLabelsToFill);
1298  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ openOutputFiles()

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

Definition at line 1062 of file Schedule.cc.

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

1062  {
1063  using std::placeholders::_1;
1064  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::openFile, _1, std::cref(fb)));
1065  }
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:323

◆ processOneEventAsync()

void edm::Schedule::processOneEventAsync ( WaitingTaskHolder  iTask,
unsigned int  iStreamID,
EventTransitionInfo info,
ServiceToken const &  token 
)

Definition at line 1194 of file Schedule.cc.

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

1197  {
1198  assert(iStreamID < streamSchedules_.size());
1199  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask), info, token, pathStatusInserters_);
1200  }
static const TGPicture * info(bool iBackgroundIsBlack)
assert(be >=bs)
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:316
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319
def move(src, dest)
Definition: eostools.py:511

◆ processOneGlobalAsync()

template<typename T >
void edm::Schedule::processOneGlobalAsync ( WaitingTaskHolder  iTask,
typename T::TransitionInfoType &  transitionInfo,
ServiceToken const &  token,
bool  cleaningUpAfterException = false 
)

Definition at line 345 of file Schedule.h.

References globalSchedule_, and unpackBuffers-CaloStage2::token.

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

348  {
349  globalSchedule_->processOneGlobalAsync<T>(iTaskHolder, transitionInfo, token, cleaningUpAfterException);
350  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:321
long double T

◆ processOneStreamAsync()

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

Definition at line 334 of file Schedule.h.

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

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

338  {
339  assert(iStreamID < streamSchedules_.size());
340  streamSchedules_[iStreamID]->processOneStreamAsync<T>(
341  std::move(iTaskHolder), transitionInfo, token, cleaningUpAfterException);
342  }
assert(be >=bs)
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319
long double T
def move(src, dest)
Definition: eostools.py:511

◆ respondToCloseInputFile()

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

Definition at line 1173 of file Schedule.cc.

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

1173  {
1174  using std::placeholders::_1;
1175  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
1176  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1280
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:184

◆ respondToOpenInputFile()

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

Definition at line 1168 of file Schedule.cc.

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

1168  {
1169  using std::placeholders::_1;
1170  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
1171  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1280
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:183

◆ resultsInserter() [1/2]

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

Definition at line 308 of file Schedule.h.

References edm::get_underlying_safe(), and resultsInserter_.

308  {
310  }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:315

◆ resultsInserter() [2/2]

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

Definition at line 311 of file Schedule.h.

References edm::get_underlying_safe(), and resultsInserter_.

constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:315

◆ shouldWeCloseOutput()

bool edm::Schedule::shouldWeCloseOutput ( ) const

Definition at line 1159 of file Schedule.cc.

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

1159  {
1160  using std::placeholders::_1;
1161  // Return true iff at least one output module returns true.
1162  return (std::find_if(all_output_communicators_.begin(),
1166  }
virtual bool shouldWeCloseFile() const =0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:323

◆ terminate()

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

Return whether each output module has reached its maximum count.

Definition at line 765 of file Schedule.cc.

References all_output_communicators_, and HltBtagPostValidation_cff::c.

765  {
766  if (all_output_communicators_.empty()) {
767  return false;
768  }
769  for (auto& c : all_output_communicators_) {
770  if (!c->limitReached()) {
771  // Found an output module that has not reached output event count.
772  return false;
773  }
774  }
775  LogInfo("SuccessfulTermination") << "The job is terminating successfully because each output module\n"
776  << "has reached its configured limit.\n";
777  return true;
778  }
Log< level::Info, false > LogInfo
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:323

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

References alignCSCRings::s, and streamSchedules_.

Referenced by endJob().

1380  {
1381  int returnValue = 0;
1382  for (auto& s : streamSchedules_) {
1383  returnValue += s->totalEvents();
1384  }
1385  return returnValue;
1386  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

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

References alignCSCRings::s, and streamSchedules_.

1396  {
1397  int returnValue = 0;
1398  for (auto& s : streamSchedules_) {
1399  returnValue += s->totalEventsFailed();
1400  }
1401  return returnValue;
1402  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ totalEventsPassed()

int edm::Schedule::totalEventsPassed ( ) const

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

Definition at line 1388 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

1388  {
1389  int returnValue = 0;
1390  for (auto& s : streamSchedules_) {
1391  returnValue += s->totalEventsPassed();
1392  }
1393  return returnValue;
1394  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

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

References pathNames_.

1292 { oLabelsToFill = *pathNames_; }
std::vector< std::string > const * pathNames_
Definition: Schedule.h:328

◆ writeLumiAsync()

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

Definition at line 1130 of file Schedule.cc.

References all_output_communicators_, edm::LuminosityBlockPrincipal::beginTime(), HltBtagPostValidation_cff::c, CMS_SA_ALLOW, dqmdumpme::first, edm::LuminosityBlockPrincipal::id(), edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), edm::ServiceRegistry::instance(), edm::GlobalContext::kWriteLuminosityBlock, findAndChange::op, edm::ActivityRegistry::postGlobalWriteLumiSignal_, edm::ActivityRegistry::preGlobalWriteLumiSignal_, edm::ServiceRegistry::presentToken(), edm::waiting_task::chain::runLast(), edm::LuminosityBlockPrincipal::runPrincipal(), TrackValidation_cff::task, edm::waiting_task::chain::then(), and unpackBuffers-CaloStage2::token.

1133  {
1135  GlobalContext globalContext(GlobalContext::Transition::kWriteLuminosityBlock,
1136  lbp.id(),
1137  lbp.runPrincipal().index(),
1138  lbp.index(),
1139  lbp.beginTime(),
1140  processContext);
1141 
1142  using namespace edm::waiting_task;
1143  chain::first([&](auto nextTask) {
1145  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteLumiSignal_(globalContext); } catch (...) {
1146  }
1147  for (auto& c : all_output_communicators_) {
1148  c->writeLumiAsync(nextTask, lbp, processContext, activityRegistry);
1149  }
1150  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1151  //services can depend on other services
1153 
1154  activityRegistry->postGlobalWriteLumiSignal_(globalContext);
1155  })) |
1157  }
#define CMS_SA_ALLOW
constexpr auto then(O &&iO)
Definition: chain_first.h:277
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
static ServiceRegistry & instance()
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:323
ServiceToken presentToken() const

◆ writeProcessBlockAsync()

void edm::Schedule::writeProcessBlockAsync ( WaitingTaskHolder  iTask,
ProcessBlockPrincipal const &  pbp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry 
)

Definition at line 1100 of file Schedule.cc.

References all_output_communicators_, HltBtagPostValidation_cff::c, CMS_SA_ALLOW, dqmdumpme::first, edm::ServiceRegistry::instance(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::RunIndex::invalidRunIndex(), edm::Timestamp::invalidTimestamp(), edm::GlobalContext::kWriteProcessBlock, eostools::move(), findAndChange::op, edm::ActivityRegistry::postWriteProcessBlockSignal_, edm::ServiceRegistry::presentToken(), edm::ActivityRegistry::preWriteProcessBlockSignal_, edm::waiting_task::chain::runLast(), TrackValidation_cff::task, edm::waiting_task::chain::then(), and unpackBuffers-CaloStage2::token.

1103  {
1105  GlobalContext globalContext(GlobalContext::Transition::kWriteProcessBlock,
1106  LuminosityBlockID(),
1110  processContext);
1111 
1112  using namespace edm::waiting_task;
1113  chain::first([&](auto nextTask) {
1114  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1116  CMS_SA_ALLOW try { activityRegistry->preWriteProcessBlockSignal_(globalContext); } catch (...) {
1117  }
1118  for (auto& c : all_output_communicators_) {
1119  c->writeProcessBlockAsync(nextTask, pbp, processContext, activityRegistry);
1120  }
1121  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1122  //services can depend on other services
1124 
1125  activityRegistry->postWriteProcessBlockSignal_(globalContext);
1126  })) |
1128  }
#define CMS_SA_ALLOW
static Timestamp invalidTimestamp()
Definition: Timestamp.h:75
constexpr auto then(O &&iO)
Definition: chain_first.h:277
static RunIndex invalidRunIndex()
Definition: RunIndex.cc:9
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
static ServiceRegistry & instance()
static LuminosityBlockIndex invalidLuminosityBlockIndex()
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:323
ServiceToken presentToken() const
def move(src, dest)
Definition: eostools.py:511

◆ writeRunAsync()

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

Definition at line 1067 of file Schedule.cc.

References all_output_communicators_, HltBtagPostValidation_cff::c, CMS_SA_ALLOW, edm::RunPrincipal::endTime(), dqmdumpme::first, edm::RunPrincipal::index(), edm::ServiceRegistry::instance(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::GlobalContext::kWriteRun, findAndChange::op, edm::ActivityRegistry::postGlobalWriteRunSignal_, edm::ActivityRegistry::preGlobalWriteRunSignal_, edm::ServiceRegistry::presentToken(), edm::RunPrincipal::run(), edm::waiting_task::chain::runLast(), TrackValidation_cff::task, edm::waiting_task::chain::then(), and unpackBuffers-CaloStage2::token.

1071  {
1073  GlobalContext globalContext(GlobalContext::Transition::kWriteRun,
1074  LuminosityBlockID(rp.run(), 0),
1075  rp.index(),
1077  rp.endTime(),
1078  processContext);
1079 
1080  using namespace edm::waiting_task;
1081  chain::first([&](auto nextTask) {
1082  //services can depend on other services
1084 
1085  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1086  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteRunSignal_(globalContext); } catch (...) {
1087  }
1088  for (auto& c : all_output_communicators_) {
1089  c->writeRunAsync(nextTask, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1090  }
1091  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1092  //services can depend on other services
1094 
1095  activityRegistry->postGlobalWriteRunSignal_(globalContext);
1096  })) |
1098  }
#define CMS_SA_ALLOW
constexpr auto then(O &&iO)
Definition: chain_first.h:277
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
static ServiceRegistry & instance()
static LuminosityBlockIndex invalidLuminosityBlockIndex()
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:323
ServiceToken presentToken() const

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

Referenced by endPaths().

◆ endPathStatusInserters_

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

Definition at line 317 of file Schedule.h.

◆ globalSchedule_

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

◆ moduleRegistry_

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

Definition at line 318 of file Schedule.h.

Referenced by changeModule(), deleteModule(), finishSetup(), and moduleRegistry().

◆ pathNames_

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

Definition at line 328 of file Schedule.h.

Referenced by triggerPaths().

◆ pathStatusInserters_

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

Definition at line 316 of file Schedule.h.

Referenced by processOneEventAsync().

◆ preallocConfig_

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 324 of file Schedule.h.

Referenced by changeModule(), and endJob().

◆ resultsInserter_

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

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

Referenced by finishSetup(), and getTriggerTimingReport().

◆ wantSummary_

bool edm::Schedule::wantSummary_
private

Definition at line 330 of file Schedule.h.

Referenced by endJob(), and finishSetup().