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  if (endPathNames_->size() > 1) {
514  //NOTE: FinalPaths are a type of EndPath
515  makePathStatusInserters(endPathStatusInserters_,
516  *endPathNames_,
517  prealloc,
518  preg,
519  areg,
520  processConfiguration,
521  std::string("EndPathStatusInserter"));
522  }
523 
524  assert(0 < prealloc.numberOfStreams());
525  streamSchedules_.reserve(prealloc.numberOfStreams());
526  for (unsigned int i = 0; i < prealloc.numberOfStreams(); ++i) {
527  streamSchedules_.emplace_back(make_shared_noexcept_false<StreamSchedule>(resultsInserter(),
530  moduleRegistry(),
531  proc_pset,
532  tns,
533  prealloc,
534  preg,
535  actions,
536  areg,
537  processConfiguration,
538  StreamID{i},
539  processContext));
540  }
541 
542  //TriggerResults are injected automatically by StreamSchedules and are
543  // unknown to the ModuleRegistry
544  const std::string kTriggerResults("TriggerResults");
545  std::vector<std::string> modulesToUse;
546  modulesToUse.reserve(streamSchedules_[0]->allWorkers().size());
547  for (auto const& worker : streamSchedules_[0]->allWorkers()) {
548  if (worker->description()->moduleLabel() != kTriggerResults) {
549  modulesToUse.push_back(worker->description()->moduleLabel());
550  }
551  }
552  //The unscheduled modules are at the end of the list, but we want them at the front
553  unsigned int const nUnscheduledModules = streamSchedules_[0]->numberOfUnscheduledModules();
554  if (nUnscheduledModules > 0) {
555  std::vector<std::string> temp;
556  temp.reserve(modulesToUse.size());
557  auto itBeginUnscheduled = modulesToUse.begin() + modulesToUse.size() - nUnscheduledModules;
558  std::copy(itBeginUnscheduled, modulesToUse.end(), std::back_inserter(temp));
559  std::copy(modulesToUse.begin(), itBeginUnscheduled, std::back_inserter(temp));
560  temp.swap(modulesToUse);
561  }
562 
563  // propagate_const<T> has no reset() function
564  globalSchedule_ = std::make_unique<GlobalSchedule>(resultsInserter(),
567  moduleRegistry(),
568  modulesToUse,
569  proc_pset,
570  preg,
571  prealloc,
572  actions,
573  areg,
574  processConfiguration,
575  processContext);
576  }
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:1283
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 1283 of file Schedule.cc.

References globalSchedule_.

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

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

References streamSchedules_.

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

1291  {
1292  streamSchedules_[0]->availablePaths(oLabelsToFill);
1293  }
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 1181 of file Schedule.cc.

References globalSchedule_.

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

◆ beginStream()

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

Definition at line 1187 of file Schedule.cc.

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

1187  {
1188  assert(iStreamID < streamSchedules_.size());
1189  streamSchedules_[iStreamID]->beginStream();
1190  }
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 1205 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_.

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

◆ clearCounters()

void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1407 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

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

◆ closeOutputFiles()

void edm::Schedule::closeOutputFiles ( )

Definition at line 1057 of file Schedule.cc.

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

1057  {
1058  using std::placeholders::_1;
1060  for (auto& worker : allWorkers()) {
1061  worker->respondToCloseOutputFile();
1062  }
1063  }
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:1283
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 1285 of file Schedule.cc.

References allWorkers(), and SimL1EmulatorRepack_CalouGT_cff::processName.

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

◆ deleteModule()

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

Deletes module with label iLabel.

Definition at line 1254 of file Schedule.cc.

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

1254  {
1255  globalSchedule_->deleteModule(iLabel);
1256  for (auto& stream : streamSchedules_) {
1257  stream->deleteModule(iLabel);
1258  }
1259  moduleRegistry_->deleteModule(iLabel, areg->preModuleDestructionSignal_, areg->postModuleDestructionSignal_);
1260  }
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 783 of file Schedule.cc.

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

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

◆ endPaths()

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

adds to oLabelsToFill the labels for all end paths in the process

Definition at line 1297 of file Schedule.cc.

References endPathNames_.

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

◆ endStream()

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

Definition at line 1192 of file Schedule.cc.

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

1192  {
1193  assert(iStreamID < streamSchedules_.size());
1194  streamSchedules_[iStreamID]->endStream();
1195  }
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 1315 of file Schedule.cc.

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

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

