CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | 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 }
 
enum  State { Ready, Pass, Fail, Exception }
 
enum  Types { kAnalyzer, kFilter, kProducer, kOutputModule }
 

Public Member Functions

void addedToPath () noexcept
 
void beginJob (GlobalContext const &)
 
void beginStream (StreamID, StreamContext const &)
 
void callWhenDoneAsync (WaitingTaskHolder task)
 
void clearCounters () noexcept
 
void clearModule ()
 
virtual std::vector< ConsumesInfoconsumesInfo () const =0
 
virtual void convertCurrentProcessAlias (std::string const &processName)=0
 
ModuleDescription const * description () const noexcept
 
void doTransformAsync (WaitingTaskHolder, size_t iTransformIndex, EventPrincipal const &, ServiceToken const &, StreamID, ModuleCallingContext const &, StreamContext const *) noexcept
 
template<typename T >
void doWorkAsync (WaitingTaskHolder, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *) noexcept
 
template<typename T >
void doWorkNoPrefetchingAsync (WaitingTaskHolder, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *) noexcept
 
void endJob (GlobalContext const &)
 
void endStream (StreamID, StreamContext const &)
 
virtual SerialTaskQueueglobalLuminosityBlocksQueue ()=0
 
virtual SerialTaskQueueglobalRunsQueue ()=0
 
virtual bool hasAccumulator () const noexcept=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 (oneapi::tbb::task_group &, WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *) noexcept
 
void prePrefetchSelectionAsync (oneapi::tbb::task_group &, WaitingTask *task, ServiceToken const &, StreamID stream, void const *) noexcept
 
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 *) noexcept
 
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 noexcept
 
int timesExcept () const noexcept
 
int timesFailed () const noexcept
 
int timesPass () const noexcept
 
int timesPassed () const noexcept
 
int timesRun () const noexcept
 
int timesVisited () const noexcept
 
virtual size_t transformIndex (edm::BranchDescription const &) const noexcept=0
 
virtual void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &)=0
 
virtual void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)=0
 
edm::WaitingTaskListwaitingTaskList () noexcept
 
virtual bool wantsGlobalLuminosityBlocks () const noexcept=0
 
virtual bool wantsGlobalRuns () const noexcept=0
 
virtual bool wantsInputProcessBlocks () const noexcept=0
 
virtual bool wantsProcessBlocks () const noexcept=0
 
virtual bool wantsStreamLuminosityBlocks () const noexcept=0
 
