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

References globalSchedule_.

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

1287 { 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 1295 of file Schedule.cc.

References streamSchedules_.

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

1295  {
1296  streamSchedules_[0]->availablePaths(oLabelsToFill);
1297  }
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 1185 of file Schedule.cc.

References globalSchedule_.

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

◆ beginStream()

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

Definition at line 1191 of file Schedule.cc.

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

1191  {
1192  assert(iStreamID < streamSchedules_.size());
1193  streamSchedules_[iStreamID]->beginStream();
1194  }
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 1209 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_.

1212  {
1213  Worker* found = nullptr;
1214  for (auto const& worker : allWorkers()) {
1215  if (worker->description()->moduleLabel() == iLabel) {
1216  found = worker;
1217  break;
1218  }
1219  }
1220  if (nullptr == found) {
1221  return false;
1222  }
1223 
1224  auto newMod = moduleRegistry_->replaceModule(iLabel, iPSet, preallocConfig_);
1225 
1226  globalSchedule_->replaceModule(newMod, iLabel);
1227 
1228  for (auto& s : streamSchedules_) {
1229  s->replaceModule(newMod, iLabel);
1230  }
1231 
1232  {
1233  //Need to updateLookup in order to make getByToken work
1234  auto const processBlockLookup = iRegistry.productLookup(InProcess);
1235  auto const runLookup = iRegistry.productLookup(InRun);
1236  auto const lumiLookup = iRegistry.productLookup(InLumi);
1237  auto const eventLookup = iRegistry.productLookup(InEvent);
1238  found->updateLookup(InProcess, *runLookup);
1239  found->updateLookup(InRun, *runLookup);
1240  found->updateLookup(InLumi, *lumiLookup);
1241  found->updateLookup(InEvent, *eventLookup);
1242  found->updateLookup(iIndices);
1243 
1244  auto const& processName = newMod->moduleDescription().processName();
1245  auto const& processBlockModuleToIndicies = processBlockLookup->indiciesForModulesInProcess(processName);
1246  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1247  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1248  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1249  found->resolvePutIndicies(InProcess, processBlockModuleToIndicies);
1250  found->resolvePutIndicies(InRun, runModuleToIndicies);
1251  found->resolvePutIndicies(InLumi, lumiModuleToIndicies);
1252  found->resolvePutIndicies(InEvent, eventModuleToIndicies);
1253  }
1254 
1255  return true;
1256  }
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:1287

◆ clearCounters()

void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1411 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

1411  {
1412  for (auto& s : streamSchedules_) {
1413  s->clearCounters();
1414  }
1415  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:319

◆ closeOutputFiles()

void edm::Schedule::closeOutputFiles ( )

Definition at line 1061 of file Schedule.cc.

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

1061  {
1062  using std::placeholders::_1;
1064  for (auto& worker : allWorkers()) {
1065  worker->respondToCloseOutputFile();
1066  }
1067  }
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:1287
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 1289 of file Schedule.cc.

References allWorkers(), and SimL1EmulatorRepack_CalouGT_cff::processName.

1289  {
1290  for (auto const& worker : allWorkers()) {
1291  worker->convertCurrentProcessAlias(processName);
1292  }
1293  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1287

◆ deleteModule()

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

Deletes module with label iLabel.

Definition at line 1258 of file Schedule.cc.

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

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

References endPathNames_.

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

◆ endStream()

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

Definition at line 1196 of file Schedule.cc.

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

1196  {
1197  assert(iStreamID < streamSchedules_.size());
1198  streamSchedules_[iStreamID]->endStream();
1199  }
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 1319 of file Schedule.cc.

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

1324  {
1325  allModuleDescriptions.clear();
1326  moduleIDToIndex.clear();
1327  for (auto iBranchType = 0U; iBranchType < NumBranchTypes; ++iBranchType) {
1328  modulesWhoseProductsAreConsumedBy[iBranchType].clear();
1329  }
1330  modulesInPreviousProcessesWhoseProductsAreConsumedBy.clear();
1331 
1332  allModuleDescriptions.reserve(allWorkers().size());
1333  moduleIDToIndex.reserve(allWorkers().size());
1334  for (auto iBranchType = 0U; iBranchType < NumBranchTypes; ++iBranchType) {
1335  modulesWhoseProductsAreConsumedBy[iBranchType].resize(allWorkers().size());
1336  }
1337  modulesInPreviousProcessesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1338 
1339  std::map<std::string, ModuleDescription const*> labelToDesc;
1340  unsigned int i = 0;
1341  for (auto const& worker : allWorkers()) {
1342  ModuleDescription const* p = worker->description();
1343  allModuleDescriptions.push_back(p);
1344  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1345  labelToDesc[p->moduleLabel()] = p;
1346  ++i;
1347  }
1348  sort_all(moduleIDToIndex);
1349 
1350  i = 0;
1351  for (auto const& worker : allWorkers()) {
1352  std::array<std::vector<ModuleDescription const*>*, NumBranchTypes> modules;
1353  for (auto iBranchType = 0U; iBranchType < NumBranchTypes; ++iBranchType) {
1354  modules[iBranchType] = &modulesWhoseProductsAreConsumedBy[iBranchType].at(i);
1355  }
1356 
1357  std::vector<ModuleProcessName>& modulesInPreviousProcesses =
1358  modulesInPreviousProcessesWhoseProductsAreConsumedBy.at(i);
1359  try {
1360  worker->modulesWhoseProductsAreConsumed(modules, modulesInPreviousProcesses, preg, labelToDesc);
1361  } catch (cms::Exception& ex) {
1362  ex.addContext("Calling Worker::modulesWhoseProductsAreConsumed() for module " +
1363  worker->description()->moduleLabel());
1364  throw;
1365  }
1366  ++i;
1367  }
1368  }
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:1287
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(), 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_, 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:1287
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 1276 of file Schedule.cc.

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

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

1276  {
1277  std::vector<ModuleDescription const*> result;
1278  result.reserve(allWorkers().size());
1279 
1280  for (auto const& worker : allWorkers()) {
1281  ModuleDescription const* p = worker->description();
1282  result.push_back(p);
1283  }
1284  return result;
1285  }
size
Write out results.
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1287

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

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

Referenced by endJob().

1370  {
1371  rep.eventSummary.totalEvents = 0;
1372  rep.eventSummary.totalEventsPassed = 0;
1373  rep.eventSummary.totalEventsFailed = 0;
1374  for (auto& s : streamSchedules_) {
1375  s->getTriggerReport(rep);
1376  }
1377  sort_all(rep.workerSummaries);
1378  }
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 1380 of file Schedule.cc.

References cuy::rep, and summaryTimeKeeper_.

Referenced by endJob().

1380  {
1381  rep.eventSummary.totalEvents = 0;
1382  rep.eventSummary.cpuTime = 0.;
1383  rep.eventSummary.realTime = 0.;
1384  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1385  }
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 1266 of file Schedule.cc.

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

1269  {
1270  for (auto& stream : streamSchedules_) {
1271  stream->initializeEarlyDelete(
1272  *moduleRegistry(), branchesToDeleteEarly, referencesToBranches, modulesToSkip, preg);
1273  }
1274  }
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

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

References streamSchedules_.

1315  {
1316  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1317  }
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 1307 of file Schedule.cc.

References streamSchedules_.

1309  {
1310  streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1311  }
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 1303 of file Schedule.cc.

References streamSchedules_.

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

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

◆ openOutputFiles()

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

Definition at line 1069 of file Schedule.cc.

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

1069  {
1070  using std::placeholders::_1;
1071  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::openFile, _1, std::cref(fb)));
1072  }
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 1201 of file Schedule.cc.

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

1204  {
1205  assert(iStreamID < streamSchedules_.size());
1206  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask), info, token, pathStatusInserters_);
1207  }
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 1180 of file Schedule.cc.

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

