CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
edm::Worker Class Referenceabstract

#include <Worker.h>

Inheritance diagram for edm::Worker:
edm::WorkerT< T >

Classes

class  AcquireTask
 
class  AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >
 
class  HandleExternalWorkExceptionTask
 
class  RunModuleTask
 
struct  TaskQueueAdaptor
 

Public Types

enum  ConcurrencyTypes {
  kGlobal, kLimited, kOne, kStream,
  kLegacy
}
 
enum  State { Ready, Pass, Fail, Exception }
 
enum  Types { kAnalyzer, kFilter, kProducer, kOutputModule }
 

Public Member Functions

void addedToPath ()
 
void beginJob ()
 
void beginStream (StreamID id, StreamContext &streamContext)
 
void callWhenDoneAsync (WaitingTaskHolder task)
 
void clearCounters ()
 
void clearModule ()
 
virtual std::vector< ConsumesInfoconsumesInfo () const =0
 
virtual void convertCurrentProcessAlias (std::string const &processName)=0
 
ModuleDescription const * description () const
 
template<typename T >
void doWorkAsync (WaitingTaskHolder, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *)
 
template<typename T >
void doWorkNoPrefetchingAsync (WaitingTaskHolder, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *)
 
void endJob ()
 
void endStream (StreamID id, StreamContext &streamContext)
 
virtual SerialTaskQueueglobalLuminosityBlocksQueue ()=0
 
virtual SerialTaskQueueglobalRunsQueue ()=0
 
virtual bool hasAccumulator () const =0
 
virtual ConcurrencyTypes moduleConcurrencyType () const =0
 
virtual void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modules, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc) const =0
 
virtual Types moduleType () const =0
 
Workeroperator= (Worker const &)=delete
 
void postDoEvent (EventPrincipal const &)
 
void prePrefetchSelectionAsync (tbb::task_group &, WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *)
 
void prePrefetchSelectionAsync (tbb::task_group &, WaitingTask *task, ServiceToken const &, StreamID stream, void const *)
 
void registerThinnedAssociations (ProductRegistry const &registry, ThinnedAssociationsHelper &helper)
 
void reset ()
 
virtual void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, std::tuple< TypeID const *, const char *, edm::ProductResolverIndex >> const &iIndicies)=0
 
void respondToCloseInputFile (FileBlock const &fb)
 
void respondToCloseOutputFile ()
 
void respondToOpenInputFile (FileBlock const &fb)
 
template<typename T >
std::exception_ptr runModuleDirectly (typename T::TransitionInfoType const &, StreamID, ParentContext const &, typename T::Context const *)
 
virtual void selectInputProcessBlocks (ProductRegistry const &, ProcessBlockHelperBase const &)=0
 
void setActivityRegistry (std::shared_ptr< ActivityRegistry > areg)
 
void setEarlyDeleteHelper (EarlyDeleteHelper *iHelper)
 
void skipOnPath (EventPrincipal const &iEvent)
 
State state () const
 
int timesExcept () const
 
int timesFailed () const
 
int timesPass () const
 
int timesPassed () const
 
int timesRun () const
 
int timesVisited () const
 
virtual void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &)=0
 
virtual void updateLookup (eventsetup::ESRecordsToProxyIndices const &)=0
 
virtual bool wantsGlobalLuminosityBlocks () const =0
 
virtual bool wantsGlobalRuns () const =0
 
virtual bool wantsInputProcessBlocks () const =0
 
virtual bool wantsProcessBlocks () const =0
 
virtual bool wantsStreamLuminosityBlocks () const =0
 
virtual bool wantsStreamRuns () const =0
 
 Worker (ModuleDescription const &iMD, ExceptionToActionTable const *iActions)
 
 Worker (Worker const &)=delete
 
virtual ~Worker ()
 

Protected Member Functions

ActivityRegistryactivityRegistry ()
 
virtual void doClearModule ()=0
 
virtual void implBeginJob ()=0
 
virtual void implBeginStream (StreamID)=0
 