virtual bool wantsStreamRuns () const noexcept=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 (RunTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoBegin (LumiTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoBeginProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0
 
virtual bool implDoEnd (RunTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoEnd (LumiTransitionInfo 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, RunTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoStreamBegin (StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoStreamEnd (StreamID, RunTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual bool implDoStreamEnd (StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)=0
 
virtual void implDoTransformAsync (WaitingTaskHolder, size_t iTransformIndex, EventPrincipal const &, ParentContext const &, ServiceWeakToken const &) noexcept=0
 
virtual void implEndJob ()=0
 
virtual void implEndStream (StreamID)=0
 
virtual bool implNeedToRunSelection () const noexcept=0
 
virtual void itemsToGetForSelection (std::vector< ProductResolverIndexAndSkipBit > &) const =0
 
virtual ProductResolverIndex itemToGetForTransform (size_t iTransformIndex) const noexcept=0
 
void resetModuleDescription (ModuleDescription const *)
 
virtual std::string workerType () const =0
 

Private Member Functions

void checkForShouldTryToContinue (ModuleDescription const &)
 
void edPrefetchAsync (WaitingTaskHolder, ServiceToken const &, Principal const &) const noexcept
 
void emitPostModuleEventPrefetchingSignal ()
 
void emitPostModuleGlobalPrefetchingSignal ()
 
void emitPostModuleStreamPrefetchingSignal ()
 
virtual std::vector< ESResolverIndex > const & esItemsToGetFrom (Transition) const =0
 
void esPrefetchAsync (WaitingTaskHolder, EventSetupImpl const &, Transition, ServiceToken const &) noexcept
 
virtual std::vector< ESRecordIndex > const & esRecordsToGetFrom (Transition) const =0
 
std::exception_ptr handleExternalWorkException (std::exception_ptr iEPtr, ParentContext const &parentContext) noexcept
 
virtual bool hasAcquire () const noexcept=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 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 noexcept=0
 
template<typename T >
void prefetchAsync (WaitingTaskHolder, ServiceToken const &, ParentContext const &, typename T::TransitionInfoType const &, Transition) noexcept
 
void runAcquire (EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder &)
 
void runAcquireAfterAsyncPrefetch (std::exception_ptr, EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder) noexcept
 
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, typename T::TransitionInfoType const &, StreamID, ParentContext const &, typename T::Context const *) noexcept
 
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, bool isTryToContinue) const noexcept
 

Private Attributes

ExceptionToActionTable const * actions_
 
std::shared_ptr< ActivityRegistryactReg_
 
bool beginSucceeded_ = false
 
std::exception_ptr cached_exception_
 
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
 
ModuleCallingContext moduleCallingContext_
 
bool moduleValid_ = true
 
std::atomic< int > numberOfPathsLeftToRun_
 
int numberOfPathsOn_
 
bool ranAcquireWithoutException_
 
bool shouldTryToContinue_ = false
 
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 

Definition at line 95 of file Worker.h.

◆ State

Enumerator
Ready 
Pass 
Fail 
Exception 

Definition at line 93 of file Worker.h.

◆ 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 82 of file Worker.cc.

References checkForShouldTryToContinue().

83  : timesRun_(0),
84  timesVisited_(0),
85  timesPassed_(0),
86  timesFailed_(0),
87  timesExcept_(0),
88  state_(Ready),
92  actions_(iActions),
94  actReg_(),
95  earlyDeleteHelper_(nullptr),
96  workStarted_(false),
99  }
std::atomic< int > timesVisited_
Definition: Worker.h:608
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:614
std::atomic< int > timesExcept_
Definition: Worker.h:611
std::atomic< bool > workStarted_
Definition: Worker.h:626
std::atomic< int > timesFailed_
Definition: Worker.h:610
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:621
ExceptionToActionTable const * actions_
Definition: Worker.h:618
bool ranAcquireWithoutException_
Definition: Worker.h:627
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
std::exception_ptr cached_exception_
Definition: Worker.h:619
std::atomic< State > state_
Definition: Worker.h:612
int numberOfPathsOn_
Definition: Worker.h:613
void checkForShouldTryToContinue(ModuleDescription const &)
Definition: Worker.cc:105
std::atomic< int > timesPassed_
Definition: Worker.h:609
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:623
std::atomic< int > timesRun_
Definition: Worker.h:607

◆ ~Worker()

edm::Worker::~Worker ( )
virtual

Definition at line 101 of file Worker.cc.

101 {}

◆ Worker() [2/2]

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

Member Function Documentation

◆ activityRegistry()

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

Definition at line 300 of file Worker.h.

References actReg_.

Referenced by beginJob(), beginStream(), endJob(), and endStream().

300 { return actReg_.get(); }
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:621

◆ addedToPath()

void edm::Worker::addedToPath ( )
inlinenoexcept

Definition at line 242 of file Worker.h.

References numberOfPathsOn_.

242 { ++numberOfPathsOn_; }
int numberOfPathsOn_
Definition: Worker.h:613

◆ beginJob()

void edm::Worker::beginJob ( GlobalContext const &  globalContext)

Definition at line 292 of file Worker.cc.

References activityRegistry(), beginSucceeded_, edm::exceptionContext(), implBeginJob(), moduleCallingContext_, and edm::convertException::wrap().

292  {
293  ParentContext parentContext(&globalContext);
294  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
295  ModuleSignalSentry<ModuleBeginJobTraits> sentry(activityRegistry(), &globalContext, &moduleCallingContext_);
296 
297  try {
298  convertException::wrap([this, &sentry]() {
299  beginSucceeded_ = false;
300  sentry.preModuleSignal();
301  implBeginJob();
302  sentry.postModuleSignal();
303  beginSucceeded_ = true;
304  });
305  } catch (cms::Exception& ex) {
307  throw;
308  }
309  }
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
ActivityRegistry * activityRegistry()
Definition: Worker.h:300
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
virtual void implBeginJob()=0
bool beginSucceeded_
Definition: Worker.h:630
auto wrap(F iFunc) -> decltype(iFunc())

◆ beginStream()

void edm::Worker::beginStream ( StreamID  streamID,
StreamContext const &  streamContext 
)

Definition at line 332 of file Worker.cc.

References activityRegistry(), beginSucceeded_, edm::exceptionContext(), implBeginStream(), moduleCallingContext_, and edm::convertException::wrap().

332  {
333  ParentContext parentContext(&streamContext);
334  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
335  ModuleSignalSentry<ModuleBeginStreamTraits> sentry(activityRegistry(), &streamContext, &moduleCallingContext_);
336 
337  try {
338  convertException::wrap([this, &sentry, streamID]() {
339  beginSucceeded_ = false;
340  sentry.preModuleSignal();
341  implBeginStream(streamID);
342  sentry.postModuleSignal();
343  beginSucceeded_ = true;
344  });
345  } catch (cms::Exception& ex) {
347  throw;
348  }
349  }
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
ActivityRegistry * activityRegistry()
Definition: Worker.h:300
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
bool beginSucceeded_
Definition: Worker.h:630
virtual void implBeginStream(StreamID)=0
auto wrap(F iFunc) -> decltype(iFunc())

◆ callWhenDoneAsync()

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

Definition at line 179 of file Worker.h.

References edm::WaitingTaskList::add(), eostools::move(), TrackValidation_cff::task, and waitingTasks_.

edm::WaitingTaskList waitingTasks_
Definition: Worker.h:625
void add(oneapi::tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
def move(src, dest)
Definition: eostools.py:511

◆ checkForShouldTryToContinue()

void edm::Worker::checkForShouldTryToContinue ( ModuleDescription const &  iDesc)
private

Definition at line 105 of file Worker.cc.

References edm::pset::Registry::getMapped(), edm::pset::Registry::instance(), edm::ModuleDescription::parameterSetID(), muonDTDigis_cfi::pset, and shouldTryToContinue_.

Referenced by resetModuleDescription(), and Worker().

105  {
106  auto pset = edm::pset::Registry::instance()->getMapped(iDesc.parameterSetID());
107  if (pset and pset->exists("@shouldTryToContinue")) {
108  shouldTryToContinue_ = true;
109  }
110  }
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:17
static Registry * instance()
Definition: Registry.cc:12
bool shouldTryToContinue_
Definition: Worker.h:629

◆ clearCounters()

void edm::Worker::clearCounters ( )
inlinenoexcept

Definition at line 234 of file Worker.h.

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

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

234  {
235  timesRun_.store(0, std::memory_order_release);
236  timesVisited_.store(0, std::memory_order_release);
237  timesPassed_.store(0, std::memory_order_release);
238  timesFailed_.store(0, std::memory_order_release);
239  timesExcept_.store(0, std::memory_order_release);
240  }
std::atomic< int > timesVisited_
Definition: Worker.h:608
std::atomic< int > timesExcept_
Definition: Worker.h:611
std::atomic< int > timesFailed_
Definition: Worker.h:610
std::atomic< int > timesPassed_
Definition: Worker.h:609
std::atomic< int > timesRun_
Definition: Worker.h:607

◆ clearModule()

void edm::Worker::clearModule ( )
inline

Definition at line 122 of file Worker.h.

References doClearModule(), and moduleValid_.

122  {
123  moduleValid_ = false;
124  doClearModule();
125  }
bool moduleValid_
Definition: Worker.h:628
virtual void doClearModule()=0

◆ 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
inlinenoexcept

Definition at line 200 of file Worker.h.

References moduleCallingContext_, edm::ModuleCallingContext::moduleDescription(), and moduleValid_.

Referenced by edm::StreamSchedule::fillWorkers(), registerThinnedAssociations(), and edm::StreamSchedule::tryToPlaceConditionalModules().

200  {
201  if (moduleValid_) {
203  }
204  return nullptr;
205  }
bool moduleValid_
Definition: Worker.h:628
ModuleDescription const * moduleDescription() const noexcept
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616

◆ doClearModule()

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

Implemented in edm::WorkerT< T >.

Referenced by clearModule().

◆ doTransformAsync()

void edm::Worker::doTransformAsync ( WaitingTaskHolder  iTask,
size_t  iTransformIndex,
EventPrincipal const &  iPrincipal,
ServiceToken const &  iToken,
StreamID  ,
ModuleCallingContext const &  mcc,
StreamContext const *   
)
noexcept

Definition at line 254 of file Worker.cc.

References edm::make_waiting_task(), and TrackValidation_cff::task.

260  {
261  ServiceWeakToken weakToken = iToken;
262 
263  //Need to make the services available early so other services can see them
264  auto task = make_waiting_task(
265  [this, iTask, weakToken, &iPrincipal, iTransformIndex, mcc](std::exception_ptr const* iExcept) mutable {
266  //post prefetch signal
267  actReg_->postModuleTransformPrefetchingSignal_.emit(*mcc.getStreamContext(), mcc);
268  if (iExcept) {
269  iTask.doneWaiting(*iExcept);
270  return;
271  }
272  implDoTransformAsync(iTask, iTransformIndex, iPrincipal, mcc.parent(), weakToken);
273  });
274 
275  //pre prefetch signal
276  actReg_->preModuleTransformPrefetchingSignal_.emit(*mcc.getStreamContext(), mcc);
277  iPrincipal.prefetchAsync(
278  WaitingTaskHolder(*iTask.group(), task), itemToGetForTransform(iTransformIndex), false, iToken, &mcc);
279  }
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:621
virtual ProductResolverIndex itemToGetForTransform(size_t iTransformIndex) const noexcept=0
virtual void implDoTransformAsync(WaitingTaskHolder, size_t iTransformIndex, EventPrincipal const &, ParentContext const &, ServiceWeakToken const &) noexcept=0
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:92

◆ 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 
)
noexcept

Definition at line 1078 of file Worker.h.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), visDQMUpload::context, watchdog::group, info(), edm::ModuleCallingContext::kPrefetching, edm::make_waiting_task(), eostools::move(), AlCaHLTBitMon_ParallelJobs::p, fetchall_from_DQM_v2::release, alignCSCRings::s, submitPVValidationJobs::t, TrackValidation_cff::task, and unpackBuffers-CaloStage2::token.

1083  {
1084  if (not workerhelper::CallImpl<T>::wantsTransition(this)) {
1085  return;
1086  }
1087 
1088  //Need to check workStarted_ before adding to waitingTasks_
1089  bool expected = false;
1090  bool workStarted = workStarted_.compare_exchange_strong(expected, true);
1091 
1093  if constexpr (T::isEvent_) {
1094  timesVisited_.fetch_add(1, std::memory_order_relaxed);
1095  }
1096 
1097  if (workStarted) {
1099 
1100  //if have TriggerResults based selection we want to reject the event before doing prefetching
1101  if (workerhelper::CallImpl<T>::needToRunSelection(this)) {
1102  //We need to run the selection in a different task so that
1103  // we can prefetch the data needed for the selection
1104  WaitingTask* moduleTask =
1105  new RunModuleTask<T>(this, transitionInfo, token, streamID, parentContext, context, task.group());
1106 
1107  //make sure the task is either run or destroyed
1108  struct DestroyTask {
1109  DestroyTask(edm::WaitingTask* iTask) noexcept : m_task(iTask) {}
1110 
1111  ~DestroyTask() noexcept {
1112  auto p = m_task.exchange(nullptr);
1113  if (p) {
1114  TaskSentry s{p};
1115  }
1116  }
1117 
1118  edm::WaitingTask* release() noexcept { return m_task.exchange(nullptr); }
1119 
1120  private:
1121  std::atomic<edm::WaitingTask*> m_task;
1122  };
1123  if constexpr (T::isEvent_) {
1124  if (hasAcquire()) {
1125  auto ownRunTask = std::make_shared<DestroyTask>(moduleTask);
1126  ServiceWeakToken weakToken = token;
1127  auto* group = task.group();
1128  moduleTask = make_waiting_task(
1129  [this, weakToken, transitionInfo, parentContext, ownRunTask, group](std::exception_ptr const* iExcept) {
1130  WaitingTaskWithArenaHolder runTaskHolder(
1131  *group, new HandleExternalWorkExceptionTask(this, group, ownRunTask->release(), parentContext));
1132  AcquireTask<T> t(this, transitionInfo, weakToken.lock(), parentContext, runTaskHolder);
1133  t.execute();
1134  });
1135  }
1136  }
1137  auto* group = task.group();
1138  auto ownModuleTask = std::make_shared<DestroyTask>(moduleTask);
1139  ServiceWeakToken weakToken = token;
1140  auto selectionTask =
1141  make_waiting_task([ownModuleTask, parentContext, info = transitionInfo, weakToken, group, this](
1142  std::exception_ptr const*) mutable {
1143  ServiceRegistry::Operate guard(weakToken.lock());
1144  prefetchAsync<T>(WaitingTaskHolder(*group, ownModuleTask->release()),
1145  weakToken.lock(),
1146  parentContext,
1147  info,
1148  T::transition_);
1149  });
1150  prePrefetchSelectionAsync(*group, selectionTask, token, streamID, &transitionInfo.principal());
1151  } else {
1152  WaitingTask* moduleTask =
1153  new RunModuleTask<T>(this, transitionInfo, token, streamID, parentContext, context, task.group());
1154  auto group = task.group();
1155  if constexpr (T::isEvent_) {
1156  if (hasAcquire()) {
1157  WaitingTaskWithArenaHolder runTaskHolder(
1158  *group, new HandleExternalWorkExceptionTask(this, group, moduleTask, parentContext));
1159  moduleTask = new AcquireTask<T>(this, transitionInfo, token, parentContext, std::move(runTaskHolder));
1160  }
1161  }
1162  prefetchAsync<T>(WaitingTaskHolder(*group, moduleTask), token, parentContext, transitionInfo, T::transition_);
1163  }
1164  }
1165  }
std::atomic< int > timesVisited_
Definition: Worker.h:608
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread) noexcept
static const TGPicture * info(bool iBackgroundIsBlack)
std::atomic< bool > workStarted_
Definition: Worker.h:626
virtual bool hasAcquire() const noexcept=0
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:625
void add(oneapi::tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:92
void prePrefetchSelectionAsync(oneapi::tbb::task_group &, WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *) noexcept
Definition: Worker.cc:147
def move(src, dest)
Definition: eostools.py:511

◆ 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 
)
noexcept

Definition at line 1200 of file Worker.h.

References CMS_SA_ALLOW, visDQMUpload::context, watchdog::group, info(), edm::ModuleCallingContext::kPrefetching, edm::ServiceWeakToken::lock(), edm::make_waiting_task(), eostools::move(), createBeamHaloJobs::queue, and TrackValidation_cff::task.

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

1205  {
1206  if (not workerhelper::CallImpl<T>::wantsTransition(this)) {
1207  return;
1208  }
1209 
1210  //Need to check workStarted_ before adding to waitingTasks_
1211  bool expected = false;
1212  auto workStarted = workStarted_.compare_exchange_strong(expected, true);
1213 
1215  if (workStarted) {
1216  ServiceWeakToken weakToken = serviceToken;
1217  auto toDo = [this, info = transitionInfo, streamID, parentContext, context, weakToken]() {
1218  std::exception_ptr exceptionPtr;
1219  // Caught exception is propagated via WaitingTaskList
1220  CMS_SA_ALLOW try {
1221  //Need to make the services available
1222  ServiceRegistry::Operate guard(weakToken.lock());
1223 
1224  this->runModule<T>(info, streamID, parentContext, context);
1225  } catch (...) {
1226  exceptionPtr = std::current_exception();
1227  }
1228  this->waitingTasks_.doneWaiting(exceptionPtr);
1229  };
1230 
1231  if (needsESPrefetching(T::transition_)) {
1232  auto group = task.group();
1233  auto afterPrefetch =
1234  edm::make_waiting_task([toDo = std::move(toDo), group, this](std::exception_ptr const* iExcept) {
1235  if (iExcept) {
1236  this->waitingTasks_.doneWaiting(*iExcept);
1237  } else {
1238  if (auto queue = this->serializeRunModule()) {
1239  queue.push(*group, toDo);
1240  } else {
1241  group->run(toDo);
1242  }
1243  }
1244  });
1247  WaitingTaskHolder(*group, afterPrefetch), transitionInfo.eventSetupImpl(), T::transition_, serviceToken);
1248  } else {
1249  auto group = task.group();
1250  if (auto queue = this->serializeRunModule()) {
1251  queue.push(*group, toDo);
1252  } else {
1253  group->run(toDo);
1254  }
1255  }
1256  }
1257  }
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread) noexcept
static const TGPicture * info(bool iBackgroundIsBlack)
#define CMS_SA_ALLOW
std::atomic< bool > workStarted_
Definition: Worker.h:626
bool needsESPrefetching(Transition iTrans) const noexcept
Definition: Worker.h:370
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:625
void add(oneapi::tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:92
virtual TaskQueueAdaptor serializeRunModule()=0
void esPrefetchAsync(WaitingTaskHolder, EventSetupImpl const &, Transition, ServiceToken const &) noexcept
Definition: Worker.cc:211
def move(src, dest)
Definition: eostools.py:511

◆ edPrefetchAsync()

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

Definition at line 236 of file Worker.cc.

References B2GTnPMonitor_cfi::item, mps_monitormerge::items, edm::ProductResolverIndexAmbiguous, and unpackBuffers-CaloStage2::token.

238  {
239  // Prefetch products the module declares it consumes
240  std::vector<ProductResolverIndexAndSkipBit> const& items = itemsToGetFrom(iPrincipal.branchType());
241 
242  for (auto const& item : items) {
243  ProductResolverIndex productResolverIndex = item.productResolverIndex();
244  bool skipCurrentProcess = item.skipCurrentProcess();
245  if (productResolverIndex != ProductResolverIndexAmbiguous) {
246  iPrincipal.prefetchAsync(iTask, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
247  }
248  }
249  }
unsigned int ProductResolverIndex
virtual std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType) const =0
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616

◆ emitPostModuleEventPrefetchingSignal()

void edm::Worker::emitPostModuleEventPrefetchingSignal ( )
inlineprivate

Definition at line 374 of file Worker.h.

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

374  {
375  actReg_->postModuleEventPrefetchingSignal_.emit(*moduleCallingContext_.getStreamContext(), moduleCallingContext_);
376  }
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:621
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
StreamContext const * getStreamContext() const noexcept(false)

◆ emitPostModuleGlobalPrefetchingSignal()

void edm::Worker::emitPostModuleGlobalPrefetchingSignal ( )
inlineprivate

Definition at line 383 of file Worker.h.

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

383  {
384  actReg_->postModuleGlobalPrefetchingSignal_.emit(*moduleCallingContext_.getGlobalContext(),
386  }
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:621
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
GlobalContext const * getGlobalContext() const noexcept(false)

◆ emitPostModuleStreamPrefetchingSignal()

void edm::Worker::emitPostModuleStreamPrefetchingSignal ( )
inlineprivate

Definition at line 378 of file Worker.h.

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

378  {
379  actReg_->postModuleStreamPrefetchingSignal_.emit(*moduleCallingContext_.getStreamContext(),
381  }
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:621
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
StreamContext const * getStreamContext() const noexcept(false)

◆ endJob()

void edm::Worker::endJob ( GlobalContext const &  globalContext)

Definition at line 311 of file Worker.cc.

References activityRegistry(), beginSucceeded_, edm::exceptionContext(), implEndJob(), moduleCallingContext_, and edm::convertException::wrap().

311  {
312  if (beginSucceeded_) {
313  beginSucceeded_ = false;
314 
315  ParentContext parentContext(&globalContext);
316  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
317  ModuleSignalSentry<ModuleEndJobTraits> sentry(activityRegistry(), &globalContext, &moduleCallingContext_);
318 
319  try {
320  convertException::wrap([this, &sentry]() {
321  sentry.preModuleSignal();
322  implEndJob();
323  sentry.postModuleSignal();
324  });
325  } catch (cms::Exception& ex) {
327  throw;
328  }
329  }
330  }
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
ActivityRegistry * activityRegistry()
Definition: Worker.h:300
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
virtual void implEndJob()=0
bool beginSucceeded_
Definition: Worker.h:630
auto wrap(F iFunc) -> decltype(iFunc())

◆ endStream()

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

Definition at line 351 of file Worker.cc.

References activityRegistry(), beginSucceeded_, edm::exceptionContext(), implEndStream(), moduleCallingContext_, and edm::convertException::wrap().

351  {
352  if (beginSucceeded_) {
353  beginSucceeded_ = false;
354 
355  ParentContext parentContext(&streamContext);
356  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
357  ModuleSignalSentry<ModuleEndStreamTraits> sentry(activityRegistry(), &streamContext, &moduleCallingContext_);
358 
359  try {
360  convertException::wrap([this, &sentry, id]() {
361  sentry.preModuleSignal();
362  implEndStream(id);
363  sentry.postModuleSignal();
364  });
365  } catch (cms::Exception& ex) {
367  throw;
368  }
369  }
370  }
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
ActivityRegistry * activityRegistry()
Definition: Worker.h:300
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
bool beginSucceeded_
Definition: Worker.h:630
virtual void implEndStream(StreamID)=0
auto wrap(F iFunc) -> decltype(iFunc())

◆ esItemsToGetFrom()

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

Implemented in edm::WorkerT< T >.

Referenced by needsESPrefetching().

◆ esPrefetchAsync()

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

Definition at line 211 of file Worker.cc.

References cms::cuda::assert(), mps_fire::i, mps_monitormerge::items, and edm::NumberOfEventSetupTransitions.

214  {
216  return;
217  }
218  auto const& recs = esRecordsToGetFrom(iTrans);
219  auto const& items = esItemsToGetFrom(iTrans);
220 
221  assert(items.size() == recs.size());
222  if (items.empty()) {
223  return;
224  }
225 
226  for (size_t i = 0; i != items.size(); ++i) {
227  if (recs[i] != ESRecordIndex{}) {
228  auto rec = iImpl.findImpl(recs[i]);
229  if (rec) {
230  rec->prefetchAsync(iTask, items[i], &iImpl, iToken, ESParentContext(&moduleCallingContext_));
231  }
232  }
233  }
234  }
assert(be >=bs)
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
virtual std::vector< ESRecordIndex > const & esRecordsToGetFrom(Transition) const =0
virtual std::vector< ESResolverIndex > const & esItemsToGetFrom(Transition) const =0

◆ esRecordsToGetFrom()

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

Implemented in edm::WorkerT< T >.

◆ 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  iEPtr,
ParentContext const &  parentContext 
)
privatenoexcept

Definition at line 435 of file Worker.cc.

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

Referenced by edm::Worker::HandleExternalWorkExceptionTask::execute().

436  {
438  try {
439  convertException::wrap([iEPtr]() { std::rethrow_exception(iEPtr); });
440  } catch (cms::Exception& ex) {
441  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
443  return std::current_exception();
444  }
445  }
446  return iEPtr;
447  }
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
bool ranAcquireWithoutException_
Definition: Worker.h:627
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
auto wrap(F iFunc) -> decltype(iFunc())

