CMS 3D CMS Logo

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

#include <Schedule.h>

Public Types

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

Public Member Functions

AllWorkers const & allWorkers () const
 returns the collection of pointers to workers More...
 
void availablePaths (std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill the labels for all paths in the process More...
 
void beginJob (ProductRegistry const &, eventsetup::ESRecordsToProxyIndices const &, ProcessBlockHelperBase const &)
 
void beginStream (unsigned int)
 
bool changeModule (std::string const &iLabel, ParameterSet const &iPSet, const ProductRegistry &iRegistry, eventsetup::ESRecordsToProxyIndices const &)
 
void clearCounters ()
 Clear all the counters in the trigger report. More...
 
void closeOutputFiles ()
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
void 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)
 
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 123 of file Schedule.h.

Member Typedef Documentation

◆ AllOutputModuleCommunicators

Definition at line 127 of file Schedule.h.

◆ AllWorkers

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

Definition at line 126 of file Schedule.h.

◆ vstring

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

Definition at line 125 of file Schedule.h.

◆ Workers

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

Definition at line 129 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 
)

Definition at line 479 of file Schedule.cc.

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

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

Member Function Documentation

◆ allWorkers()

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

returns the collection of pointers to workers

Definition at line 1279 of file Schedule.cc.

References globalSchedule_.

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

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

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

References streamSchedules_.

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

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

◆ beginJob()

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

Definition at line 1177 of file Schedule.cc.

References globalSchedule_.

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

◆ beginStream()

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

Definition at line 1183 of file Schedule.cc.

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

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

◆ changeModule()

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

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

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

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

◆ clearCounters()

void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1403 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

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

◆ closeOutputFiles()

void edm::Schedule::closeOutputFiles ( )

Definition at line 1053 of file Schedule.cc.

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

1053  {
1054  using std::placeholders::_1;
1056  for (auto& worker : allWorkers()) {
1057  worker->respondToCloseOutputFile();
1058  }
1059  }
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:1279
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:319

◆ convertCurrentProcessAlias()

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

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

Definition at line 1281 of file Schedule.cc.

References allWorkers(), and SimL1EmulatorRepack_CalouGT_cff::processName.

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

◆ deleteModule()

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

Deletes module with label iLabel.

Definition at line 1250 of file Schedule.cc.

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

1250  {
1251  globalSchedule_->deleteModule(iLabel);
1252  for (auto& stream : streamSchedules_) {
1253  stream->deleteModule(iLabel);
1254  }
1255  moduleRegistry_->deleteModule(iLabel, areg->preModuleDestructionSignal_, areg->postModuleDestructionSignal_);
1256  }
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:317
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:314
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:315

◆ endJob()

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

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

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

References endPathNames_.

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

◆ endStream()

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

Definition at line 1188 of file Schedule.cc.

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

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

◆ 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 1311 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.

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

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

References all_output_communicators_, allWorkers(), edm::ProductRegistry::anyProductProduced(), cms::cuda::assert(), edm::BranchIDListHelper::branchIDLists(), 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.

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

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

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

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

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

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

Referenced by endJob().

1362  {
1363  rep.eventSummary.totalEvents = 0;
1364  rep.eventSummary.totalEventsPassed = 0;
1365  rep.eventSummary.totalEventsFailed = 0;
1366  for (auto& s : streamSchedules_) {
1367  s->getTriggerReport(rep);
1368  }
1369  sort_all(rep.workerSummaries);
1370  }
rep
Definition: cuy.py:1189
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:315
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 1372 of file Schedule.cc.

References cuy::rep, and summaryTimeKeeper_.

Referenced by endJob().

1372  {
1373  rep.eventSummary.totalEvents = 0;
1374  rep.eventSummary.cpuTime = 0.;
1375  rep.eventSummary.realTime = 0.;
1376  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1377  }
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:322
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 1258 of file Schedule.cc.

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

1261  {
1262  for (auto& stream : streamSchedules_) {
1263  stream->initializeEarlyDelete(
1264  *moduleRegistry(), branchesToDeleteEarly, referencesToBranches, modulesToSkip, preg);
1265  }
1266  }
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:308
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:315

◆ limitOutput()

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

Definition at line 716 of file Schedule.cc.

References all_output_communicators_, 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().

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

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

References streamSchedules_.

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

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

References streamSchedules_.

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

◆ moduleRegistry() [1/2]

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

Definition at line 308 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:314

◆ moduleRegistry() [2/2]

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

Definition at line 309 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:314

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

References streamSchedules_.

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

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

◆ openOutputFiles()

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

Definition at line 1061 of file Schedule.cc.

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

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

◆ processOneEventAsync()

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

Definition at line 1193 of file Schedule.cc.

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

1196  {
1197  assert(iStreamID < streamSchedules_.size());
1198  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask), info, token, pathStatusInserters_);
1199  }
static const TGPicture * info(bool iBackgroundIsBlack)
assert(be >=bs)
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:312
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:315
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 341 of file Schedule.h.

References globalSchedule_, and unpackBuffers-CaloStage2::token.

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