References all_output_communicators_, allWorkers(), edm::ProductRegistry::anyProductProduced(), cms::cuda::assert(), edm::BranchIDListHelper::branchIDLists(), HltBtagPostValidation_cff::c, edm::maker::ModuleHolder::createOutputModuleCommunicator(), edm::service::TriggerNamesService::getEndPaths(), edm::ParameterSet::getParameter(), edm::ParameterSet::id(), limitOutput(), moduleRegistry_, edm::PreallocationConfiguration::numberOfStreams(), edm::SystemTimeKeeper::pauseModuleEvent(), edm::detail::processEDAliases(), edm::PRODUCT_TYPE, edm::ProductRegistry::productListUpdator(), edm::ParameterSet::registerIt(), edm::SystemTimeKeeper::removeModuleIfExists(), edm::SystemTimeKeeper::restartModuleEvent(), edm::ProductRegistry::setFrozen(), edm::setIsMergeable(), edm::ProductRegistry::setUnscheduledProducts(), edm::SystemTimeKeeper::startEvent(), edm::SystemTimeKeeper::startModuleEvent(), edm::SystemTimeKeeper::startPath(), edm::SystemTimeKeeper::startProcessingLoop(), edm::SystemTimeKeeper::stopEvent(), edm::SystemTimeKeeper::stopModuleEvent(), edm::SystemTimeKeeper::stopPath(), edm::SystemTimeKeeper::stopProcessingLoop(), streamSchedules_, AlCaHLTBitMon_QueryRunRegistry::string, summaryTimeKeeper_, HcalDetIdTransform::transform(), edm::ProcessBlockHelperBase::updateForNewProcess(), edm::BranchIDListHelper::updateFromRegistry(), wantSummary_, and EcalCalibMonitorClient_cfi::workers.

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

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

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

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

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

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

Referenced by endJob().

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

References cuy::rep, and summaryTimeKeeper_.

Referenced by endJob().

1376  {
1377  rep.eventSummary.totalEvents = 0;
1378  rep.eventSummary.cpuTime = 0.;
1379  rep.eventSummary.realTime = 0.;
1380  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1381  }
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 1262 of file Schedule.cc.

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

1265  {
1266  for (auto& stream : streamSchedules_) {
1267  stream->initializeEarlyDelete(
1268  *moduleRegistry(), branchesToDeleteEarly, referencesToBranches, modulesToSkip, preg);
1269  }
1270  }
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 727 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().

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

◆ moduleDescriptionsInEndPath()

void edm::Schedule::moduleDescriptionsInEndPath ( std::string const &  iEndPathLabel,
std::vector< ModuleDescription const *> &  descriptions,
unsigned int  hint 
) const

adds the ModuleDescriptions into the vector for the modules scheduled in path iEndPathLabel hint is a performance optimization if you might know the position of the module in the path

Definition at line 1309 of file Schedule.cc.

References streamSchedules_.

1311  {
1312  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1313  }
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 1303 of file Schedule.cc.

References streamSchedules_.

1305  {
1306  streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1307  }
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 1299 of file Schedule.cc.

References streamSchedules_.

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

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

◆ openOutputFiles()

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

Definition at line 1065 of file Schedule.cc.

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

1065  {
1066  using std::placeholders::_1;
1067  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::openFile, _1, std::cref(fb)));
1068  }
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 1197 of file Schedule.cc.

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

1200  {
1201  assert(iStreamID < streamSchedules_.size());
1202  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask), info, token, pathStatusInserters_);
1203  }
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 1176 of file Schedule.cc.

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

1176  {
1177  using std::placeholders::_1;
1178  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
1179  }
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:1283
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:184

◆ respondToOpenInputFile()

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

Definition at line 1171 of file Schedule.cc.

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

1171  {
1172  using std::placeholders::_1;
1173  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
1174  }
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:1283
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 1162 of file Schedule.cc.

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

1162  {
1163  using std::placeholders::_1;
1164  // Return true iff at least one output module returns true.
1165  return (std::find_if(all_output_communicators_.begin(),
1169  }
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 768 of file Schedule.cc.

References all_output_communicators_, and HltBtagPostValidation_cff::c.

768  {
769  if (all_output_communicators_.empty()) {
770  return false;
771  }
772  for (auto& c : all_output_communicators_) {
773  if (!c->limitReached()) {
774  // Found an output module that has not reached output event count.
775  return false;
776  }
777  }
778  LogInfo("SuccessfulTermination") << "The job is terminating successfully because each output module\n"
779  << "has reached its configured limit.\n";
780  return true;
781  }
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 1383 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

Referenced by endJob().

1383  {
1384  int returnValue = 0;
1385  for (auto& s : streamSchedules_) {
1386  returnValue += s->totalEvents();
1387  }
1388  return returnValue;
1389  }
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 1399 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

1399  {
1400  int returnValue = 0;
1401  for (auto& s : streamSchedules_) {
1402  returnValue += s->totalEventsFailed();
1403  }
1404  return returnValue;
1405  }
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 1391 of file Schedule.cc.

References alignCSCRings::s, and streamSchedules_.

1391  {
1392  int returnValue = 0;
1393  for (auto& s : streamSchedules_) {
1394  returnValue += s->totalEventsPassed();
1395  }
1396  return returnValue;
1397  }
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 1295 of file Schedule.cc.

References pathNames_.

1295 { 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 1133 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.

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

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

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