◆ hasAccumulator()

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

◆ hasAcquire()

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

Implemented in edm::WorkerT< T >.

◆ 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 ( RunTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoBegin() [2/2]

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

Implemented in edm::WorkerT< T >.

◆ implDoBeginProcessBlock()

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

◆ implDoEnd() [1/2]

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

◆ implDoEnd() [2/2]

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

Implemented in edm::WorkerT< T >.

◆ 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  ,
RunTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

◆ implDoStreamBegin() [2/2]

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

Implemented in edm::WorkerT< T >.

◆ implDoStreamEnd() [1/2]

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

◆ implDoStreamEnd() [2/2]

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

Implemented in edm::WorkerT< T >.

◆ implDoTransformAsync()

virtual void edm::Worker::implDoTransformAsync ( WaitingTaskHolder  ,
size_t  iTransformIndex,
EventPrincipal const &  ,
ParentContext const &  ,
ServiceWeakToken const &   
)
protectedpure virtualnoexcept

◆ 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 virtualnoexcept

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

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

◆ itemToGetForTransform()

virtual ProductResolverIndex edm::Worker::itemToGetForTransform ( size_t  iTransformIndex) const
protectedpure virtualnoexcept

◆ 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 370 of file Worker.h.

References esItemsToGetFrom(), and edm::NumberOfEventSetupTransitions.

370  {
371  return iTrans < edm::Transition::NumberOfEventSetupTransitions ? not esItemsToGetFrom(iTrans).empty() : false;
372  }
virtual std::vector< ESResolverIndex > const & esItemsToGetFrom(Transition) const =0

◆ operator=()

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

◆ postDoEvent()

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

Definition at line 390 of file Worker.cc.

References earlyDeleteHelper_, and iEvent.

390  {
391  if (earlyDeleteHelper_) {
392  earlyDeleteHelper_->moduleRan(iEvent);
393  }
394  }
int iEvent
Definition: GenABIO.cc:224
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:623

◆ preActionBeforeRunEventAsync()

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

Implemented in edm::WorkerT< T >.

◆ prefetchAsync()

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

Definition at line 1052 of file Worker.h.

References edm::Principal::branchType(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), edm::InEvent, edm::ModuleCallingContext::kPrefetching, and unpackBuffers-CaloStage2::token.

1056  {
1057  Principal const& principal = transitionInfo.principal();
1058 
1060 
1061  if constexpr (T::isEvent_) {
1062  actReg_->preModuleEventPrefetchingSignal_.emit(*moduleCallingContext_.getStreamContext(), moduleCallingContext_);
1063  } else if constexpr (std::is_same_v<typename T::Context, StreamContext>) {
1064  actReg_->preModuleStreamPrefetchingSignal_.emit(*moduleCallingContext_.getStreamContext(), moduleCallingContext_);
1065  } else if constexpr (std::is_same_v<typename T::Context, GlobalContext>) {
1066  actReg_->preModuleGlobalPrefetchingSignal_.emit(*moduleCallingContext_.getGlobalContext(), moduleCallingContext_);
1067  }
1068 
1069  workerhelper::CallImpl<T>::esPrefetchAsync(this, iTask, token, transitionInfo, iTransition);
1070  edPrefetchAsync(iTask, token, principal);
1071 
1072  if (principal.branchType() == InEvent) {
1074  }
1075  }
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread) noexcept
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:621
virtual void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const &moduleCallingContext, Principal const &iPrincipal) const noexcept=0
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
void edPrefetchAsync(WaitingTaskHolder, ServiceToken const &, Principal const &) const noexcept
Definition: Worker.cc:236
GlobalContext const * getGlobalContext() const noexcept(false)
StreamContext const * getStreamContext() const noexcept(false)