virtual bool implDo (EventTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoAccessInputProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0
 
virtual void implDoAcquire (EventTransitionInfo const &, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)=0
 
virtual bool implDoBegin (LumiTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoBegin (RunTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoBeginProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0
 
virtual bool implDoEnd (LumiTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoEnd (RunTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoEndProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0
 
virtual bool implDoPrePrefetchSelection (StreamID, EventPrincipal const &, ModuleCallingContext const *)=0
 
virtual bool implDoStreamBegin (StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoStreamBegin (StreamID, RunTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoStreamEnd (StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoStreamEnd (StreamID, RunTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual void implEndJob ()=0
 
virtual void implEndStream (StreamID)=0
 
virtual bool implNeedToRunSelection () const =0
 
virtual void itemsToGetForSelection (std::vector< ProductResolverIndexAndSkipBit > &) const =0
 
void resetModuleDescription (ModuleDescription const *)
 
virtual std::string workerType () const =0
 

Private Member Functions

void edPrefetchAsync (WaitingTaskHolder, ServiceToken const &, Principal const &) const
 
void emitPostModuleEventPrefetchingSignal ()
 
virtual std::vector< ESProxyIndex > const & esItemsToGetFrom (Transition) const =0
 
void esPrefetchAsync (WaitingTaskHolder, EventSetupImpl const &, Transition, ServiceToken const &)
 
virtual std::vector< ESRecordIndex > const & esRecordsToGetFrom (Transition) const =0
 
std::exception_ptr handleExternalWorkException (std::exception_ptr const *iEPtr, ParentContext const &parentContext)
 
virtual bool hasAcquire () const =0
 
virtual void implRegisterThinnedAssociations (ProductRegistry const &, ThinnedAssociationsHelper &)=0
 
virtual void implRespondToCloseInputFile (FileBlock const &fb)=0
 
virtual void implRespondToCloseOutputFile ()=0
 
virtual void implRespondToOpenInputFile (FileBlock const &fb)=0
 
virtual void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const =0
 
virtual std::vector< ProductResolverIndex > const & itemsShouldPutInEvent () const =0
 
virtual void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const =0
 
virtual std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType) const =0
 
bool needsESPrefetching (Transition iTrans) const noexcept
 
virtual void preActionBeforeRunEventAsync (WaitingTaskHolder iTask, ModuleCallingContext const &moduleCallingContext, Principal const &iPrincipal) const =0
 
template<typename T >
void prefetchAsync (WaitingTaskHolder, ServiceToken const &, ParentContext const &, typename T::TransitionInfoType const &, Transition)
 
void runAcquire (EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder &)
 
void runAcquireAfterAsyncPrefetch (std::exception_ptr const *, EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder)
 
template<typename T >
bool runModule (typename T::TransitionInfoType const &, StreamID, ParentContext const &, typename T::Context const *)
 
template<typename T >
std::exception_ptr runModuleAfterAsyncPrefetch (std::exception_ptr const *, typename T::TransitionInfoType const &, StreamID, ParentContext const &, typename T::Context const *)
 
virtual TaskQueueAdaptor serializeRunModule ()=0
 
template<bool IS_EVENT>
std::exception_ptr setException (std::exception_ptr iException)
 
template<bool IS_EVENT>
bool setFailed ()
 
template<bool IS_EVENT>
bool setPassed ()
 
bool shouldRethrowException (std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent) const
 

Static Private Member Functions

static void exceptionContext (cms::Exception &ex, ModuleCallingContext const *mcc)
 

Private Attributes

ExceptionToActionTable const * actions_
 
std::shared_ptr< ActivityRegistryactReg_
 
std::exception_ptr cached_exception_
 
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
 
ModuleCallingContext moduleCallingContext_
 
bool moduleValid_ = true
 
std::atomic< int > numberOfPathsLeftToRun_
 
int numberOfPathsOn_
 
bool ranAcquireWithoutException_
 
std::atomic< Statestate_
 
std::atomic< int > timesExcept_
 
std::atomic< int > timesFailed_
 
std::atomic< int > timesPassed_
 
std::atomic< int > timesRun_
 
std::atomic< int > timesVisited_
 
edm::WaitingTaskList waitingTasks_
 
std::atomic< bool > workStarted_
 

Friends

template<typename O >
class workerhelper::CallImpl
 

Detailed Description

Definition at line 91 of file Worker.h.

Member Enumeration Documentation

◆ ConcurrencyTypes

Enumerator
kGlobal 
kLimited 
kOne 
kStream 
kLegacy 

Definition at line 95 of file Worker.h.

◆ State

Enumerator
Ready 
Pass 
Fail 
Exception 

Definition at line 93 of file Worker.h.

93 { Ready, Pass, Fail, Exception };

◆ Types

Enumerator
kAnalyzer 
kFilter 
kProducer 
kOutputModule 

Definition at line 94 of file Worker.h.

Constructor & Destructor Documentation

◆ Worker() [1/2]

edm::Worker::Worker ( ModuleDescription const &  iMD,
ExceptionToActionTable const *  iActions 
)

Definition at line 91 of file Worker.cc.

92  : timesRun_(0),
93  timesVisited_(0),
94  timesPassed_(0),
95  timesFailed_(0),
96  timesExcept_(0),
97  state_(Ready),
100  moduleCallingContext_(&iMD),
101  actions_(iActions),
103  actReg_(),
104  earlyDeleteHelper_(nullptr),
105  workStarted_(false),

◆ ~Worker()

edm::Worker::~Worker ( )
virtual

Definition at line 108 of file Worker.cc.

108 {}

◆ Worker() [2/2]

edm::Worker::Worker ( Worker const &  )
delete

Member Function Documentation

◆ activityRegistry()

ActivityRegistry* edm::Worker::activityRegistry ( )
inlineprotected

Definition at line 278 of file Worker.h.

278 { return actReg_.get(); }

References actReg_.

◆ addedToPath()

void edm::Worker::addedToPath ( )
inline

Definition at line 230 of file Worker.h.

230 { ++numberOfPathsOn_; }

References numberOfPathsOn_.

◆ beginJob()

void edm::Worker::beginJob ( void  )

Definition at line 347 of file Worker.cc.

347  {
348  try {
349  convertException::wrap([&]() {
350  ModuleBeginJobSignalSentry cpp(actReg_.get(), *description());
351  implBeginJob();
352  });
353  } catch (cms::Exception& ex) {
354  state_ = Exception;
355  std::ostringstream ost;
356  ost << "Calling beginJob for module " << description()->moduleName() << "/'" << description()->moduleLabel()
357  << "'";
358  ex.addContext(ost.str());
359  throw;
360  }
361  }

References actReg_, cms::Exception::addContext(), description(), Exception, implBeginJob(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), state_, and edm::convertException::wrap().

Referenced by edm::WorkerManager::beginJob().

◆ beginStream()

void edm::Worker::beginStream ( StreamID  id,
StreamContext streamContext 
)

Definition at line 380 of file Worker.cc.

380  {
381  try {
382  convertException::wrap([&]() {
383  streamContext.setTransition(StreamContext::Transition::kBeginStream);
384  streamContext.setEventID(EventID(0, 0, 0));
385  streamContext.setRunIndex(RunIndex::invalidRunIndex());
386  streamContext.setLuminosityBlockIndex(LuminosityBlockIndex::invalidLuminosityBlockIndex());
387  streamContext.setTimestamp(Timestamp());
388  ParentContext parentContext(&streamContext);
389  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
391  ModuleBeginStreamSignalSentry beginSentry(actReg_.get(), streamContext, moduleCallingContext_);
392  implBeginStream(id);
393  });
394  } catch (cms::Exception& ex) {
395  state_ = Exception;
396  std::ostringstream ost;
397  ost << "Calling beginStream for module " << description()->moduleName() << "/'" << description()->moduleLabel()
398  << "'";
399  ex.addContext(ost.str());
400  throw;
401  }
402  }

References actReg_, cms::Exception::addContext(), description(), Exception, implBeginStream(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::RunIndex::invalidRunIndex(), edm::StreamContext::kBeginStream, edm::ModuleCallingContext::kRunning, moduleCallingContext_, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), edm::StreamContext::setEventID(), edm::StreamContext::setLuminosityBlockIndex(), edm::StreamContext::setRunIndex(), edm::ModuleCallingContext::setState(), edm::StreamContext::setTimestamp(), edm::StreamContext::setTransition(), state_, and edm::convertException::wrap().

◆ callWhenDoneAsync()

void edm::Worker::callWhenDoneAsync ( WaitingTaskHolder  task)
inline

◆ clearCounters()

void edm::Worker::clearCounters ( )
inline

Definition at line 222 of file Worker.h.

222  {
223  timesRun_.store(0, std::memory_order_release);
224  timesVisited_.store(0, std::memory_order_release);
225  timesPassed_.store(0, std::memory_order_release);
226  timesFailed_.store(0, std::memory_order_release);
227  timesExcept_.store(0, std::memory_order_release);
228  }

References timesExcept_, timesFailed_, timesPassed_, timesRun_, and timesVisited_.

Referenced by edm::StreamSchedule::clearCounters().

◆ clearModule()

void edm::Worker::clearModule ( )
inline

Definition at line 122 of file Worker.h.

122  {
123  moduleValid_ = false;
124  doClearModule();
125  }

References doClearModule(), and moduleValid_.

◆ consumesInfo()

virtual std::vector<ConsumesInfo> edm::Worker::consumesInfo ( ) const
pure virtual

◆ convertCurrentProcessAlias()

virtual void edm::Worker::convertCurrentProcessAlias ( std::string const &  processName)
pure virtual

Implemented in edm::WorkerT< T >.

◆ description()

ModuleDescription const* edm::Worker::description ( ) const
inline

◆ doClearModule()

virtual void edm::Worker::doClearModule ( )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by clearModule().

◆ doWorkAsync()

template<typename T >
void edm::Worker::doWorkAsync ( WaitingTaskHolder  task,
typename T::TransitionInfoType const &  transitionInfo,
ServiceToken const &  token,
StreamID  streamID,
ParentContext const &  parentContext,
typename T::Context const *  context 
)

Definition at line 933 of file Worker.h.

938  {
939  if (not workerhelper::CallImpl<T>::wantsTransition(this)) {
940  return;
941  }
942 
943  //Need to check workStarted_ before adding to waitingTasks_
944  bool expected = false;
945  bool workStarted = workStarted_.compare_exchange_strong(expected, true);
946 
948  if constexpr (T::isEvent_) {
949  timesVisited_.fetch_add(1, std::memory_order_relaxed);
950  }
951 
952  if (workStarted) {
954 
955  //if have TriggerResults based selection we want to reject the event before doing prefetching
956  if (workerhelper::CallImpl<T>::needToRunSelection(this)) {
957  //We need to run the selection in a different task so that
958  // we can prefetch the data needed for the selection
959  WaitingTask* moduleTask =
960  new RunModuleTask<T>(this, transitionInfo, token, streamID, parentContext, context, task.group());
961 
962  //make sure the task is either run or destroyed
963  struct DestroyTask {
964  DestroyTask(edm::WaitingTask* iTask) : m_task(iTask) {}
965 
966  ~DestroyTask() {
967  auto p = m_task.exchange(nullptr);
968  if (p) {
969  TaskSentry s{p};
970  }
971  }
972 
973  edm::WaitingTask* release() { return m_task.exchange(nullptr); }
974 
975  private:
976  std::atomic<edm::WaitingTask*> m_task;
977  };
978  if constexpr (T::isEvent_) {
979  if (hasAcquire()) {
980  auto ownRunTask = std::make_shared<DestroyTask>(moduleTask);
981  ServiceWeakToken weakToken = token;
982  auto* group = task.group();
983  moduleTask = make_waiting_task(
984  [this, weakToken, transitionInfo, parentContext, ownRunTask, group](std::exception_ptr const* iExcept) {
985  WaitingTaskWithArenaHolder runTaskHolder(
986  *group, new HandleExternalWorkExceptionTask(this, group, ownRunTask->release(), parentContext));
987  AcquireTask<T> t(this, transitionInfo, weakToken.lock(), parentContext, runTaskHolder);
988  t.execute();
989  });
990  }
991  }
992  auto* group = task.group();
993  auto ownModuleTask = std::make_shared<DestroyTask>(moduleTask);
994  ServiceWeakToken weakToken = token;
995  auto selectionTask =
996  make_waiting_task([ownModuleTask, parentContext, info = transitionInfo, weakToken, group, this](
997  std::exception_ptr const*) mutable {
998  ServiceRegistry::Operate guard(weakToken.lock());
999  prefetchAsync<T>(WaitingTaskHolder(*group, ownModuleTask->release()),
1000  weakToken.lock(),
1001  parentContext,
1002  info,
1003  T::transition_);
1004  });
1005  prePrefetchSelectionAsync(*group, selectionTask, token, streamID, &transitionInfo.principal());
1006  } else {
1007  WaitingTask* moduleTask =
1008  new RunModuleTask<T>(this, transitionInfo, token, streamID, parentContext, context, task.group());
1009  auto group = task.group();
1010  if constexpr (T::isEvent_) {
1011  if (hasAcquire()) {
1012  WaitingTaskWithArenaHolder runTaskHolder(
1013  *group, new HandleExternalWorkExceptionTask(this, group, moduleTask, parentContext));
1014  moduleTask = new AcquireTask<T>(this, transitionInfo, token, parentContext, std::move(runTaskHolder));
1015  }
1016  }
1017  prefetchAsync<T>(WaitingTaskHolder(*group, moduleTask), token, parentContext, transitionInfo, T::transition_);
1018  }
1019  }
1020  }

References edm::WaitingTaskList::add(), visDQMUpload::context, watchdog::group, hasAcquire(), info(), edm::ModuleCallingContext::kPrefetching, edm::ServiceWeakToken::lock(), edm::make_waiting_task(), moduleCallingContext_, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, prePrefetchSelectionAsync(), fetchall_from_DQM_v2::release, alignCSCRings::s, edm::ModuleCallingContext::setContext(), submitPVValidationJobs::t, TrackValidation_cff::task, timesVisited_, unpackBuffers-CaloStage2::token, waitingTasks_, and workStarted_.

Referenced by edm::UnscheduledProductResolver::prefetchAsync_(), and edm::WorkerInPath::runWorkerAsync().

◆ doWorkNoPrefetchingAsync()

template<typename T >
void edm::Worker::doWorkNoPrefetchingAsync ( WaitingTaskHolder  task,
typename T::TransitionInfoType const &  transitionInfo,
ServiceToken const &  serviceToken,
StreamID  streamID,
ParentContext const &  parentContext,
typename T::Context const *  context 
)

Definition at line 1049 of file Worker.h.

1054  {
1055  if (not workerhelper::CallImpl<T>::wantsTransition(this)) {
1056  return;
1057  }
1058 
1059  //Need to check workStarted_ before adding to waitingTasks_
1060  bool expected = false;
1061  auto workStarted = workStarted_.compare_exchange_strong(expected, true);
1062 
1064  if (workStarted) {
1065  ServiceWeakToken weakToken = serviceToken;
1066  auto toDo = [this, info = transitionInfo, streamID, parentContext, context, weakToken]() {
1067  std::exception_ptr exceptionPtr;
1068  // Caught exception is propagated via WaitingTaskList
1069  CMS_SA_ALLOW try {
1070  //Need to make the services available
1071  ServiceRegistry::Operate guard(weakToken.lock());
1072 
1073  this->runModule<T>(info, streamID, parentContext, context);
1074  } catch (...) {
1075  exceptionPtr = std::current_exception();
1076  }
1077  this->waitingTasks_.doneWaiting(exceptionPtr);
1078  };
1079 
1080  if (needsESPrefetching(T::transition_)) {
1081  auto group = task.group();
1082  auto afterPrefetch =
1083  edm::make_waiting_task([toDo = std::move(toDo), group, this](std::exception_ptr const* iExcept) {
1084  if (iExcept) {
1085  this->waitingTasks_.doneWaiting(*iExcept);
1086  } else {
1087  if (auto queue = this->serializeRunModule()) {
1088  queue.push(*group, toDo);
1089  } else {
1090  group->run(toDo);
1091  }
1092  }
1093  });
1095  WaitingTaskHolder(*group, afterPrefetch), transitionInfo.eventSetupImpl(), T::transition_, serviceToken);
1096  } else {
1097  auto group = task.group();
1098  if (auto queue = this->serializeRunModule()) {
1099  queue.push(*group, toDo);
1100  } else {
1101  group->run(toDo);
1102  }
1103  }
1104  }
1105  }

References edm::WaitingTaskList::add(), CMS_SA_ALLOW, visDQMUpload::context, edm::WaitingTaskList::doneWaiting(), esPrefetchAsync(), watchdog::group, info(), edm::ServiceWeakToken::lock(), edm::make_waiting_task(), eostools::move(), needsESPrefetching(), createBeamHaloJobs::queue, serializeRunModule(), TrackValidation_cff::task, waitingTasks_, and workStarted_.

Referenced by edm::WorkerInPath::runWorkerAsync().

◆ edPrefetchAsync()

void edm::Worker::edPrefetchAsync ( WaitingTaskHolder  iTask,
ServiceToken const &  token,
Principal const &  iPrincipal 
) const
private

Definition at line 324 of file Worker.cc.

324  {
325  // Prefetch products the module declares it consumes
326  std::vector<ProductResolverIndexAndSkipBit> const& items = itemsToGetFrom(iPrincipal.branchType());
327 
328  for (auto const& item : items) {
329  ProductResolverIndex productResolverIndex = item.productResolverIndex();
330  bool skipCurrentProcess = item.skipCurrentProcess();
331  if (productResolverIndex != ProductResolverIndexAmbiguous) {
332  iPrincipal.prefetchAsync(iTask, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
333  }
334  }
335  }

References edm::Principal::branchType(), B2GTnPMonitor_cfi::item, mps_monitormerge::items, itemsToGetFrom(), moduleCallingContext_, edm::Principal::prefetchAsync(), edm::ProductResolverIndexAmbiguous, and unpackBuffers-CaloStage2::token.

Referenced by prefetchAsync().

◆ emitPostModuleEventPrefetchingSignal()

void edm::Worker::emitPostModuleEventPrefetchingSignal ( )
inlineprivate

Definition at line 351 of file Worker.h.

351  {
352  actReg_->postModuleEventPrefetchingSignal_.emit(*moduleCallingContext_.getStreamContext(), moduleCallingContext_);
353  }

References actReg_, edm::ModuleCallingContext::getStreamContext(), and moduleCallingContext_.

Referenced by edm::Worker::RunModuleTask< T >::execute().

◆ endJob()

void edm::Worker::endJob ( void  )

Definition at line 363 of file Worker.cc.

363  {
364  try {
365  convertException::wrap([&]() {
366  ModuleDescription const* desc = description();
367  assert(desc != nullptr);
368  ModuleEndJobSignalSentry cpp(actReg_.get(), *desc);
369  implEndJob();
370  });
371  } catch (cms::Exception& ex) {
372  state_ = Exception;
373  std::ostringstream ost;
374  ost << "Calling endJob for module " << description()->moduleName() << "/'" << description()->moduleLabel() << "'";
375  ex.addContext(ost.str());
376  throw;
377  }
378  }

References actReg_, cms::Exception::addContext(), cms::cuda::assert(), submitPVResolutionJobs::desc, description(), Exception, implEndJob(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), state_, and edm::convertException::wrap().

◆ endStream()

void edm::Worker::endStream ( StreamID  id,
StreamContext streamContext 
)

Definition at line 404 of file Worker.cc.

404  {
405  try {
406  convertException::wrap([&]() {
407  streamContext.setTransition(StreamContext::Transition::kEndStream);
408  streamContext.setEventID(EventID(0, 0, 0));
409  streamContext.setRunIndex(RunIndex::invalidRunIndex());
410  streamContext.setLuminosityBlockIndex(LuminosityBlockIndex::invalidLuminosityBlockIndex());
411  streamContext.setTimestamp(Timestamp());
412  ParentContext parentContext(&streamContext);
413  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
415  ModuleEndStreamSignalSentry endSentry(actReg_.get(), streamContext, moduleCallingContext_);
416  implEndStream(id);
417  });
418  } catch (cms::Exception& ex) {
419  state_ = Exception;
420  std::ostringstream ost;
421  ost << "Calling endStream for module " << description()->moduleName() << "/'" << description()->moduleLabel()
422  << "'";
423  ex.addContext(ost.str());
424  throw;
425  }
426  }

References actReg_, cms::Exception::addContext(), description(), Exception, implEndStream(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::RunIndex::invalidRunIndex(), edm::StreamContext::kEndStream, edm::ModuleCallingContext::kRunning, moduleCallingContext_, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), edm::StreamContext::setEventID(), edm::StreamContext::setLuminosityBlockIndex(), edm::StreamContext::setRunIndex(), edm::ModuleCallingContext::setState(), edm::StreamContext::setTimestamp(), edm::StreamContext::setTransition(), state_, and edm::convertException::wrap().

◆ esItemsToGetFrom()

virtual std::vector<ESProxyIndex> const& edm::Worker::esItemsToGetFrom ( Transition  ) const
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by esPrefetchAsync(), and needsESPrefetching().

◆ esPrefetchAsync()

void edm::Worker::esPrefetchAsync ( WaitingTaskHolder  iTask,
EventSetupImpl const &  iImpl,
Transition  iTrans,
ServiceToken const &  iToken 
)
private

Definition at line 253 of file Worker.cc.

256  {
258  return;
259  }
260  auto const& recs = esRecordsToGetFrom(iTrans);
261  auto const& items = esItemsToGetFrom(iTrans);
262 
263  assert(items.size() == recs.size());
264  if (items.empty()) {
265  return;
266  }
267 
268  //Thread case of 1 thread special. The master thread is doing a wait_for_all on the
269  // default tbb arena. It will not process any tasks on the es arena. We need to add a
270  // task that will synchronously do a wait_for_all in the es arena to be sure prefetching
271  // will work.
272 
273  if UNLIKELY (tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism) == 1) {
274  auto taskGroup = iTask.group();
275  ServiceWeakToken weakToken = iToken;
276  taskGroup->run([this, task = std::move(iTask), iTrans, &iImpl, weakToken]() {
277  std::exception_ptr exceptPtr{};
278  iImpl.taskArena()->execute([this, iTrans, &iImpl, weakToken, &exceptPtr]() {
279  exceptPtr = syncWait([&](WaitingTaskHolder&& iHolder) {
280  auto const& recs = esRecordsToGetFrom(iTrans);
281  auto const& items = esItemsToGetFrom(iTrans);
282  auto hWaitTask = std::move(iHolder);
283  auto token = weakToken.lock();
284  for (size_t i = 0; i != items.size(); ++i) {
285  if (recs[i] != ESRecordIndex{}) {
286  auto rec = iImpl.findImpl(recs[i]);
287  if (rec) {
288  rec->prefetchAsync(hWaitTask, items[i], &iImpl, token, ESParentContext(&moduleCallingContext_));
289  }
290  }
291  }
292  }); //syncWait
293  }); //esTaskArena().execute
294  //note use of a copy gets around declaring the lambda as mutable
295  auto tempTask = task;
296  tempTask.doneWaiting(exceptPtr);
297  }); //group.run
298  } else {
299  auto group = iTask.group();
300  //We need iTask to run in the default arena since it is not an ES task
301  auto task = make_waiting_task(
302  [holder = WaitingTaskWithArenaHolder(std::move(iTask))](std::exception_ptr const* iExcept) mutable {
303  if (iExcept) {
304  holder.doneWaiting(*iExcept);
305  } else {
306  holder.doneWaiting(std::exception_ptr{});
307  }
308  });
309 
310  WaitingTaskHolder tempH(*group, task);
311  iImpl.taskArena()->execute([&]() {
312  for (size_t i = 0; i != items.size(); ++i) {
313  if (recs[i] != ESRecordIndex{}) {
314  auto rec = iImpl.findImpl(recs[i]);
315  if (rec) {
316  rec->prefetchAsync(tempH, items[i], &iImpl, iToken, ESParentContext(&moduleCallingContext_));
317  }
318  }
319  }
320  });
321  }
322  }

References cms::cuda::assert(), esItemsToGetFrom(), esRecordsToGetFrom(), edm::EventSetupImpl::findImpl(), edm::WaitingTaskHolder::group(), watchdog::group, mps_fire::i, mps_monitormerge::items, edm::ServiceWeakToken::lock(), edm::make_waiting_task(), moduleCallingContext_, eostools::move(), edm::NumberOfEventSetupTransitions, edm::eventsetup::EventSetupRecordImpl::prefetchAsync(), edm::syncWait(), TrackValidation_cff::task, edm::EventSetupImpl::taskArena(), unpackBuffers-CaloStage2::token, and UNLIKELY.

Referenced by doWorkNoPrefetchingAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::esPrefetchAsync(), and edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > >::esPrefetchAsync().

◆ esRecordsToGetFrom()

virtual std::vector<ESRecordIndex> const& edm::Worker::esRecordsToGetFrom ( Transition  ) const
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by esPrefetchAsync().

◆ exceptionContext()

void edm::Worker::exceptionContext ( cms::Exception ex,
ModuleCallingContext const *  mcc 
)
staticprivate

Definition at line 112 of file Worker.cc.

112  {
113  ModuleCallingContext const* imcc = mcc;
114  while ((imcc->type() == ParentContext::Type::kModule) or (imcc->type() == ParentContext::Type::kInternal)) {
115  std::ostringstream iost;
116  if (imcc->state() == ModuleCallingContext::State::kPrefetching) {
117  iost << "Prefetching for module ";
118  } else {
119  iost << "Calling method for module ";
120  }
121  iost << imcc->moduleDescription()->moduleName() << "/'" << imcc->moduleDescription()->moduleLabel() << "'";
122 
123  if (imcc->type() == ParentContext::Type::kInternal) {
124  iost << " (probably inside some kind of mixing module)";
125  imcc = imcc->internalContext()->moduleCallingContext();
126  } else {
127  imcc = imcc->moduleCallingContext();
128  }
129  ex.addContext(iost.str());
130  }
131  std::ostringstream ost;
132  if (imcc->state() == ModuleCallingContext::State::kPrefetching) {
133  ost << "Prefetching for module ";
134  } else {
135  ost << "Calling method for module ";
136  }
137  ost << imcc->moduleDescription()->moduleName() << "/'" << imcc->moduleDescription()->moduleLabel() << "'";
138  ex.addContext(ost.str());
139 
140  if (imcc->type() == ParentContext::Type::kPlaceInPath) {
141  ost.str("");
142  ost << "Running path '";
143  ost << imcc->placeInPathContext()->pathContext()->pathName() << "'";
144  ex.addContext(ost.str());
145  auto streamContext = imcc->placeInPathContext()->pathContext()->streamContext();
146  if (streamContext) {
147  ost.str("");
148  edm::exceptionContext(ost, *streamContext);
149  ex.addContext(ost.str());
150  }
151  } else {
152  if (imcc->type() == ParentContext::Type::kStream) {
153  ost.str("");
154  edm::exceptionContext(ost, *(imcc->streamContext()));
155  ex.addContext(ost.str());
156  } else if (imcc->type() == ParentContext::Type::kGlobal) {
157  ost.str("");
158  edm::exceptionContext(ost, *(imcc->globalContext()));
159  ex.addContext(ost.str());
160  }
161  }
162  }

References cms::Exception::addContext(), edm::exceptionContext(), edm::ModuleCallingContext::globalContext(), edm::ModuleCallingContext::internalContext(), edm::ParentContext::kGlobal, edm::ParentContext::kInternal, edm::ParentContext::kModule, edm::ParentContext::kPlaceInPath, edm::ModuleCallingContext::kPrefetching, edm::ParentContext::kStream, edm::InternalContext::moduleCallingContext(), edm::ModuleCallingContext::moduleCallingContext(), edm::ModuleCallingContext::moduleDescription(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), or, edm::PlaceInPathContext::pathContext(), edm::PathContext::pathName(), edm::ModuleCallingContext::placeInPathContext(), edm::ModuleCallingContext::state(), edm::PathContext::streamContext(), edm::ModuleCallingContext::streamContext(), and edm::ModuleCallingContext::type().

Referenced by handleExternalWorkException(), runAcquire(), and runModule().

◆ globalLuminosityBlocksQueue()

virtual SerialTaskQueue* edm::Worker::globalLuminosityBlocksQueue ( )
pure virtual

◆ globalRunsQueue()

virtual SerialTaskQueue* edm::Worker::globalRunsQueue ( )
pure virtual

◆ handleExternalWorkException()

std::exception_ptr edm::Worker::handleExternalWorkException ( std::exception_ptr const *  iEPtr,
ParentContext const &  parentContext 
)
private

Definition at line 492 of file Worker.cc.

493  {
495  try {
496  convertException::wrap([iEPtr]() { std::rethrow_exception(*iEPtr); });
497  } catch (cms::Exception& ex) {
498  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
500  return std::current_exception();
501  }
502  }
503  return *iEPtr;
504  }

References exceptionContext(), moduleCallingContext_, ranAcquireWithoutException_, and edm::convertException::wrap().

◆ hasAccumulator()

virtual bool edm::Worker::hasAccumulator ( ) const
pure virtual

◆ hasAcquire()

virtual bool edm::Worker::hasAcquire ( ) const
privatepure virtual

◆ implBeginJob()

virtual void edm::Worker::implBeginJob ( )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by beginJob().

◆ implBeginStream()

virtual void edm::Worker::implBeginStream ( StreamID  )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by beginStream().

◆ implDo()

virtual bool edm::Worker::implDo ( EventTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoAccessInputProcessBlock()

virtual bool edm::Worker::implDoAccessInputProcessBlock ( ProcessBlockPrincipal const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoAcquire()

virtual void edm::Worker::implDoAcquire ( EventTransitionInfo const &  ,
ModuleCallingContext const *  ,
WaitingTaskWithArenaHolder  
)
protectedpure virtual

◆ implDoBegin() [1/2]

virtual bool edm::Worker::implDoBegin ( LumiTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

◆ implDoBegin() [2/2]

virtual bool edm::Worker::implDoBegin ( RunTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoBeginProcessBlock()

virtual bool edm::Worker::implDoBeginProcessBlock ( ProcessBlockPrincipal const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoEnd() [1/2]

virtual bool edm::Worker::implDoEnd ( LumiTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

◆ implDoEnd() [2/2]

virtual bool edm::Worker::implDoEnd ( RunTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoEndProcessBlock()

virtual bool edm::Worker::implDoEndProcessBlock ( ProcessBlockPrincipal const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoPrePrefetchSelection()

virtual bool edm::Worker::implDoPrePrefetchSelection ( StreamID  ,
EventPrincipal const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoStreamBegin() [1/2]

virtual bool edm::Worker::implDoStreamBegin ( StreamID  ,
LumiTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

◆ implDoStreamBegin() [2/2]

virtual bool edm::Worker::implDoStreamBegin ( StreamID  ,
RunTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoStreamEnd() [1/2]

virtual bool edm::Worker::implDoStreamEnd ( StreamID  ,
LumiTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

◆ implDoStreamEnd() [2/2]

virtual bool edm::Worker::implDoStreamEnd ( StreamID  ,
RunTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implEndJob()

virtual void edm::Worker::implEndJob ( )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by endJob().

◆ implEndStream()

virtual void edm::Worker::implEndStream ( StreamID  )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by endStream().

◆ implNeedToRunSelection()

virtual bool edm::Worker::implNeedToRunSelection ( ) const
protectedpure virtual

◆ implRegisterThinnedAssociations()

virtual void edm::Worker::implRegisterThinnedAssociations ( ProductRegistry const &  ,
ThinnedAssociationsHelper  
)
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by registerThinnedAssociations().

◆ implRespondToCloseInputFile()

virtual void edm::Worker::implRespondToCloseInputFile ( FileBlock const &  fb)
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by respondToCloseInputFile().

◆ implRespondToCloseOutputFile()

virtual void edm::Worker::implRespondToCloseOutputFile ( )
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by respondToCloseOutputFile().

◆ implRespondToOpenInputFile()

virtual void edm::Worker::implRespondToOpenInputFile ( FileBlock const &  fb)
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by respondToOpenInputFile().

◆ itemsMayGet()

virtual void edm::Worker::itemsMayGet ( BranchType  ,
std::vector< ProductResolverIndexAndSkipBit > &   
) const
privatepure virtual

Implemented in edm::WorkerT< T >.

◆ itemsShouldPutInEvent()

virtual std::vector<ProductResolverIndex> const& edm::Worker::itemsShouldPutInEvent ( ) const
privatepure virtual

Implemented in edm::WorkerT< T >.

◆ itemsToGet()

virtual void edm::Worker::itemsToGet ( BranchType  ,
std::vector< ProductResolverIndexAndSkipBit > &   
) const
privatepure virtual

Implemented in edm::WorkerT< T >.

◆ itemsToGetForSelection()

virtual void edm::Worker::itemsToGetForSelection ( std::vector< ProductResolverIndexAndSkipBit > &  ) const
protectedpure virtual

◆ itemsToGetFrom()

virtual std::vector<ProductResolverIndexAndSkipBit> const& edm::Worker::itemsToGetFrom ( BranchType  ) const
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by edPrefetchAsync().

◆ moduleConcurrencyType()

virtual ConcurrencyTypes edm::Worker::moduleConcurrencyType ( ) const
pure virtual

◆ modulesWhoseProductsAreConsumed()

virtual void edm::Worker::modulesWhoseProductsAreConsumed ( std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &  modules,
std::vector< ModuleProcessName > &  modulesInPreviousProcesses,
ProductRegistry const &  preg,
std::map< std::string, ModuleDescription const * > const &  labelsToDesc 
) const
pure virtual

Implemented in edm::WorkerT< T >.

◆ moduleType()

virtual Types edm::Worker::moduleType ( ) const
pure virtual

◆ needsESPrefetching()

bool edm::Worker::needsESPrefetching ( Transition  iTrans) const
inlineprivatenoexcept

Definition at line 347 of file Worker.h.

347  {
348  return iTrans < edm::Transition::NumberOfEventSetupTransitions ? not esItemsToGetFrom(iTrans).empty() : false;
349  }

References esItemsToGetFrom(), and edm::NumberOfEventSetupTransitions.

Referenced by doWorkNoPrefetchingAsync().

◆ operator=()

Worker& edm::Worker::operator= ( Worker const &  )
delete

◆ postDoEvent()

void edm::Worker::postDoEvent ( EventPrincipal const &  iEvent)

Definition at line 446 of file Worker.cc.

446  {
447  if (earlyDeleteHelper_) {
448  earlyDeleteHelper_->moduleRan(iEvent);
449  }
450  }

References earlyDeleteHelper_, and iEvent.

◆ preActionBeforeRunEventAsync()

virtual void edm::Worker::preActionBeforeRunEventAsync ( WaitingTaskHolder  iTask,
ModuleCallingContext const &  moduleCallingContext,
Principal const &  iPrincipal 
) const
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by prefetchAsync().

◆ prefetchAsync()

template<typename T >
void edm::Worker::prefetchAsync ( WaitingTaskHolder  iTask,
ServiceToken const &  token,
ParentContext const &  parentContext,
typename T::TransitionInfoType const &  transitionInfo,
Transition  iTransition 
)
private

Definition at line 911 of file Worker.h.

915  {
916  Principal const& principal = transitionInfo.principal();
917 
919 
920  if (principal.branchType() == InEvent) {
921  actReg_->preModuleEventPrefetchingSignal_.emit(*moduleCallingContext_.getStreamContext(), moduleCallingContext_);
922  }
923 
924  workerhelper::CallImpl<T>::esPrefetchAsync(this, iTask, token, transitionInfo, iTransition);
925  edPrefetchAsync(iTask, token, principal);
926 
927  if (principal.branchType() == InEvent) {
929  }
930  }

References actReg_, edm::Principal::branchType(), edPrefetchAsync(), edm::ModuleCallingContext::getStreamContext(), edm::InEvent, edm::ModuleCallingContext::kPrefetching, moduleCallingContext_, preActionBeforeRunEventAsync(), edm::ModuleCallingContext::setContext(), and unpackBuffers-CaloStage2::token.

◆ prePrefetchSelectionAsync() [1/2]

void edm::Worker::prePrefetchSelectionAsync ( tbb::task_group &  group,
WaitingTask task,
ServiceToken const &  token,
StreamID  stream,
EventPrincipal const *  iPrincipal 
)

Definition at line 204 of file Worker.cc.

208  {
209  successTask->increment_ref_count();
210 
211  ServiceWeakToken weakToken = token;
212  auto choiceTask =
213  edm::make_waiting_task([id, successTask, iPrincipal, this, weakToken, &group](std::exception_ptr const*) {
214  ServiceRegistry::Operate guard(weakToken.lock());
215  // There is no reasonable place to rethrow, and implDoPrePrefetchSelection() should not throw in the first place.
216  CMS_SA_ALLOW try {
217  if (not implDoPrePrefetchSelection(id, *iPrincipal, &moduleCallingContext_)) {
218  timesRun_.fetch_add(1, std::memory_order_relaxed);
219  setPassed<true>();
220  waitingTasks_.doneWaiting(nullptr);
221  //TBB requires that destroyed tasks have count 0
222  if (0 == successTask->decrement_ref_count()) {
223  TaskSentry s(successTask);
224  }
225  return;
226  }
227  } catch (...) {
228  }
229  if (0 == successTask->decrement_ref_count()) {
230  group.run([successTask]() {
231  TaskSentry s(successTask);
232  successTask->execute();
233  });
234  }
235  });
236 
237  WaitingTaskHolder choiceHolder{group, choiceTask};
238 
239  std::vector<ProductResolverIndexAndSkipBit> items;
241 
242  for (auto const& item : items) {
243  ProductResolverIndex productResolverIndex = item.productResolverIndex();
244  bool skipCurrentProcess = item.skipCurrentProcess();
245  if (productResolverIndex != ProductResolverIndexAmbiguous) {
246  iPrincipal->prefetchAsync(
247  choiceHolder, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
248  }
249  }
250  choiceHolder.doneWaiting(std::exception_ptr{});
251  }

References CMS_SA_ALLOW, edm::TaskBase::decrement_ref_count(), edm::WaitingTaskList::doneWaiting(), edm::TaskBase::execute(), watchdog::group, implDoPrePrefetchSelection(), edm::TaskBase::increment_ref_count(), B2GTnPMonitor_cfi::item, mps_monitormerge::items, itemsToGetForSelection(), edm::ServiceWeakToken::lock(), edm::make_waiting_task(), moduleCallingContext_, edm::Principal::prefetchAsync(), edm::ProductResolverIndexAmbiguous, alignCSCRings::s, timesRun_, unpackBuffers-CaloStage2::token, and waitingTasks_.

Referenced by doWorkAsync().

◆ prePrefetchSelectionAsync() [2/2]

void edm::Worker::prePrefetchSelectionAsync ( tbb::task_group &  ,
WaitingTask task,
ServiceToken const &  ,
StreamID  stream,
void const *   
)
inline

Definition at line 140 of file Worker.h.

141  {
142  assert(false);
143  }

References cms::cuda::assert().

◆ registerThinnedAssociations()

void edm::Worker::registerThinnedAssociations ( ProductRegistry const &  registry,
ThinnedAssociationsHelper helper 
)

Definition at line 428 of file Worker.cc.

428  {
429  try {
431  } catch (cms::Exception& ex) {
432  ex.addContext("Calling registerThinnedAssociations() for module " + description()->moduleLabel());
433  throw ex;
434  }
435  }

References cms::Exception::addContext(), description(), implRegisterThinnedAssociations(), and HerwigMaxPtPartonFilter_cfi::moduleLabel.

◆ reset()

void edm::Worker::reset ( void  )
inline

Definition at line 178 of file Worker.h.

178  {
179  cached_exception_ = std::exception_ptr();
180  state_ = Ready;
182  workStarted_ = false;
184  }

References cached_exception_, numberOfPathsLeftToRun_, numberOfPathsOn_, Ready, edm::WaitingTaskList::reset(), state_, waitingTasks_, and workStarted_.

Referenced by edm::WorkerManager::resetAll().

◆ resetModuleDescription()

void edm::Worker::resetModuleDescription ( ModuleDescription const *  iDesc)
protected

◆ resolvePutIndicies()

virtual void edm::Worker::resolvePutIndicies ( BranchType  iBranchType,
std::unordered_multimap< std::string, std::tuple< TypeID const *, const char *, edm::ProductResolverIndex >> const &  iIndicies 
)
pure virtual

Implemented in edm::WorkerT< T >.

◆ respondToCloseInputFile()

void edm::Worker::respondToCloseInputFile ( FileBlock const &  fb)
inline

Definition at line 174 of file Worker.h.

References implRespondToCloseInputFile().

Referenced by edm::Schedule::respondToCloseInputFile().

◆ respondToCloseOutputFile()

void edm::Worker::respondToCloseOutputFile ( )
inline

Definition at line 175 of file Worker.h.

References implRespondToCloseOutputFile().

◆ respondToOpenInputFile()

void edm::Worker::respondToOpenInputFile ( FileBlock const &  fb)
inline

Definition at line 173 of file Worker.h.

References implRespondToOpenInputFile().

Referenced by edm::Schedule::respondToOpenInputFile().

◆ runAcquire()

void edm::Worker::runAcquire ( EventTransitionInfo const &  info,
ParentContext const &  parentContext,
WaitingTaskWithArenaHolder holder 
)
private

Definition at line 452 of file Worker.cc.

454  {
455  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
456  try {
457  convertException::wrap([&]() { this->implDoAcquire(info, &moduleCallingContext_, holder); });
458  } catch (cms::Exception& ex) {
460  if (shouldRethrowException(std::current_exception(), parentContext, true)) {
461  timesRun_.fetch_add(1, std::memory_order_relaxed);
462  throw;
463  }
464  }
465  }

References exceptionContext(), implDoAcquire(), moduleCallingContext_, shouldRethrowException(), timesRun_, and edm::convertException::wrap().

Referenced by runAcquireAfterAsyncPrefetch().

◆ runAcquireAfterAsyncPrefetch()

void edm::Worker::runAcquireAfterAsyncPrefetch ( std::exception_ptr const *  iEPtr,
EventTransitionInfo const &  eventTransitionInfo,
ParentContext const &  parentContext,
WaitingTaskWithArenaHolder  holder 
)
private

Definition at line 467 of file Worker.cc.

470  {
472  std::exception_ptr exceptionPtr;
473  if (iEPtr) {
474  assert(*iEPtr);
475  if (shouldRethrowException(*iEPtr, parentContext, true)) {
476  exceptionPtr = *iEPtr;
477  }
479  } else {
480  // Caught exception is propagated via WaitingTaskWithArenaHolder
481  CMS_SA_ALLOW try {
482  runAcquire(eventTransitionInfo, parentContext, holder);
484  } catch (...) {
485  exceptionPtr = std::current_exception();
486  }
487  }
488  // It is important this is after runAcquire completely finishes
489  holder.doneWaiting(exceptionPtr);
490  }

References cms::cuda::assert(), CMS_SA_ALLOW, edm::WaitingTaskWithArenaHolder::doneWaiting(), edm::ModuleCallingContext::kInvalid, moduleCallingContext_, ranAcquireWithoutException_, runAcquire(), edm::ModuleCallingContext::setContext(), and shouldRethrowException().

◆ runModule()

template<typename T >
bool edm::Worker::runModule ( typename T::TransitionInfoType const &  transitionInfo,
StreamID  streamID,
ParentContext const &  parentContext,
typename T::Context const *  context 
)
private

Definition at line 1108 of file Worker.h.

1111  {
1112  //unscheduled producers should advance this
1113  //if (T::isEvent_) {
1114  // ++timesVisited_;
1115  //}
1116  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
1117  if constexpr (T::isEvent_) {
1118  timesRun_.fetch_add(1, std::memory_order_relaxed);
1119  }
1120 
1121  bool rc = true;
1122  try {
1123  convertException::wrap([&]() {
1124  rc = workerhelper::CallImpl<T>::call(
1125  this, streamID, transitionInfo, actReg_.get(), &moduleCallingContext_, context);
1126 
1127  if (rc) {
1128  setPassed<T::isEvent_>();
1129  } else {
1130  setFailed<T::isEvent_>();
1131  }
1132  });
1133  } catch (cms::Exception& ex) {
1135  if (shouldRethrowException(std::current_exception(), parentContext, T::isEvent_)) {
1137  setException<T::isEvent_>(std::current_exception());
1138  std::rethrow_exception(cached_exception_);
1139  } else {
1140  rc = setPassed<T::isEvent_>();
1141  }
1142  }
1143 
1144  return rc;
1145  }

References actReg_, cms::cuda::assert(), cached_exception_, visDQMUpload::context, exceptionContext(), moduleCallingContext_, shouldRethrowException(), timesRun_, and edm::convertException::wrap().

◆ runModuleAfterAsyncPrefetch()

template<typename T >
std::exception_ptr edm::Worker::runModuleAfterAsyncPrefetch ( std::exception_ptr const *  iEPtr,
typename T::TransitionInfoType const &  transitionInfo,
StreamID  streamID,
ParentContext const &  parentContext,
typename T::Context const *  context 
)
private

Definition at line 1023 of file Worker.h.

1027  {
1028  std::exception_ptr exceptionPtr;
1029  if (iEPtr) {
1030  assert(*iEPtr);
1031  if (shouldRethrowException(*iEPtr, parentContext, T::isEvent_)) {
1032  exceptionPtr = *iEPtr;
1033  setException<T::isEvent_>(exceptionPtr);
1034  } else {
1035  setPassed<T::isEvent_>();
1036  }
1038  } else {
1039  // Caught exception is propagated via WaitingTaskList
1040  CMS_SA_ALLOW try { runModule<T>(transitionInfo, streamID, parentContext, context); } catch (...) {
1041  exceptionPtr = std::current_exception();
1042  }
1043  }
1044  waitingTasks_.doneWaiting(exceptionPtr);
1045  return exceptionPtr;
1046  }

References cms::cuda::assert(), CMS_SA_ALLOW, visDQMUpload::context, edm::WaitingTaskList::doneWaiting(), edm::ModuleCallingContext::kInvalid, moduleCallingContext_, edm::ModuleCallingContext::setContext(), shouldRethrowException(), and waitingTasks_.

Referenced by edm::Worker::RunModuleTask< T >::execute().

◆ runModuleDirectly()

template<typename T >
std::exception_ptr edm::Worker::runModuleDirectly ( typename T::TransitionInfoType const &  transitionInfo,
StreamID  streamID,
ParentContext const &  parentContext,
typename T::Context const *  context 
)

Definition at line 1148 of file Worker.h.

1151  {
1152  timesVisited_.fetch_add(1, std::memory_order_relaxed);
1153  std::exception_ptr const* prefetchingException = nullptr; // null because there was no prefetching to do
1154  return runModuleAfterAsyncPrefetch<T>(prefetchingException, transitionInfo, streamID, parentContext, context);
1155  }

References visDQMUpload::context, and timesVisited_.

Referenced by edm::Path::finished().

◆ selectInputProcessBlocks()

virtual void edm::Worker::selectInputProcessBlocks ( ProductRegistry const &  ,
ProcessBlockHelperBase const &   
)
pure virtual

Implemented in edm::WorkerT< T >.

◆ serializeRunModule()

virtual TaskQueueAdaptor edm::Worker::serializeRunModule ( )
privatepure virtual

◆ setActivityRegistry()

void edm::Worker::setActivityRegistry ( std::shared_ptr< ActivityRegistry areg)

The signals are required to live longer than the last call to 'doWork' this was done to improve performance based on profiling

Definition at line 110 of file Worker.cc.

110 { actReg_ = areg; }

References actReg_.

◆ setEarlyDeleteHelper()

void edm::Worker::setEarlyDeleteHelper ( EarlyDeleteHelper iHelper)

Definition at line 337 of file Worker.cc.

337 { earlyDeleteHelper_ = iHelper; }

References earlyDeleteHelper_.

◆ setException()

template<bool IS_EVENT>
std::exception_ptr edm::Worker::setException ( std::exception_ptr  iException)
inlineprivate

Definition at line 328 of file Worker.h.

328  {
329  if (IS_EVENT) {
330  timesExcept_.fetch_add(1, std::memory_order_relaxed);
331  }
332  cached_exception_ = iException; // propagate_const<T> has no reset() function
333  state_ = Exception;
334  return cached_exception_;
335  }

References cached_exception_, Exception, state_, and timesExcept_.

◆ setFailed()

template<bool IS_EVENT>
bool edm::Worker::setFailed ( )
inlineprivate

Definition at line 319 of file Worker.h.

319  {
320  if (IS_EVENT) {
321  timesFailed_.fetch_add(1, std::memory_order_relaxed);
322  }
323  state_ = Fail;
324  return false;
325  }

References Fail, state_, and timesFailed_.

◆ setPassed()

template<bool IS_EVENT>
bool edm::Worker::setPassed ( )
inlineprivate

Definition at line 310 of file Worker.h.

310  {
311  if (IS_EVENT) {
312  timesPassed_.fetch_add(1, std::memory_order_relaxed);
313  }
314  state_ = Pass;
315  return true;
316  }

References Pass, state_, and timesPassed_.

◆ shouldRethrowException()

bool edm::Worker::shouldRethrowException ( std::exception_ptr  iPtr,
ParentContext const &  parentContext,
bool  isEvent 
) const
private

Definition at line 164 of file Worker.cc.

164  {
165  // NOTE: the warning printed as a result of ignoring or failing
166  // a module will only be printed during the full true processing
167  // pass of this module
168 
169  // Get the action corresponding to this exception. However, if processing
170  // something other than an event (e.g. run, lumi) always rethrow.
171  if (not isEvent) {
172  return true;
173  }
174  try {
175  convertException::wrap([&]() { std::rethrow_exception(iPtr); });
176  } catch (cms::Exception& ex) {
178 
180  return true;
181  }
182 
183  ModuleCallingContext tempContext(description(), ModuleCallingContext::State::kInvalid, parentContext, nullptr);
184 
185  // If we are processing an endpath and the module was scheduled, treat SkipEvent or FailPath
186  // as IgnoreCompletely, so any subsequent OutputModules are still run.
187  // For unscheduled modules only treat FailPath as IgnoreCompletely but still allow SkipEvent to throw
188  ModuleCallingContext const* top_mcc = tempContext.getTopModuleCallingContext();
189  if (top_mcc->type() == ParentContext::Type::kPlaceInPath &&
190  top_mcc->placeInPathContext()->pathContext()->isEndPath()) {
191  if ((action == exception_actions::SkipEvent && tempContext.type() == ParentContext::Type::kPlaceInPath) ||
194  }
195  }
197  edm::printCmsExceptionWarning("IgnoreCompletely", ex);
198  return false;
199  }
200  }
201  return true;
202  }

References writedatasetfile::action, actions_, cms::Exception::category(), description(), edm::exception_actions::FailPath, edm::ExceptionToActionTable::find(), edm::ModuleCallingContext::getTopModuleCallingContext(), edm::exception_actions::IgnoreCompletely, edm::PathContext::isEndPath(), edm::ModuleCallingContext::kInvalid, edm::ParentContext::kPlaceInPath, edm::PlaceInPathContext::pathContext(), edm::ModuleCallingContext::placeInPathContext(), edm::printCmsExceptionWarning(), edm::exception_actions::Rethrow, edm::exception_actions::SkipEvent, edm::ModuleCallingContext::type(), and edm::convertException::wrap().

Referenced by runAcquire(), runAcquireAfterAsyncPrefetch(), runModule(), and runModuleAfterAsyncPrefetch().

◆ skipOnPath()

void edm::Worker::skipOnPath ( EventPrincipal const &  iEvent)

Definition at line 437 of file Worker.cc.

437  {
438  if (earlyDeleteHelper_) {
439  earlyDeleteHelper_->pathFinished(iEvent);
440  }
441  if (0 == --numberOfPathsLeftToRun_) {
443  }
444  }

References cached_exception_, edm::WaitingTaskList::doneWaiting(), earlyDeleteHelper_, iEvent, numberOfPathsLeftToRun_, and waitingTasks_.

Referenced by edm::WorkerInPath::skipWorker().

◆ state()

State edm::Worker::state ( ) const
inline

Definition at line 237 of file Worker.h.

237 { return state_; }

References state_.

Referenced by edm::WorkerInPath::checkResultsOfRunWorker().

◆ timesExcept()

int edm::Worker::timesExcept ( ) const
inline

Definition at line 236 of file Worker.h.

236 { return timesExcept_.load(std::memory_order_acquire); }

References timesExcept_.

◆ timesFailed()

int edm::Worker::timesFailed ( ) const
inline

Definition at line 235 of file Worker.h.

235 { return timesFailed_.load(std::memory_order_acquire); }

References timesFailed_.

◆ timesPass()

int edm::Worker::timesPass ( ) const
inline

Definition at line 239 of file Worker.h.

239 { return timesPassed(); } // for backward compatibility only - to be removed soon

References timesPassed().

◆ timesPassed()

int edm::Worker::timesPassed ( ) const
inline

Definition at line 234 of file Worker.h.

234 { return timesPassed_.load(std::memory_order_acquire); }

References timesPassed_.

Referenced by timesPass().

◆ timesRun()

int edm::Worker::timesRun ( ) const
inline

Definition at line 232 of file Worker.h.

232 { return timesRun_.load(std::memory_order_acquire); }

References timesRun_.

◆ timesVisited()

int edm::Worker::timesVisited ( ) const
inline

Definition at line 233 of file Worker.h.

233 { return timesVisited_.load(std::memory_order_acquire); }

References timesVisited_.

◆ updateLookup() [1/2]

virtual void edm::Worker::updateLookup ( BranchType  iBranchType,
ProductResolverIndexHelper const &   
)
pure virtual

Implemented in edm::WorkerT< T >.

◆ updateLookup() [2/2]

virtual void edm::Worker::updateLookup ( eventsetup::ESRecordsToProxyIndices const &  )
pure virtual

Implemented in edm::WorkerT< T >.

◆ wantsGlobalLuminosityBlocks()

virtual bool edm::Worker::wantsGlobalLuminosityBlocks ( ) const
pure virtual

◆ wantsGlobalRuns()

virtual bool edm::Worker::wantsGlobalRuns ( ) const
pure virtual

◆ wantsInputProcessBlocks()

virtual bool edm::Worker::wantsInputProcessBlocks ( ) const
pure virtual

◆ wantsProcessBlocks()

virtual bool edm::Worker::wantsProcessBlocks ( ) const
pure virtual

◆ wantsStreamLuminosityBlocks()

virtual bool edm::Worker::wantsStreamLuminosityBlocks ( ) const
pure virtual

◆ wantsStreamRuns()

virtual bool edm::Worker::wantsStreamRuns ( ) const
pure virtual

◆ workerType()

virtual std::string edm::Worker::workerType ( ) const
protectedpure virtual

Implemented in edm::WorkerT< T >.

Friends And Related Function Documentation

◆ workerhelper::CallImpl

template<typename O >
friend class workerhelper::CallImpl
friend

Definition at line 245 of file Worker.h.

Member Data Documentation

◆ actions_

ExceptionToActionTable const* edm::Worker::actions_
private

Definition at line 580 of file Worker.h.

Referenced by shouldRethrowException().

◆ actReg_

std::shared_ptr<ActivityRegistry> edm::Worker::actReg_
private

◆ cached_exception_

std::exception_ptr edm::Worker::cached_exception_
private

Definition at line 581 of file Worker.h.

Referenced by reset(), runModule(), setException(), and skipOnPath().

◆ earlyDeleteHelper_

edm::propagate_const<EarlyDeleteHelper*> edm::Worker::earlyDeleteHelper_
private

Definition at line 585 of file Worker.h.

Referenced by postDoEvent(), setEarlyDeleteHelper(), and skipOnPath().

◆ moduleCallingContext_

ModuleCallingContext edm::Worker::moduleCallingContext_
private

◆ moduleValid_

bool edm::Worker::moduleValid_ = true
private

Definition at line 590 of file Worker.h.

Referenced by clearModule(), and description().

◆ numberOfPathsLeftToRun_

std::atomic<int> edm::Worker::numberOfPathsLeftToRun_
private

Definition at line 576 of file Worker.h.

Referenced by reset(), and skipOnPath().

◆ numberOfPathsOn_

int edm::Worker::numberOfPathsOn_
private

Definition at line 575 of file Worker.h.

Referenced by addedToPath(), and reset().

◆ ranAcquireWithoutException_

bool edm::Worker::ranAcquireWithoutException_
private

Definition at line 589 of file Worker.h.

Referenced by handleExternalWorkException(), and runAcquireAfterAsyncPrefetch().

◆ state_

std::atomic<State> edm::Worker::state_
private

◆ timesExcept_

std::atomic<int> edm::Worker::timesExcept_
private

Definition at line 573 of file Worker.h.

Referenced by clearCounters(), setException(), and timesExcept().

◆ timesFailed_

std::atomic<int> edm::Worker::timesFailed_
private

Definition at line 572 of file Worker.h.

Referenced by clearCounters(), setFailed(), and timesFailed().

◆ timesPassed_

std::atomic<int> edm::Worker::timesPassed_
private

Definition at line 571 of file Worker.h.

Referenced by clearCounters(), setPassed(), and timesPassed().

◆ timesRun_

std::atomic<int> edm::Worker::timesRun_
private

Definition at line 569 of file Worker.h.

Referenced by clearCounters(), prePrefetchSelectionAsync(), runAcquire(), runModule(), and timesRun().

◆ timesVisited_

std::atomic<int> edm::Worker::timesVisited_
private

Definition at line 570 of file Worker.h.

Referenced by clearCounters(), doWorkAsync(), runModuleDirectly(), and timesVisited().

◆ waitingTasks_

edm::WaitingTaskList edm::Worker::waitingTasks_
private

◆ workStarted_

std::atomic<bool> edm::Worker::workStarted_
private

Definition at line 588 of file Worker.h.

Referenced by doWorkAsync(), doWorkNoPrefetchingAsync(), and reset().

edm::ModuleCallingContext::state
State state() const
Definition: ModuleCallingContext.h:51
edm::ModuleDescription::moduleLabel
std::string const & moduleLabel() const
Definition: ModuleDescription.h:43
edm::Worker::itemsToGetForSelection
virtual void itemsToGetForSelection(std::vector< ProductResolverIndexAndSkipBit > &) const =0
edm::Worker::implDoPrePrefetchSelection
virtual bool implDoPrePrefetchSelection(StreamID, EventPrincipal const &, ModuleCallingContext const *)=0
edm::exceptionContext
void exceptionContext(std::ostream &, GlobalContext const &)
Definition: GlobalContext.cc:71
edm::ProductResolverIndex
unsigned int ProductResolverIndex
Definition: ProductResolverIndex.h:8
mps_fire.i
i
Definition: mps_fire.py:428
edm::ModuleCallingContext::State::kPrefetching
cms::Exception::addContext
void addContext(std::string const &context)
Definition: Exception.cc:165
edm::Worker::actReg_
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:583
edm::Worker::implEndJob
virtual void implEndJob()=0
Timestamp
edm::exception_actions::Rethrow
Definition: ExceptionActions.h:11
edm::Worker::timesPassed_
std::atomic< int > timesPassed_
Definition: Worker.h:571
edm::Worker::Fail
Definition: Worker.h:93
edm::Worker::kOne
Definition: Worker.h:95
edm::printCmsExceptionWarning
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
Definition: ExceptionMessages.cc:25
edm::Worker::timesVisited_
std::atomic< int > timesVisited_
Definition: Worker.h:570
edm::Worker::Exception
Definition: Worker.h:93
edm::ModuleDescription::moduleName
std::string const & moduleName() const
Definition: ModuleDescription.h:42
edm::Worker::actions_
ExceptionToActionTable const * actions_
Definition: Worker.h:580
edm::Worker::implBeginJob
virtual void implBeginJob()=0
edm::ParentContext::Type::kStream
cms::cuda::assert
assert(be >=bs)
edm::Worker::kGlobal
Definition: Worker.h:95
edm::Worker::numberOfPathsLeftToRun_
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:576
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
edm::ParentContext::Type::kGlobal
edm::Worker::kProducer
Definition: Worker.h:94
edm::ParentContext::Type::kPlaceInPath
edm::ModuleCallingContext::State::kInvalid
edm::ModuleCallingContext::moduleDescription
ModuleDescription const * moduleDescription() const
Definition: ModuleCallingContext.h:50
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::Worker::kLegacy
Definition: Worker.h:95
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
edm::Worker::implEndStream
virtual void implEndStream(StreamID)=0
edm::Worker::workStarted_
std::atomic< bool > workStarted_
Definition: Worker.h:588
edm::ModuleCallingContext::parent
ParentContext const & parent() const
Definition: ModuleCallingContext.h:53
mps_monitormerge.items
list items
Definition: mps_monitormerge.py:29
edm::WaitingTaskList::reset
void reset()
Resets access to the resource so that added tasks will wait.
Definition: WaitingTaskList.cc:53
edm::Worker::implRespondToCloseInputFile
virtual void implRespondToCloseInputFile(FileBlock const &fb)=0
visDQMUpload.context
context
Definition: visDQMUpload.py:37
edm::Worker::description
ModuleDescription const * description() const
Definition: Worker.h:188
edm::Worker::kStream
Definition: Worker.h:95
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::Worker::kFilter
Definition: Worker.h:94
edm::Worker::earlyDeleteHelper_
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:585
WaitingTask
ESRecordIndex
edm::Worker::timesRun_
std::atomic< int > timesRun_
Definition: Worker.h:569
edm::Worker::kLimited
Definition: Worker.h:95
edm::Worker::kAnalyzer
Definition: Worker.h:94
edm::convertException::wrap
auto wrap(F iFunc) -> decltype(iFunc())
Definition: ConvertException.h:19
edm::StreamContext::Transition::kBeginStream
edm::ParentContext::Type::kInternal
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:253
edm::Worker::state_
std::atomic< State > state_
Definition: Worker.h:574
edm::exception_actions::FailPath
Definition: ExceptionActions.h:11
edm::WaitingTaskList::doneWaiting
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
Definition: WaitingTaskList.cc:212
edm::Worker::doClearModule
virtual void doClearModule()=0
WaitingTaskHolder
edm::InEvent
Definition: BranchType.h:11
edm::Worker::Pass
Definition: Worker.h:93
edm::exception_actions::SkipEvent
Definition: ExceptionActions.h:11
edm::ParentContext::Type::kModule
edm::Worker::timesExcept_
std::atomic< int > timesExcept_
Definition: Worker.h:573
createBeamHaloJobs.queue
queue
Definition: createBeamHaloJobs.py:343
edm::Worker::runAcquire
void runAcquire(EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder &)
Definition: Worker.cc:452
edm::ServiceRegistry::Operate
friend class Operate
Definition: ServiceRegistry.h:54
edm::Worker::serializeRunModule
virtual TaskQueueAdaptor serializeRunModule()=0
edm::Worker::implDoAcquire
virtual void implDoAcquire(EventTransitionInfo const &, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)=0
edm::Worker::waitingTasks_
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:587
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::make_waiting_task
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
edm::LuminosityBlockIndex::invalidLuminosityBlockIndex
static LuminosityBlockIndex invalidLuminosityBlockIndex()
Definition: LuminosityBlockIndex.cc:9
fetchall_from_DQM_v2.release
release
Definition: fetchall_from_DQM_v2.py:92
edm::ModuleCallingContext::previousModuleOnThread
ModuleCallingContext const * previousModuleOnThread() const
Definition: ModuleCallingContext.h:75
edm::Worker::implRegisterThinnedAssociations
virtual void implRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)=0
edm::ModuleCallingContext::getStreamContext
StreamContext const * getStreamContext() const
Definition: ModuleCallingContext.cc:32
edm::ModuleCallingContext::setState
void setState(State state)
Definition: ModuleCallingContext.h:48
Exception
helper
Definition: helper.py:1
edm::ModuleCallingContext::setContext
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
Definition: ModuleCallingContext.cc:24
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::Worker::ranAcquireWithoutException_
bool ranAcquireWithoutException_
Definition: Worker.h:589
edm::Worker::exceptionContext
static void exceptionContext(cms::Exception &ex, ModuleCallingContext const *mcc)
Definition: Worker.cc:112
edm::Worker::implRespondToOpenInputFile
virtual void implRespondToOpenInputFile(FileBlock const &fb)=0
edm::Worker::numberOfPathsOn_
int numberOfPathsOn_
Definition: Worker.h:575
writedatasetfile.action
action
Definition: writedatasetfile.py:8
edm::Worker::moduleCallingContext_
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:578
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::Worker::timesFailed_
std::atomic< int > timesFailed_
Definition: Worker.h:572
edm::Worker::esPrefetchAsync
void esPrefetchAsync(WaitingTaskHolder, EventSetupImpl const &, Transition, ServiceToken const &)
Definition: Worker.cc:253
edm::Worker::cached_exception_
std::exception_ptr cached_exception_
Definition: Worker.h:581
edm::RunIndex::invalidRunIndex
static RunIndex invalidRunIndex()
Definition: RunIndex.cc:9
edm::Worker::needsESPrefetching
bool needsESPrefetching(Transition iTrans) const noexcept
Definition: Worker.h:347
edm::Worker::esRecordsToGetFrom
virtual std::vector< ESRecordIndex > const & esRecordsToGetFrom(Transition) const =0
edm::Worker::timesPassed
int timesPassed() const
Definition: Worker.h:234
edm::ProductResolverIndexAmbiguous
Definition: ProductResolverIndex.h:18
edm::Worker::itemsToGetFrom
virtual std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType) const =0
edm::Worker::hasAcquire
virtual bool hasAcquire() const =0
edm::WaitingTaskList::add
void add(tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
Definition: WaitingTaskList.cc:125
edm::Worker::implRespondToCloseOutputFile
virtual void implRespondToCloseOutputFile()=0
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::WaitingTask
Definition: WaitingTask.h:36
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::Worker::preActionBeforeRunEventAsync
virtual void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const &moduleCallingContext, Principal const &iPrincipal) const =0
edm::Worker::edPrefetchAsync
void edPrefetchAsync(WaitingTaskHolder, ServiceToken const &, Principal const &) const
Definition: Worker.cc:324
edm::Worker::esItemsToGetFrom
virtual std::vector< ESProxyIndex > const & esItemsToGetFrom(Transition) const =0
edm::Worker::prePrefetchSelectionAsync
void prePrefetchSelectionAsync(tbb::task_group &, WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *)
Definition: Worker.cc:204
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::ExceptionToActionTable::find
exception_actions::ActionCodes find(const std::string &category) const
Definition: ExceptionActions.cc:85
edm::Worker::implBeginStream
virtual void implBeginStream(StreamID)=0
edm::Worker::Ready
Definition: Worker.h:93
edm::syncWait
std::exception_ptr syncWait(F &&iFunc)
Definition: include_first_syncWait.h:17
cms::Exception
Definition: Exception.h:70
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::exception_actions::IgnoreCompletely
Definition: ExceptionActions.h:11
cms::Exception::category
std::string const & category() const
Definition: Exception.cc:143
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::Worker::kOutputModule
Definition: Worker.h:94
edm::Worker::moduleValid_
bool moduleValid_
Definition: Worker.h:590
edm::StreamContext::Transition::kEndStream
edm::exception_actions::ActionCodes
ActionCodes
Definition: ExceptionActions.h:11
edm::Worker::shouldRethrowException
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent) const
Definition: Worker.cc:164
watchdog.group
group
Definition: watchdog.py:82
edm::Transition::NumberOfEventSetupTransitions
edm::ModuleCallingContext::State::kRunning
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316