CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
std::vector< ModuleDescription
const * > 
getAllModuleDescriptions () const
 
void getTriggerReport (TriggerReport &rep) const
 
void getTriggerTimingReport (TriggerTimingReport &rep) const
 
void initializeEarlyDelete (std::vector< std::string > const &branchesToDeleteEarly, 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, BranchIDListHelper &branchIDListHelper, ProcessBlockHelperBase &, ThinnedAssociationsHelper &thinnedAssociationsHelper, SubProcessParentageHelper const *subProcessParentageHelper, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration > processConfiguration, bool hasSubprocesses, PreallocationConfiguration const &config, ProcessContext const *processContext)
 
bool shouldWeCloseOutput () const
 
bool terminate () const
 Return whether each output module has reached its maximum count. More...
 
int totalEvents () const
 
int totalEventsFailed () const
 
int totalEventsPassed () const
 
void triggerPaths (std::vector< std::string > &oLabelsToFill) const
 
void writeLumiAsync (WaitingTaskHolder iTask, LuminosityBlockPrincipal const &lbp, ProcessContext const *, ActivityRegistry *)
 
void 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 122 of file Schedule.h.

Member Typedef Documentation

Definition at line 126 of file Schedule.h.

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

Definition at line 125 of file Schedule.h.

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

Definition at line 124 of file Schedule.h.

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

Definition at line 128 of file Schedule.h.

Constructor & Destructor Documentation

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

Definition at line 671 of file Schedule.cc.

References edm::service::TriggerNamesService::getTrigPaths().