◆ prePrefetchSelectionAsync() [1/2]

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

Definition at line 147 of file Worker.cc.

References MillePedeFileConverter_cfg::e, edm::exceptionContext(), watchdog::group, B2GTnPMonitor_cfi::item, mps_monitormerge::items, edm::ServiceWeakToken::lock(), edm::make_waiting_task(), edm::ProductResolverIndexAmbiguous, edm::ProductResolverIndexInvalid, alignCSCRings::s, unpackBuffers-CaloStage2::token, and edm::convertException::wrap().

151  {
152  successTask->increment_ref_count();
153 
154  ServiceWeakToken weakToken = token;
155  auto choiceTask =
156  edm::make_waiting_task([id, successTask, iPrincipal, this, weakToken, &group](std::exception_ptr const*) {
157  ServiceRegistry::Operate guard(weakToken.lock());
158  try {
159  bool selected = convertException::wrap([&]() {
160  if (not implDoPrePrefetchSelection(id, *iPrincipal, &moduleCallingContext_)) {
161  timesRun_.fetch_add(1, std::memory_order_relaxed);
162  setPassed<true>();
163  waitingTasks_.doneWaiting(nullptr);
164  //TBB requires that destroyed tasks have count 0
165  if (0 == successTask->decrement_ref_count()) {
166  TaskSentry s(successTask);
167  }
168  return false;
169  }
170  return true;
171  });
172  if (not selected) {
173  return;
174  }
175 
176  } catch (cms::Exception& e) {
178  setException<true>(std::current_exception());
179  waitingTasks_.doneWaiting(std::current_exception());
180  //TBB requires that destroyed tasks have count 0
181  if (0 == successTask->decrement_ref_count()) {
182  TaskSentry s(successTask);
183  }
184  return;
185  }
186  if (0 == successTask->decrement_ref_count()) {
187  group.run([successTask]() {
188  TaskSentry s(successTask);
189  successTask->execute();
190  });
191  }
192  });
193 
194  WaitingTaskHolder choiceHolder{group, choiceTask};
195 
196  std::vector<ProductResolverIndexAndSkipBit> items;
198 
199  for (auto const& item : items) {
200  ProductResolverIndex productResolverIndex = item.productResolverIndex();
201  bool skipCurrentProcess = item.skipCurrentProcess();
202  if (productResolverIndex != ProductResolverIndexAmbiguous and
203  productResolverIndex != ProductResolverIndexInvalid) {
204  iPrincipal->prefetchAsync(
205  choiceHolder, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
206  }
207  }
208  choiceHolder.doneWaiting(std::exception_ptr{});
209  }
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
unsigned int ProductResolverIndex
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
virtual bool implDoPrePrefetchSelection(StreamID, EventPrincipal const &, ModuleCallingContext const *)=0
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:625
virtual void itemsToGetForSelection(std::vector< ProductResolverIndexAndSkipBit > &) const =0
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:92
auto wrap(F iFunc) -> decltype(iFunc())
std::atomic< int > timesRun_
Definition: Worker.h:607

◆ prePrefetchSelectionAsync() [2/2]

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

Definition at line 143 of file Worker.h.

References cms::cuda::assert().

144  {
145  assert(false);
146  }
assert(be >=bs)

◆ registerThinnedAssociations()

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

Definition at line 372 of file Worker.cc.

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

372  {
373  try {
375  } catch (cms::Exception& ex) {
376  ex.addContext("Calling registerThinnedAssociations() for module " + description()->moduleLabel());
377  throw ex;
378  }
379  }
Definition: helper.py:1
virtual void implRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)=0
ModuleDescription const * description() const noexcept
Definition: Worker.h:200
void addContext(std::string const &context)
Definition: Exception.cc:169