344  {
345  globalSchedule_->processOneGlobalAsync<T>(iTaskHolder, transitionInfo, token, cleaningUpAfterException);
346  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:317
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 330 of file Schedule.h.

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

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

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

◆ respondToCloseInputFile()

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

Definition at line 1172 of file Schedule.cc.

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

1172  {
1173  using std::placeholders::_1;
1174  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
1175  }
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:1279
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:184

◆ respondToOpenInputFile()

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

Definition at line 1167 of file Schedule.cc.

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

1167  {
1168  using std::placeholders::_1;
1169  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
1170  }
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:1279
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 304 of file Schedule.h.

References edm::get_underlying_safe(), and resultsInserter_.

304  {
306  }
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:311

◆ resultsInserter() [2/2]

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

Definition at line 307 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:311

◆ shouldWeCloseOutput()

bool edm::Schedule::shouldWeCloseOutput ( ) const

Definition at line 1158 of file Schedule.cc.

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

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

◆ terminate()

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

Return whether each output module has reached its maximum count.

Definition at line 757 of file Schedule.cc.

References all_output_communicators_, and c.

757  {
758  if (all_output_communicators_.empty()) {
759  return false;
760  }
761  for (auto& c : all_output_communicators_) {
762  if (!c->limitReached()) {
763  // Found an output module that has not reached output event count.
764  return false;
765  }
766  }
767  LogInfo("SuccessfulTermination") << "The job is terminating successfully because each output module\n"
768  << "has reached its configured limit.\n";
769  return true;
770  }
Log< level::Info, false > LogInfo
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:319

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

References alignCSCRings::s, and streamSchedules_.

Referenced by endJob().

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

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

References alignCSCRings::s, and streamSchedules_.

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

◆ totalEventsPassed()

int edm::Schedule::totalEventsPassed ( ) const

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

Definition at line 1387 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

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

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

References pathNames_.

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

◆ writeLumiAsync()

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

Definition at line 1129 of file Schedule.cc.

References all_output_communicators_, edm::LuminosityBlockPrincipal::beginTime(), c, CMS_SA_ALLOW, first, edm::LuminosityBlockPrincipal::id(), edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), edm::ServiceRegistry::instance(), edm::GlobalContext::kWriteLuminosityBlock, 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.

1132  {
1134  GlobalContext globalContext(GlobalContext::Transition::kWriteLuminosityBlock,
1135  lbp.id(),
1136  lbp.runPrincipal().index(),
1137  lbp.index(),
1138  lbp.beginTime(),
1139  processContext);
1140 
1141  using namespace edm::waiting_task;
1142  chain::first([&](auto nextTask) {
1144  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteLumiSignal_(globalContext); } catch (...) {
1145  }
1146  for (auto& c : all_output_communicators_) {
1147  c->writeLumiAsync(nextTask, lbp, processContext, activityRegistry);
1148  }
1149  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1150  //services can depend on other services
1152 
1153  activityRegistry->postGlobalWriteLumiSignal_(globalContext);
1154  })) |
1156  }
#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:319
ServiceToken presentToken() const

◆ writeProcessBlockAsync()

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

Definition at line 1099 of file Schedule.cc.

References all_output_communicators_, c, CMS_SA_ALLOW, first, edm::ServiceRegistry::instance(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::RunIndex::invalidRunIndex(), edm::Timestamp::invalidTimestamp(), edm::GlobalContext::kWriteProcessBlock, eostools::move(), 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.

1102  {
1104  GlobalContext globalContext(GlobalContext::Transition::kWriteProcessBlock,
1105  LuminosityBlockID(),
1109  processContext);
1110 
1111  using namespace edm::waiting_task;
1112  chain::first([&](auto nextTask) {
1113  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1115  CMS_SA_ALLOW try { activityRegistry->preWriteProcessBlockSignal_(globalContext); } catch (...) {
1116  }
1117  for (auto& c : all_output_communicators_) {
1118  c->writeProcessBlockAsync(nextTask, pbp, processContext, activityRegistry);
1119  }
1120  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1121  //services can depend on other services
1123 
1124  activityRegistry->postWriteProcessBlockSignal_(globalContext);
1125  })) |
1127  }
#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:319
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 1066 of file Schedule.cc.

References all_output_communicators_, c, CMS_SA_ALLOW, edm::RunPrincipal::endTime(), first, edm::RunPrincipal::index(), edm::ServiceRegistry::instance(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::GlobalContext::kWriteRun, 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.

1070  {
1072  GlobalContext globalContext(GlobalContext::Transition::kWriteRun,
1073  LuminosityBlockID(rp.run(), 0),
1074  rp.index(),
1076  rp.endTime(),
1077  processContext);
1078 
1079  using namespace edm::waiting_task;
1080  chain::first([&](auto nextTask) {
1081  //services can depend on other services
1083 
1084  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1085  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteRunSignal_(globalContext); } catch (...) {
1086  }
1087  for (auto& c : all_output_communicators_) {
1088  c->writeRunAsync(nextTask, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1089  }
1090  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1091  //services can depend on other services
1093 
1094  activityRegistry->postGlobalWriteRunSignal_(globalContext);
1095  })) |
1097  }
#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:319
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 325 of file Schedule.h.

Referenced by endPaths().

◆ endPathStatusInserters_

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

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

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

◆ pathNames_

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

Definition at line 324 of file Schedule.h.

Referenced by triggerPaths().

◆ pathStatusInserters_

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

Definition at line 312 of file Schedule.h.

Referenced by processOneEventAsync().

◆ preallocConfig_

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 320 of file Schedule.h.

Referenced by changeModule(), and endJob().

◆ resultsInserter_

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

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

Referenced by finishSetup(), and getTriggerTimingReport().

◆ wantSummary_

bool edm::Schedule::wantSummary_
private

Definition at line 326 of file Schedule.h.

Referenced by endJob(), and finishSetup().