684  : //Only create a resultsInserter if there is a trigger path
685  resultsInserter_{tns.getTrigPaths().empty()
686  ? std::shared_ptr<TriggerResultInserter>{}
pathNames_ & tns()), endPathNames_(&tns.getEndPaths()), wantSummary_(tns.wantSummary()
Definition: Schedule.cc:691
edm::propagate_const< std::shared_ptr< TriggerResultInserter > > resultsInserter_
Definition: Schedule.h:300

Member Function Documentation

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

returns the collection of pointers to workers

Definition at line 1451 of file Schedule.cc.

References globalSchedule_.

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

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

adds to oLabelsToFill the labels for all paths in the process

Definition at line 1459 of file Schedule.cc.

References streamSchedules_.

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

1459  {
1460  streamSchedules_[0]->availablePaths(oLabelsToFill);
1461  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
void edm::Schedule::beginJob ( ProductRegistry const &  iRegistry,
eventsetup::ESRecordsToProxyIndices const &  iESIndices,
ProcessBlockHelperBase const &  processBlockHelperBase 
)

Definition at line 1352 of file Schedule.cc.

References globalSchedule_.

1354  {
1355  globalSchedule_->beginJob(iRegistry, iESIndices, processBlockHelperBase);
1356  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:306
void edm::Schedule::beginStream ( unsigned int  iStreamID)

Definition at line 1358 of file Schedule.cc.

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

1358  {
1359  assert(iStreamID < streamSchedules_.size());
1360  streamSchedules_[iStreamID]->beginStream();
1361  }
assert(be >=bs)
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
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 1376 of file Schedule.cc.

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

1379  {
1380  Worker* found = nullptr;
1381  for (auto const& worker : allWorkers()) {
1382  if (worker->description()->moduleLabel() == iLabel) {
1383  found = worker;
1384  break;
1385  }
1386  }
1387  if (nullptr == found) {
1388  return false;
1389  }
1390 
1391  auto newMod = moduleRegistry_->replaceModule(iLabel, iPSet, preallocConfig_);
1392 
1393  globalSchedule_->replaceModule(newMod, iLabel);
1394 
1395  for (auto& s : streamSchedules_) {
1396  s->replaceModule(newMod, iLabel);
1397  }
1398 
1399  {
1400  //Need to updateLookup in order to make getByToken work
1401  auto const processBlockLookup = iRegistry.productLookup(InProcess);
1402  auto const runLookup = iRegistry.productLookup(InRun);
1403  auto const lumiLookup = iRegistry.productLookup(InLumi);
1404  auto const eventLookup = iRegistry.productLookup(InEvent);
1405  found->updateLookup(InProcess, *runLookup);
1406  found->updateLookup(InRun, *runLookup);
1407  found->updateLookup(InLumi, *lumiLookup);
1408  found->updateLookup(InEvent, *eventLookup);
1409  found->updateLookup(iIndices);
1410 
1411  auto const& processName = newMod->moduleDescription().processName();
1412  auto const& processBlockModuleToIndicies = processBlockLookup->indiciesForModulesInProcess(processName);
1413  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1414  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1415  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1416  found->resolvePutIndicies(InProcess, processBlockModuleToIndicies);
1417  found->resolvePutIndicies(InRun, runModuleToIndicies);
1418  found->resolvePutIndicies(InLumi, lumiModuleToIndicies);
1419  found->resolvePutIndicies(InEvent, eventModuleToIndicies);
1420  }
1421 
1422  return true;
1423  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1451
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:306
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:303
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:309
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
void edm::Schedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 1575 of file Schedule.cc.

References streamSchedules_.

1575  {
1576  for (auto& s : streamSchedules_) {
1577  s->clearCounters();
1578  }
1579  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
void edm::Schedule::closeOutputFiles ( )

Definition at line 1228 of file Schedule.cc.

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

1228  {
1229  using std::placeholders::_1;
1231  for (auto& worker : allWorkers()) {
1232  worker->respondToCloseOutputFile();
1233  }
1234  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1451
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:308
void edm::Schedule::convertCurrentProcessAlias ( std::string const &  processName)

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

Definition at line 1453 of file Schedule.cc.

References allWorkers().

1453  {
1454  for (auto const& worker : allWorkers()) {
1455  worker->convertCurrentProcessAlias(processName);
1456  }
1457  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1451
void edm::Schedule::deleteModule ( std::string const &  iLabel,
ActivityRegistry areg 
)

Deletes module with label iLabel.

Definition at line 1425 of file Schedule.cc.

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

1425  {
1426  globalSchedule_->deleteModule(iLabel);
1427  for (auto& stream : streamSchedules_) {
1428  stream->deleteModule(iLabel);
1429  }
1430  moduleRegistry_->deleteModule(iLabel, areg->preModuleDestructionSignal_, areg->postModuleDestructionSignal_);
1431  }
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:306
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:303
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
void edm::Schedule::endJob ( ExceptionCollector collector)

Definition at line 945 of file Schedule.cc.

References visDQMUpload::context, edm::EventTimingSummary::cpuTime, edm::TriggerTimingReport::endPathSummaries, edm::TriggerReport::endPathSummaries, edm::TriggerTimingReport::eventSummary, edm::TriggerReport::eventSummary, 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.

945  {
946  globalSchedule_->endJob(collector);
947  if (collector.hasThrown()) {
948  return;
949  }
950 
951  if (wantSummary_ == false)
952  return;
953  {
954  TriggerReport tr;
955  getTriggerReport(tr);
956 
957  // The trigger report (pass/fail etc.):
958 
959  LogFwkVerbatim("FwkSummary") << "";
960  if (streamSchedules_[0]->context().processContext()->isSubProcess()) {
961  LogFwkVerbatim("FwkSummary") << "TrigReport Process: "
962  << streamSchedules_[0]->context().processContext()->processName();
963  }
964  LogFwkVerbatim("FwkSummary") << "TrigReport "
965  << "---------- Event Summary ------------";
966  if (!tr.trigPathSummaries.empty()) {
967  LogFwkVerbatim("FwkSummary") << "TrigReport"
968  << " Events total = " << tr.eventSummary.totalEvents
969  << " passed = " << tr.eventSummary.totalEventsPassed
970  << " failed = " << tr.eventSummary.totalEventsFailed << "";
971  } else {
972  LogFwkVerbatim("FwkSummary") << "TrigReport"
973  << " Events total = " << tr.eventSummary.totalEvents
974  << " passed = " << tr.eventSummary.totalEvents << " failed = 0";
975  }
976 
977  LogFwkVerbatim("FwkSummary") << "";
978  LogFwkVerbatim("FwkSummary") << "TrigReport "
979  << "---------- Path Summary ------------";
980  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
981  << " " << std::right << std::setw(10) << "Executed"
982  << " " << std::right << std::setw(10) << "Passed"
983  << " " << std::right << std::setw(10) << "Failed"
984  << " " << std::right << std::setw(10) << "Error"
985  << " "
986  << "Name"
987  << "";
988  for (auto const& p : tr.trigPathSummaries) {
989  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
990  << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " "
991  << std::right << std::setw(10) << p.timesPassed << " " << std::right
992  << std::setw(10) << p.timesFailed << " " << std::right << std::setw(10)
993  << p.timesExcept << " " << p.name << "";
994  }
995 
996  /*
997  std::vector<int>::const_iterator epi = empty_trig_paths_.begin();
998  std::vector<int>::const_iterator epe = empty_trig_paths_.end();
999  std::vector<std::string>::const_iterator epn = empty_trig_path_names_.begin();
1000  for (; epi != epe; ++epi, ++epn) {
1001 
1002  LogFwkVerbatim("FwkSummary") << "TrigReport "
1003  << std::right << std::setw(5) << 1
1004  << std::right << std::setw(5) << *epi << " "
1005  << std::right << std::setw(10) << totalEvents() << " "
1006  << std::right << std::setw(10) << totalEvents() << " "
1007  << std::right << std::setw(10) << 0 << " "
1008  << std::right << std::setw(10) << 0 << " "
1009  << *epn << "";
1010  }
1011  */
1012 
1013  LogFwkVerbatim("FwkSummary") << "";
1014  LogFwkVerbatim("FwkSummary") << "TrigReport "
1015  << "-------End-Path Summary ------------";
1016  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
1017  << " " << std::right << std::setw(10) << "Executed"
1018  << " " << std::right << std::setw(10) << "Passed"
1019  << " " << std::right << std::setw(10) << "Failed"
1020  << " " << std::right << std::setw(10) << "Error"
1021  << " "
1022  << "Name"
1023  << "";
1024  for (auto const& p : tr.endPathSummaries) {
1025  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
1026  << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " "
1027  << std::right << std::setw(10) << p.timesPassed << " " << std::right
1028  << std::setw(10) << p.timesFailed << " " << std::right << std::setw(10)
1029  << p.timesExcept << " " << p.name << "";
1030  }
1031 
1032  for (auto const& p : tr.trigPathSummaries) {
1033  LogFwkVerbatim("FwkSummary") << "";
1034  LogFwkVerbatim("FwkSummary") << "TrigReport "
1035  << "---------- Modules in Path: " << p.name << " ------------";
1036  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
1037  << " " << std::right << std::setw(10) << "Visited"
1038  << " " << std::right << std::setw(10) << "Passed"
1039  << " " << std::right << std::setw(10) << "Failed"
1040  << " " << std::right << std::setw(10) << "Error"
1041  << " "
1042  << "Name"
1043  << "";
1044 
1045  unsigned int bitpos = 0;
1046  for (auto const& mod : p.moduleInPathSummaries) {
1047  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
1048  << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " "
1049  << std::right << std::setw(10) << mod.timesPassed << " " << std::right
1050  << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10)
1051  << mod.timesExcept << " " << mod.moduleLabel << "";
1052  ++bitpos;
1053  }
1054  }
1055 
1056  for (auto const& p : tr.endPathSummaries) {
1057  LogFwkVerbatim("FwkSummary") << "";
1058  LogFwkVerbatim("FwkSummary") << "TrigReport "
1059  << "------ Modules in End-Path: " << p.name << " ------------";
1060  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
1061  << " " << std::right << std::setw(10) << "Visited"
1062  << " " << std::right << std::setw(10) << "Passed"
1063  << " " << std::right << std::setw(10) << "Failed"
1064  << " " << std::right << std::setw(10) << "Error"
1065  << " "
1066  << "Name"
1067  << "";
1068 
1069  unsigned int bitpos = 0;
1070  for (auto const& mod : p.moduleInPathSummaries) {
1071  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
1072  << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " "
1073  << std::right << std::setw(10) << mod.timesPassed << " " << std::right
1074  << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10)
1075  << mod.timesExcept << " " << mod.moduleLabel << "";
1076  ++bitpos;
1077  }
1078  }
1079 
1080  LogFwkVerbatim("FwkSummary") << "";
1081  LogFwkVerbatim("FwkSummary") << "TrigReport "
1082  << "---------- Module Summary ------------";
1083  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Visited"
1084  << " " << std::right << std::setw(10) << "Executed"
1085  << " " << std::right << std::setw(10) << "Passed"
1086  << " " << std::right << std::setw(10) << "Failed"
1087  << " " << std::right << std::setw(10) << "Error"
1088  << " "
1089  << "Name"
1090  << "";
1091  for (auto const& worker : tr.workerSummaries) {
1092  LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << worker.timesVisited << " "
1093  << std::right << std::setw(10) << worker.timesRun << " " << std::right
1094  << std::setw(10) << worker.timesPassed << " " << std::right << std::setw(10)
1095  << worker.timesFailed << " " << std::right << std::setw(10) << worker.timesExcept
1096  << " " << worker.moduleLabel << "";
1097  }
1098  LogFwkVerbatim("FwkSummary") << "";
1099  }
1100  // The timing report (CPU and Real Time):
1101  TriggerTimingReport tr;
1103 
1104  const int totalEvents = std::max(1, tr.eventSummary.totalEvents);
1105 
1106  LogFwkVerbatim("FwkSummary") << "TimeReport "
1107  << "---------- Event Summary ---[sec]----";
1108  LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1109  << " event loop CPU/event = " << tr.eventSummary.cpuTime / totalEvents;
1110  LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1111  << " event loop Real/event = " << tr.eventSummary.realTime / totalEvents;
1112  LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1113  << " sum Streams Real/event = " << tr.eventSummary.sumStreamRealTime / totalEvents;
1114  LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1115  << " efficiency CPU/Real/thread = "
1116  << tr.eventSummary.cpuTime / tr.eventSummary.realTime /
1118 
1119  constexpr int kColumn1Size = 10;
1120  constexpr int kColumn2Size = 12;
1121  constexpr int kColumn3Size = 12;
1122  LogFwkVerbatim("FwkSummary") << "";
1123  LogFwkVerbatim("FwkSummary") << "TimeReport "
1124  << "---------- Path Summary ---[Real sec]----";
1125  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1126  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1127  << " Name";
1128  for (auto const& p : tr.trigPathSummaries) {
1129  const int timesRun = std::max(1, p.timesRun);
1130  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1131  << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right
1132  << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << "";
1133  }
1134  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1135  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1136  << " Name"
1137  << "";
1138 
1139  LogFwkVerbatim("FwkSummary") << "";
1140  LogFwkVerbatim("FwkSummary") << "TimeReport "
1141  << "-------End-Path Summary ---[Real sec]----";
1142  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1143  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1144  << " Name"
1145  << "";
1146  for (auto const& p : tr.endPathSummaries) {
1147  const int timesRun = std::max(1, p.timesRun);
1148 
1149  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1150  << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right
1151  << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << "";
1152  }
1153  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1154  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1155  << " Name"
1156  << "";
1157 
1158  for (auto const& p : tr.trigPathSummaries) {
1159  LogFwkVerbatim("FwkSummary") << "";
1160  LogFwkVerbatim("FwkSummary") << "TimeReport "
1161  << "---------- Modules in Path: " << p.name << " ---[Real sec]----";
1162  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1163  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1164  << " Name"
1165  << "";
1166  for (auto const& mod : p.moduleInPathSummaries) {
1167  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1168  << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right
1169  << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " "
1170  << mod.moduleLabel << "";
1171  }
1172  }
1173  if (not tr.trigPathSummaries.empty()) {
1174  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1175  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1176  << " Name"
1177  << "";
1178  }
1179  for (auto const& p : tr.endPathSummaries) {
1180  LogFwkVerbatim("FwkSummary") << "";
1181  LogFwkVerbatim("FwkSummary") << "TimeReport "
1182  << "------ Modules in End-Path: " << p.name << " ---[Real sec]----";
1183  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1184  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1185  << " Name"
1186  << "";
1187  for (auto const& mod : p.moduleInPathSummaries) {
1188  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1189  << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right
1190  << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " "
1191  << mod.moduleLabel << "";
1192  }
1193  }
1194  if (not tr.endPathSummaries.empty()) {
1195  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1196  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1197  << " Name"
1198  << "";
1199  }
1200  LogFwkVerbatim("FwkSummary") << "";
1201  LogFwkVerbatim("FwkSummary") << "TimeReport "
1202  << "---------- Module Summary ---[Real sec]----";
1203  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1204  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1205  << " " << std::right << std::setw(kColumn3Size) << "per visit"
1206  << " Name"
1207  << "";
1208  for (auto const& worker : tr.workerSummaries) {
1209  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1210  << std::setw(kColumn1Size) << worker.realTime / totalEvents << " " << std::right
1211  << std::setw(kColumn2Size) << worker.realTime / std::max(1, worker.timesRun) << " "
1212  << std::right << std::setw(kColumn3Size)
1213  << worker.realTime / std::max(1, worker.timesVisited) << " " << worker.moduleLabel
1214  << "";
1215  }
1216  LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1217  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1218  << " " << std::right << std::setw(kColumn3Size) << "per visit"
1219  << " Name"
1220  << "";
1221 
1222  LogFwkVerbatim("FwkSummary") << "";
1223  LogFwkVerbatim("FwkSummary") << "T---Report end!"
1224  << "";
1225  LogFwkVerbatim("FwkSummary") << "";
1226  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:306
int totalEvents() const
Definition: Schedule.cc:1551
void getTriggerReport(TriggerReport &rep) const
Definition: Schedule.cc:1534
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:309
Log< level::FwkInfo, true > LogFwkVerbatim
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
bool wantSummary_
Definition: Schedule.h:315
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void getTriggerTimingReport(TriggerTimingReport &rep) const
Definition: Schedule.cc:1544
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 1465 of file Schedule.cc.

References endPathNames_.

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

1465 { oLabelsToFill = *endPathNames_; }
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:314
void edm::Schedule::endStream ( unsigned int  iStreamID)

Definition at line 1363 of file Schedule.cc.

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

1363  {
1364  assert(iStreamID < streamSchedules_.size());
1365  streamSchedules_[iStreamID]->endStream();
1366  }
assert(be >=bs)
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
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 1483 of file Schedule.cc.

References cms::Exception::addContext(), allWorkers(), mps_fire::i, edm::ModuleDescription::id(), edm::ModuleDescription::moduleLabel(), TrackingSourceConfig_Tier0_Cosmic_cff::modules, edm::NumBranchTypes, AlCaHLTBitMon_ParallelJobs::p, findQualityFiles::size, and edm::sort_all().

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

1488  {
1489  allModuleDescriptions.clear();
1490  moduleIDToIndex.clear();
1491  for (auto iBranchType = 0U; iBranchType < NumBranchTypes; ++iBranchType) {
1492  modulesWhoseProductsAreConsumedBy[iBranchType].clear();
1493  }
1494  modulesInPreviousProcessesWhoseProductsAreConsumedBy.clear();
1495 
1496  allModuleDescriptions.reserve(allWorkers().size());
1497  moduleIDToIndex.reserve(allWorkers().size());
1498  for (auto iBranchType = 0U; iBranchType < NumBranchTypes; ++iBranchType) {
1499  modulesWhoseProductsAreConsumedBy[iBranchType].resize(allWorkers().size());
1500  }
1501  modulesInPreviousProcessesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1502 
1503  std::map<std::string, ModuleDescription const*> labelToDesc;
1504  unsigned int i = 0;
1505  for (auto const& worker : allWorkers()) {
1506  ModuleDescription const* p = worker->description();
1507  allModuleDescriptions.push_back(p);
1508  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1509  labelToDesc[p->moduleLabel()] = p;
1510  ++i;
1511  }
1512  sort_all(moduleIDToIndex);
1513 
1514  i = 0;
1515  for (auto const& worker : allWorkers()) {
1516  std::array<std::vector<ModuleDescription const*>*, NumBranchTypes> modules;
1517  for (auto iBranchType = 0U; iBranchType < NumBranchTypes; ++iBranchType) {
1518  modules[iBranchType] = &modulesWhoseProductsAreConsumedBy[iBranchType].at(i);
1519  }
1520 
1521  std::vector<ModuleProcessName>& modulesInPreviousProcesses =
1522  modulesInPreviousProcessesWhoseProductsAreConsumedBy.at(i);
1523  try {
1524  worker->modulesWhoseProductsAreConsumed(modules, modulesInPreviousProcesses, preg, labelToDesc);
1525  } catch (cms::Exception& ex) {
1526  ex.addContext("Calling Worker::modulesWhoseProductsAreConsumed() for module " +
1527  worker->description()->moduleLabel());
1528  throw;
1529  }
1530  ++i;
1531  }
1532  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1451
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
void addContext(std::string const &context)
Definition: Exception.cc:165
preg
Definition: Schedule.cc:687
tuple size
Write out results.
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 1440 of file Schedule.cc.

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

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

1440  {
1441  std::vector<ModuleDescription const*> result;
1442  result.reserve(allWorkers().size());
1443 
1444  for (auto const& worker : allWorkers()) {
1445  ModuleDescription const* p = worker->description();
1446  result.push_back(p);
1447  }
1448  return result;
1449  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1451
tuple result
Definition: mps_fire.py:311
tuple size
Write out results.
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 1534 of file Schedule.cc.

References edm::TriggerReport::eventSummary, edm::sort_all(), streamSchedules_, edm::EventSummary::totalEvents, edm::EventSummary::totalEventsFailed, edm::EventSummary::totalEventsPassed, and edm::TriggerReport::workerSummaries.

Referenced by endJob().

1534  {
1535  rep.eventSummary.totalEvents = 0;
1536  rep.eventSummary.totalEventsPassed = 0;
1537  rep.eventSummary.totalEventsFailed = 0;
1538  for (auto& s : streamSchedules_) {
1539  s->getTriggerReport(rep);
1540  }
1541  sort_all(rep.workerSummaries);
1542  }
string rep
Definition: cuy.py:1189
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
void edm::Schedule::getTriggerTimingReport ( TriggerTimingReport rep) const

Return the trigger timing report information on paths, modules-in-path, modules-in-endpath, and modules.

Definition at line 1544 of file Schedule.cc.

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

Referenced by endJob().

1544  {
1545  rep.eventSummary.totalEvents = 0;
1546  rep.eventSummary.cpuTime = 0.;
1547  rep.eventSummary.realTime = 0.;
1548  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1549  }
string rep
Definition: cuy.py:1189
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:311
void edm::Schedule::initializeEarlyDelete ( std::vector< std::string > const &  branchesToDeleteEarly,
edm::ProductRegistry const &  preg 
)

Definition at line 1433 of file Schedule.cc.

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

1434  {
1435  for (auto& stream : streamSchedules_) {
1436  stream->initializeEarlyDelete(*moduleRegistry(), branchesToDeleteEarly, preg);
1437  }
1438  }
std::shared_ptr< ModuleRegistry const > moduleRegistry() const
Definition: Schedule.h:297
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
preg
Definition: Schedule.cc:687
void edm::Schedule::limitOutput ( ParameterSet const &  proc_pset,
BranchIDLists const &  branchIDLists,
SubProcessParentageHelper const *  subProcessParentageHelper 
)
private

Definition at line 889 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(), edm::OutputModuleDescription::maxEvents_, convertSQLitetoXML_cfg::output, edm::search_all(), and AlCaHLTBitMon_QueryRunRegistry::string.

891  {
892  std::string const output("output");
893 
894  ParameterSet const& maxEventsPSet = proc_pset.getUntrackedParameterSet("maxEvents");
895  int maxEventSpecs = 0;
896  int maxEventsOut = -1;
897  ParameterSet const* vMaxEventsOut = nullptr;
898  std::vector<std::string> intNamesE = maxEventsPSet.getParameterNamesForType<int>(false);
899  if (search_all(intNamesE, output)) {
900  maxEventsOut = maxEventsPSet.getUntrackedParameter<int>(output);
901  ++maxEventSpecs;
902  }
903  std::vector<std::string> psetNamesE;
904  maxEventsPSet.getParameterSetNames(psetNamesE, false);
905  if (search_all(psetNamesE, output)) {
906  vMaxEventsOut = &maxEventsPSet.getUntrackedParameterSet(output);
907  ++maxEventSpecs;
908  }
909 
910  if (maxEventSpecs > 1) {
912  << "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
913  }
914 
915  for (auto& c : all_output_communicators_) {
916  OutputModuleDescription desc(branchIDLists, maxEventsOut, subProcessParentageHelper);
917  if (vMaxEventsOut != nullptr && !vMaxEventsOut->empty()) {
918  std::string const& moduleLabel = c->description().moduleLabel();
919  try {
920  desc.maxEvents_ = vMaxEventsOut->getUntrackedParameter<int>(moduleLabel);
921  } catch (Exception const&) {
923  << "\nNo entry in 'maxEvents' for output module label '" << moduleLabel << "'.\n";
924  }
925  }
926  c->configure(desc);
927  }
928  }
const edm::EventSetup & c
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:36
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:308
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 1477 of file Schedule.cc.

References streamSchedules_.

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

1479  {
1480  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1481  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
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 1471 of file Schedule.cc.

References streamSchedules_.

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

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

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

Definition at line 298 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:303
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 1467 of file Schedule.cc.

References streamSchedules_.

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

1467  {
1468  streamSchedules_[0]->modulesInPath(iPathLabel, oLabelsToFill);
1469  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
void edm::Schedule::openOutputFiles ( FileBlock fb)

Definition at line 1236 of file Schedule.cc.

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

1236  {
1237  using std::placeholders::_1;
1238  for_all(all_output_communicators_, std::bind(&OutputModuleCommunicator::openFile, _1, std::cref(fb)));
1239  }
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:308
void edm::Schedule::processOneEventAsync ( WaitingTaskHolder  iTask,
unsigned int  iStreamID,
EventTransitionInfo info,
ServiceToken const &  token 
)

Definition at line 1368 of file Schedule.cc.

References cms::cuda::assert(), eostools::move(), pathStatusInserters_, and streamSchedules_.

1371  {
1372  assert(iStreamID < streamSchedules_.size());
1373  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask), info, token, pathStatusInserters_);
1374  }
static const TGPicture * info(bool iBackgroundIsBlack)
assert(be >=bs)
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:301
def move
Definition: eostools.py:511
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
template<typename T >
void edm::Schedule::processOneGlobalAsync ( WaitingTaskHolder  iTask,
typename T::TransitionInfoType &  transitionInfo,
ServiceToken const &  token,
bool  cleaningUpAfterException = false 
)

Definition at line 330 of file Schedule.h.

References globalSchedule_, and unpackBuffers-CaloStage2::token.

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

333  {
334  globalSchedule_->processOneGlobalAsync<T>(iTaskHolder, transitionInfo, token, cleaningUpAfterException);
335  }
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:306
long double T
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 319 of file Schedule.h.

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

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

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

Definition at line 1347 of file Schedule.cc.

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

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

Definition at line 1342 of file Schedule.cc.

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

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

Definition at line 293 of file Schedule.h.

References edm::get_underlying_safe(), and resultsInserter_.

293  {
295  }
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:300
std::shared_ptr<TriggerResultInserter>& edm::Schedule::resultsInserter ( )
inlineprivate

Definition at line 296 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:300
bool edm::Schedule::shouldWeCloseOutput ( ) const

Definition at line 1333 of file Schedule.cc.

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

1333  {
1334  using std::placeholders::_1;
1335  // Return true iff at least one output module returns true.
1336  return (std::find_if(all_output_communicators_.begin(),
1340  }
virtual bool shouldWeCloseFile() const =0
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:308
bool edm::Schedule::terminate ( void  ) const

Return whether each output module has reached its maximum count.

Definition at line 930 of file Schedule.cc.

References all_output_communicators_, and c.

930  {
931  if (all_output_communicators_.empty()) {
932  return false;
933  }
934  for (auto& c : all_output_communicators_) {
935  if (!c->limitReached()) {
936  // Found an output module that has not reached output event count.
937  return false;
938  }
939  }
940  LogInfo("SuccessfulTermination") << "The job is terminating successfully because each output module\n"
941  << "has reached its configured limit.\n";
942  return true;
943  }
const edm::EventSetup & c
Log< level::Info, false > LogInfo
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:308
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 1551 of file Schedule.cc.

References streamSchedules_.

Referenced by endJob().

1551  {
1552  int returnValue = 0;
1553  for (auto& s : streamSchedules_) {
1554  returnValue += s->totalEvents();
1555  }
1556  return returnValue;
1557  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
int edm::Schedule::totalEventsFailed ( ) const

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

Definition at line 1567 of file Schedule.cc.

References streamSchedules_.

1567  {
1568  int returnValue = 0;
1569  for (auto& s : streamSchedules_) {
1570  returnValue += s->totalEventsFailed();
1571  }
1572  return returnValue;
1573  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
int edm::Schedule::totalEventsPassed ( ) const

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

Definition at line 1559 of file Schedule.cc.

References streamSchedules_.

1559  {
1560  int returnValue = 0;
1561  for (auto& s : streamSchedules_) {
1562  returnValue += s->totalEventsPassed();
1563  }
1564  return returnValue;
1565  }
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:304
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 1463 of file Schedule.cc.

References pathNames_.

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

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

Definition at line 1304 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(), edm::waiting_task::chain::then(), and unpackBuffers-CaloStage2::token.

1307  {
1309  GlobalContext globalContext(GlobalContext::Transition::kWriteLuminosityBlock,
1310  lbp.id(),
1311  lbp.runPrincipal().index(),
1312  lbp.index(),
1313  lbp.beginTime(),
1314  processContext);
1315 
1316  using namespace edm::waiting_task;
1317  chain::first([&](auto nextTask) {
1319  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteLumiSignal_(globalContext); } catch (...) {
1320  }
1321  for (auto& c : all_output_communicators_) {
1322  c->writeLumiAsync(nextTask, lbp, processContext, activityRegistry);
1323  }
1324  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1325  //services can depend on other services
1327 
1328  activityRegistry->postGlobalWriteLumiSignal_(globalContext);
1329  })) |
1330  chain::runLast(task);
1331  }
const edm::EventSetup & c
#define CMS_SA_ALLOW
ServiceToken presentToken() const
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:308
void edm::Schedule::writeProcessBlockAsync ( WaitingTaskHolder  iTask,
ProcessBlockPrincipal const &  pbp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry 
)

Definition at line 1274 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(), edm::waiting_task::chain::then(), and unpackBuffers-CaloStage2::token.

1277  {
1279  GlobalContext globalContext(GlobalContext::Transition::kWriteProcessBlock,
1280  LuminosityBlockID(),
1284  processContext);
1285 
1286  using namespace edm::waiting_task;
1287  chain::first([&](auto nextTask) {
1288  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1290  CMS_SA_ALLOW try { activityRegistry->preWriteProcessBlockSignal_(globalContext); } catch (...) {
1291  }
1292  for (auto& c : all_output_communicators_) {
1293  c->writeProcessBlockAsync(nextTask, pbp, processContext, activityRegistry);
1294  }
1295  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1296  //services can depend on other services
1298 
1299  activityRegistry->postWriteProcessBlockSignal_(globalContext);
1300  })) |
1301  chain::runLast(std::move(task));
1302  }
const edm::EventSetup & c
#define CMS_SA_ALLOW
static Timestamp invalidTimestamp()
Definition: Timestamp.h:82
ServiceToken presentToken() const
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
def move
Definition: eostools.py:511
static ServiceRegistry & instance()
static LuminosityBlockIndex invalidLuminosityBlockIndex()
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:308
void edm::Schedule::writeRunAsync ( WaitingTaskHolder  iTask,
RunPrincipal const &  rp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry,
MergeableRunProductMetadata const *  mergeableRunProductMetadata 
)

Definition at line 1241 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(), edm::waiting_task::chain::then(), and unpackBuffers-CaloStage2::token.

1245  {
1247  GlobalContext globalContext(GlobalContext::Transition::kWriteRun,
1248  LuminosityBlockID(rp.run(), 0),
1249  rp.index(),
1251  rp.endTime(),
1252  processContext);
1253 
1254  using namespace edm::waiting_task;
1255  chain::first([&](auto nextTask) {
1256  //services can depend on other services
1258 
1259  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1260  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteRunSignal_(globalContext); } catch (...) {
1261  }
1262  for (auto& c : all_output_communicators_) {
1263  c->writeRunAsync(nextTask, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1264  }
1265  }) | chain::then(doCleanup([activityRegistry, globalContext, token]() {
1266  //services can depend on other services
1268 
1269  activityRegistry->postGlobalWriteRunSignal_(globalContext);
1270  })) |
1271  chain::runLast(task);
1272  }
const edm::EventSetup & c
#define CMS_SA_ALLOW
ServiceToken presentToken() const
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:308

Member Data Documentation

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

Definition at line 314 of file Schedule.h.

Referenced by endPaths().

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

Definition at line 302 of file Schedule.h.

edm::propagate_const<std::unique_ptr<GlobalSchedule> > edm::Schedule::globalSchedule_
private
edm::propagate_const<std::shared_ptr<ModuleRegistry> > edm::Schedule::moduleRegistry_
private

Definition at line 303 of file Schedule.h.

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

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

Definition at line 313 of file Schedule.h.

Referenced by triggerPaths().

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

Definition at line 301 of file Schedule.h.

Referenced by processOneEventAsync().

PreallocationConfiguration edm::Schedule::preallocConfig_
private

Definition at line 309 of file Schedule.h.

Referenced by changeModule(), and endJob().

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

Definition at line 300 of file Schedule.h.

Referenced by resultsInserter().

std::vector<edm::propagate_const<std::shared_ptr<StreamSchedule> > > edm::Schedule::streamSchedules_
private
edm::propagate_const<std::unique_ptr<SystemTimeKeeper> > edm::Schedule::summaryTimeKeeper_
private

Definition at line 311 of file Schedule.h.

Referenced by getTriggerTimingReport().

bool edm::Schedule::wantSummary_
private

Definition at line 315 of file Schedule.h.

Referenced by endJob().