◆ reset()

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

Definition at line 190 of file Worker.h.

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

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

190  {
191  cached_exception_ = std::exception_ptr();
192  state_ = Ready;
194  workStarted_ = false;
196  }
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:614
std::atomic< bool > workStarted_
Definition: Worker.h:626
void reset()
Resets access to the resource so that added tasks will wait.
std::exception_ptr cached_exception_
Definition: Worker.h:619
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:625
std::atomic< State > state_
Definition: Worker.h:612
int numberOfPathsOn_
Definition: Worker.h:613

◆ resetModuleDescription()

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

Definition at line 281 of file Worker.cc.

References cms::cuda::assert(), checkForShouldTryToContinue(), moduleCallingContext_, edm::ModuleCallingContext::parent(), edm::ModuleCallingContext::previousModuleOnThread(), edm::ModuleCallingContext::state(), and groupFilesInBlocks::temp.

Referenced by edm::WorkerT< T >::setModule().

281  {
282  ModuleCallingContext temp(iDesc,
283  0,
288  assert(iDesc);
290  }
ModuleCallingContext const * previousModuleOnThread() const noexcept
assert(be >=bs)
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
ParentContext const & parent() const noexcept
State state() const noexcept
void checkForShouldTryToContinue(ModuleDescription const &)
Definition: Worker.cc:105

◆ 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 186 of file Worker.h.

References implRespondToCloseInputFile().

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

virtual void implRespondToCloseInputFile(FileBlock const &fb)=0

◆ respondToCloseOutputFile()

void edm::Worker::respondToCloseOutputFile ( )
inline

Definition at line 187 of file Worker.h.

References implRespondToCloseOutputFile().

virtual void implRespondToCloseOutputFile()=0

◆ respondToOpenInputFile()

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

Definition at line 185 of file Worker.h.

References implRespondToOpenInputFile().

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

virtual void implRespondToOpenInputFile(FileBlock const &fb)=0

◆ runAcquire()

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

Definition at line 396 of file Worker.cc.

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

398  {
399  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
400  try {
401  convertException::wrap([&]() { this->implDoAcquire(info, &moduleCallingContext_, holder); });
402  } catch (cms::Exception& ex) {
404  if (shouldRethrowException(std::current_exception(), parentContext, true, shouldTryToContinue_)) {
405  timesRun_.fetch_add(1, std::memory_order_relaxed);
406  throw;
407  }
408  }
409  }
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent, bool isTryToContinue) const noexcept
Definition: Worker.cc:112
virtual void implDoAcquire(EventTransitionInfo const &, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)=0
static const TGPicture * info(bool iBackgroundIsBlack)
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
auto wrap(F iFunc) -> decltype(iFunc())
std::atomic< int > timesRun_
Definition: Worker.h:607
bool shouldTryToContinue_
Definition: Worker.h:629