1180  {
1181  using std::placeholders::_1;
1182  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
1183  }
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:1287
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:184

◆ respondToOpenInputFile()

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

Definition at line 1175 of file Schedule.cc.

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

1175  {
1176  using std::placeholders::_1;
1177  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
1178  }
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:1287
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 1166 of file Schedule.cc.

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

1166  {
1167  using std::placeholders::_1;
1168  // Return true iff at least one output module returns true.
1169  return (std::find_if(all_output_communicators_.begin(),
1173  }
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 1387 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

Referenced by endJob().

1387  {
1388  int returnValue = 0;
1389  for (auto& s : streamSchedules_) {
1390  returnValue += s->totalEvents();
1391  }
1392  return returnValue;
1393  }
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 1403 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

1403  {
1404  int returnValue = 0;
1405  for (auto& s : streamSchedules_) {
1406  returnValue += s->totalEventsFailed();
1407  }
1408  return returnValue;
1409  }
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 1395 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

1395  {
1396  int returnValue = 0;
1397  for (auto& s : streamSchedules_) {
1398  returnValue += s->totalEventsPassed();
1399  }
1400  return returnValue;
1401  }
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 1299 of file Schedule.cc.

References pathNames_.

1299 { 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 1137 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.

1140  {
1142  GlobalContext globalContext(GlobalContext::Transition::kWriteLuminosityBlock,
1143  lbp.id(),
1144  lbp.runPrincipal().index(),
1145  lbp.index(),
1146  lbp.beginTime(),
1147  processContext);
1148 
1149  using namespace edm::waiting_task;
1150  chain::first([&](auto nextTask) {
1152  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteLumiSignal_(globalContext); } catch (...) {
1153  }
1154  for (auto& c : all_output_communicators_) {
1155  c->writeLumiAsync(nextTask, lbp, processContext, activityRegistry);
1156  }
1157  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1158  //services can depend on other services
1160 
1161  activityRegistry->postGlobalWriteLumiSignal_(globalContext);
1162  })) |
1164  }
#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 1107 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.

1110  {
1112  GlobalContext globalContext(GlobalContext::Transition::kWriteProcessBlock,
1113  LuminosityBlockID(),
1117  processContext);
1118 
1119  using namespace edm::waiting_task;
1120  chain::first([&](auto nextTask) {
1121  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1123  CMS_SA_ALLOW try { activityRegistry->preWriteProcessBlockSignal_(globalContext); } catch (...) {
1124  }
1125  for (auto& c : all_output_communicators_) {
1126  c->writeProcessBlockAsync(nextTask, pbp, processContext, activityRegistry);
1127  }
1128  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1129  //services can depend on other services
1131 
1132  activityRegistry->postWriteProcessBlockSignal_(globalContext);
1133  })) |
1135  }
#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 1074 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.

1078  {
1080  GlobalContext globalContext(GlobalContext::Transition::kWriteRun,
1081  LuminosityBlockID(rp.run(), 0),
1082  rp.index(),
1084  rp.endTime(),
1085  processContext);
1086 
1087  using namespace edm::waiting_task;
1088  chain::first([&](auto nextTask) {
1089  //services can depend on other services
1091 
1092  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1093  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteRunSignal_(globalContext); } catch (...) {
1094  }
1095  for (auto& c : all_output_communicators_) {
1096  c->writeRunAsync(nextTask, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1097  }
1098  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1099  //services can depend on other services
1101 
1102  activityRegistry->postGlobalWriteRunSignal_(globalContext);
1103  })) |
1105  }
#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().