◆ runAcquireAfterAsyncPrefetch()

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

Definition at line 411 of file Worker.cc.

References CMS_SA_ALLOW, and edm::ModuleCallingContext::kInvalid.

414  {
416  std::exception_ptr exceptionPtr;
417  if (iEPtr) {
418  if (shouldRethrowException(iEPtr, parentContext, true, shouldTryToContinue_)) {
419  exceptionPtr = iEPtr;
420  }
422  } else {
423  // Caught exception is propagated via WaitingTaskWithArenaHolder
424  CMS_SA_ALLOW try {
425  runAcquire(eventTransitionInfo, parentContext, holder);
427  } catch (...) {
428  exceptionPtr = std::current_exception();
429  }
430  }
431  // It is important this is after runAcquire completely finishes
432  holder.doneWaiting(exceptionPtr);
433  }
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent, bool isTryToContinue) const noexcept
Definition: Worker.cc:112
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread) noexcept
#define CMS_SA_ALLOW
bool ranAcquireWithoutException_
Definition: Worker.h:627
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
void runAcquire(EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder &)
Definition: Worker.cc:396
bool shouldTryToContinue_
Definition: Worker.h:629

◆ 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 1260 of file Worker.h.

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

1263  {
1264  //unscheduled producers should advance this
1265  //if (T::isEvent_) {
1266  // ++timesVisited_;
1267  //}
1268  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
1269  if constexpr (T::isEvent_) {
1270  timesRun_.fetch_add(1, std::memory_order_relaxed);
1271  }
1272 
1273  bool rc = true;
1274  try {
1275  convertException::wrap([&]() {
1276  rc = workerhelper::CallImpl<T>::call(
1277  this, streamID, transitionInfo, actReg_.get(), &moduleCallingContext_, context);
1278 
1279  if (rc) {
1280  setPassed<T::isEvent_>();
1281  } else {
1282  setFailed<T::isEvent_>();
1283  }
1284  });
1285  } catch (cms::Exception& ex) {
1287  if (shouldRethrowException(std::current_exception(), parentContext, T::isEvent_, shouldTryToContinue_)) {
1289  setException<T::isEvent_>(std::current_exception());
1290  std::rethrow_exception(cached_exception_);
1291  } else {
1292  rc = setPassed<T::isEvent_>();
1293  }
1294  }
1295 
1296  return rc;
1297  }
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent, bool isTryToContinue) const noexcept
Definition: Worker.cc:112
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:621
assert(be >=bs)
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
std::exception_ptr cached_exception_
Definition: Worker.h:619
auto wrap(F iFunc) -> decltype(iFunc())
std::atomic< int > timesRun_
Definition: Worker.h:607
bool shouldTryToContinue_
Definition: Worker.h:629

◆ runModuleAfterAsyncPrefetch()

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

Definition at line 1168 of file Worker.h.

References CMS_SA_ALLOW, visDQMUpload::context, and edm::ModuleCallingContext::kInvalid.

1172  {
1173  std::exception_ptr exceptionPtr;
1174  bool shouldRun = true;
1175  if (iEPtr) {
1176  if (shouldRethrowException(iEPtr, parentContext, T::isEvent_, shouldTryToContinue_)) {
1177  exceptionPtr = iEPtr;
1178  setException<T::isEvent_>(exceptionPtr);
1179  shouldRun = false;
1180  } else {
1181  if (not shouldTryToContinue_) {
1182  setPassed<T::isEvent_>();
1183  shouldRun = false;
1184  }
1185  }
1186  }
1187  if (shouldRun) {
1188  // Caught exception is propagated via WaitingTaskList
1189  CMS_SA_ALLOW try { runModule<T>(transitionInfo, streamID, parentContext, context); } catch (...) {
1190  exceptionPtr = std::current_exception();
1191  }
1192  } else {
1194  }
1195  waitingTasks_.doneWaiting(exceptionPtr);
1196  return exceptionPtr;
1197  }
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent, bool isTryToContinue) const noexcept
Definition: Worker.cc:112
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread) noexcept
#define CMS_SA_ALLOW
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:616
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:625
bool shouldTryToContinue_
Definition: Worker.h:629

◆ 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 
)
noexcept

Definition at line 1300 of file Worker.h.

References visDQMUpload::context.

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

1303  {
1304  timesVisited_.fetch_add(1, std::memory_order_relaxed);
1305  std::exception_ptr prefetchingException; // null because there was no prefetching to do
1306  return runModuleAfterAsyncPrefetch<T>(prefetchingException, transitionInfo, streamID, parentContext, context);
1307  }
std::atomic< int > timesVisited_
Definition: Worker.h:608

◆ 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 103 of file Worker.cc.

References actReg_.

103 { actReg_ = areg; }
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:621

◆ setEarlyDeleteHelper()

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

Definition at line 251 of file Worker.cc.

References earlyDeleteHelper_.

251 { earlyDeleteHelper_ = iHelper; }
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:623

◆ setException()

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

Definition at line 351 of file Worker.h.

References cached_exception_, Exception, state_, and timesExcept_.

351  {
352  if (IS_EVENT) {
353  timesExcept_.fetch_add(1, std::memory_order_relaxed);
354  }
355  cached_exception_ = iException; // propagate_const<T> has no reset() function
356  state_ = Exception;
357  return cached_exception_;
358  }
std::atomic< int > timesExcept_
Definition: Worker.h:611
std::exception_ptr cached_exception_
Definition: Worker.h:619
std::atomic< State > state_
Definition: Worker.h:612

◆ setFailed()

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

Definition at line 342 of file Worker.h.

References Fail, state_, and timesFailed_.

342  {
343  if (IS_EVENT) {
344  timesFailed_.fetch_add(1, std::memory_order_relaxed);
345  }
346  state_ = Fail;
347  return false;
348  }
std::atomic< int > timesFailed_
Definition: Worker.h:610
std::atomic< State > state_
Definition: Worker.h:612

◆ setPassed()

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

Definition at line 333 of file Worker.h.

References Pass, state_, and timesPassed_.

333  {
334  if (IS_EVENT) {
335  timesPassed_.fetch_add(1, std::memory_order_relaxed);
336  }
337  state_ = Pass;
338  return true;
339  }
std::atomic< State > state_
Definition: Worker.h:612
std::atomic< int > timesPassed_
Definition: Worker.h:609

◆ shouldRethrowException()

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

Definition at line 112 of file Worker.cc.

References writedatasetfile::action, cms::Exception::category(), edm::exception_actions::IgnoreCompletely, edm::printCmsExceptionWarning(), edm::exception_actions::Rethrow, edm::exception_actions::TryToContinue, and edm::convertException::wrap().

Referenced by runAcquire(), and runModule().

115  {
116  // NOTE: the warning printed as a result of ignoring or failing
117  // a module will only be printed during the full true processing
118  // pass of this module
119 
120  // Get the action corresponding to this exception. However, if processing
121  // something other than an event (e.g. run, lumi) always rethrow.
122  if (not isEvent) {
123  return true;
124  }
125  try {
126  convertException::wrap([&]() { std::rethrow_exception(iPtr); });
127  } catch (cms::Exception& ex) {
129 
131  return true;
132  }
134  if (shouldTryToContinue) {
135  edm::printCmsExceptionWarning("TryToContinue", ex);
136  }
137  return not shouldTryToContinue;
138  }
140  edm::printCmsExceptionWarning("IgnoreCompletely", ex);
141  return false;
142  }
143  }
144  return true;
145  }
std::string const & category() const
Definition: Exception.cc:147
ExceptionToActionTable const * actions_
Definition: Worker.h:618
exception_actions::ActionCodes find(const std::string &category) const
auto wrap(F iFunc) -> decltype(iFunc())
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)

◆ skipOnPath()

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

Definition at line 381 of file Worker.cc.

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

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

381  {
382  if (earlyDeleteHelper_) {
383  earlyDeleteHelper_->pathFinished(iEvent);
384  }
385  if (0 == --numberOfPathsLeftToRun_) {
387  }
388  }
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:614
std::exception_ptr cached_exception_
Definition: Worker.h:619
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
int iEvent
Definition: GenABIO.cc:224
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:625
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:623

◆ state()

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

Definition at line 249 of file Worker.h.

References state_.

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

249 { return state_; }
std::atomic< State > state_
Definition: Worker.h:612

◆ timesExcept()

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

Definition at line 248 of file Worker.h.

References timesExcept_.

248 { return timesExcept_.load(std::memory_order_acquire); }
std::atomic< int > timesExcept_
Definition: Worker.h:611

◆ timesFailed()

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

Definition at line 247 of file Worker.h.

References timesFailed_.

247 { return timesFailed_.load(std::memory_order_acquire); }
std::atomic< int > timesFailed_
Definition: Worker.h:610

◆ timesPass()

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

Definition at line 251 of file Worker.h.

References timesPassed().

251 { return timesPassed(); } // for backward compatibility only - to be removed soon
int timesPassed() const noexcept
Definition: Worker.h:246

◆ timesPassed()

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

Definition at line 246 of file Worker.h.

References timesPassed_.

Referenced by timesPass().

246 { return timesPassed_.load(std::memory_order_acquire); }
std::atomic< int > timesPassed_
Definition: Worker.h:609

◆ timesRun()

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

Definition at line 244 of file Worker.h.

References timesRun_.

244 { return timesRun_.load(std::memory_order_acquire); }
std::atomic< int > timesRun_
Definition: Worker.h:607

◆ timesVisited()

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

Definition at line 245 of file Worker.h.

References timesVisited_.

245 { return timesVisited_.load(std::memory_order_acquire); }
std::atomic< int > timesVisited_
Definition: Worker.h:608

◆ transformIndex()

size_t edm::Worker::transformIndex ( edm::BranchDescription const &  ) const
pure virtualnoexcept

◆ 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::ESRecordsToProductResolverIndices const &  )
pure virtual

Implemented in edm::WorkerT< T >.

◆ waitingTaskList()

edm::WaitingTaskList& edm::Worker::waitingTaskList ( )
inlinenoexcept

Definition at line 256 of file Worker.h.

References waitingTasks_.

256 { return waitingTasks_; }
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:625

◆ wantsGlobalLuminosityBlocks()

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

Implemented in edm::WorkerT< T >.

◆ wantsGlobalRuns()

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

Implemented in edm::WorkerT< T >.

◆ wantsInputProcessBlocks()

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

Implemented in edm::WorkerT< T >.

◆ wantsProcessBlocks()

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

Implemented in edm::WorkerT< T >.

◆ wantsStreamLuminosityBlocks()

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

Implemented in edm::WorkerT< T >.

◆ wantsStreamRuns()

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

Implemented in edm::WorkerT< T >.

◆ 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 260 of file Worker.h.

Member Data Documentation

◆ actions_

ExceptionToActionTable const* edm::Worker::actions_
private

Definition at line 618 of file Worker.h.

◆ actReg_

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

◆ beginSucceeded_

bool edm::Worker::beginSucceeded_ = false
private

◆ cached_exception_

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

Definition at line 619 of file Worker.h.

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

◆ earlyDeleteHelper_

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

Definition at line 623 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 628 of file Worker.h.

Referenced by clearModule(), and description().

◆ numberOfPathsLeftToRun_

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

Definition at line 614 of file Worker.h.

Referenced by reset(), and skipOnPath().

◆ numberOfPathsOn_

int edm::Worker::numberOfPathsOn_
private

Definition at line 613 of file Worker.h.

Referenced by addedToPath(), and reset().

◆ ranAcquireWithoutException_

bool edm::Worker::ranAcquireWithoutException_
private

Definition at line 627 of file Worker.h.

◆ shouldTryToContinue_

bool edm::Worker::shouldTryToContinue_ = false
private

Definition at line 629 of file Worker.h.

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

◆ state_

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

Definition at line 612 of file Worker.h.

Referenced by reset(), setException(), setFailed(), setPassed(), and state().

◆ timesExcept_

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

Definition at line 611 of file Worker.h.

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

◆ timesFailed_

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

Definition at line 610 of file Worker.h.

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

◆ timesPassed_

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

Definition at line 609 of file Worker.h.

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

◆ timesRun_

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

Definition at line 607 of file Worker.h.

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

◆ timesVisited_

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

Definition at line 608 of file Worker.h.

Referenced by clearCounters(), and timesVisited().

◆ waitingTasks_

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

Definition at line 625 of file Worker.h.

Referenced by callWhenDoneAsync(), reset(), skipOnPath(), and waitingTaskList().

◆ workStarted_

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

Definition at line 626 of file Worker.h.

Referenced by reset().