CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
  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 (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 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
 

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

Enumerator
kGlobal 
kLimited 
kOne 
kStream 
kLegacy 

Definition at line 95 of file Worker.h.

Enumerator
Ready 
Pass 
Fail 
Exception 

Definition at line 93 of file Worker.h.

Enumerator
kAnalyzer 
kFilter 
kProducer 
kOutputModule 

Definition at line 94 of file Worker.h.

Constructor & Destructor Documentation

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),
std::atomic< int > timesVisited_
Definition: Worker.h:568
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:574
std::atomic< int > timesExcept_
Definition: Worker.h:571
std::atomic< bool > workStarted_
Definition: Worker.h:586
std::atomic< int > timesFailed_
Definition: Worker.h:570
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
ExceptionToActionTable const * actions_
Definition: Worker.h:578
bool ranAcquireWithoutException_
Definition: Worker.h:587
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
std::exception_ptr cached_exception_
Definition: Worker.h:579
std::atomic< State > state_
Definition: Worker.h:572
int numberOfPathsOn_
Definition: Worker.h:573
std::atomic< int > timesPassed_
Definition: Worker.h:569
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:583
std::atomic< int > timesRun_
Definition: Worker.h:567
edm::Worker::~Worker ( )
virtual

Definition at line 108 of file Worker.cc.

108 {}
edm::Worker::Worker ( Worker const &  )
delete

Member Function Documentation

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

Definition at line 278 of file Worker.h.

References actReg_.

278 { return actReg_.get(); }
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
void edm::Worker::addedToPath ( )
inline

Definition at line 230 of file Worker.h.

References numberOfPathsOn_.

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

230 { ++numberOfPathsOn_; }
int numberOfPathsOn_
Definition: Worker.h:573
void edm::Worker::beginJob ( void  )

Definition at line 295 of file Worker.cc.

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

Referenced by edm::WorkerManager::beginJob(), and edm::GlobalSchedule::replaceModule().

295  {
296  try {
297  convertException::wrap([&]() {
298  ModuleBeginJobSignalSentry cpp(actReg_.get(), *description());
299  implBeginJob();
300  });
301  } catch (cms::Exception& ex) {
302  state_ = Exception;
303  std::ostringstream ost;
304  ost << "Calling beginJob for module " << description()->moduleName() << "/'" << description()->moduleLabel()
305  << "'";
306  ex.addContext(ost.str());
307  throw;
308  }
309  }
ModuleDescription const * description() const
Definition: Worker.h:188
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
std::string const & moduleName() const
std::string const & moduleLabel() const
std::atomic< State > state_
Definition: Worker.h:572
virtual void implBeginJob()=0
void addContext(std::string const &context)
Definition: Exception.cc:165
auto wrap(F iFunc) -> decltype(iFunc())
void edm::Worker::beginStream ( StreamID  id,
StreamContext streamContext 
)

Definition at line 328 of file Worker.cc.

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().

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

328  {
329  try {
330  convertException::wrap([&]() {
331  streamContext.setTransition(StreamContext::Transition::kBeginStream);
332  streamContext.setEventID(EventID(0, 0, 0));
333  streamContext.setRunIndex(RunIndex::invalidRunIndex());
334  streamContext.setLuminosityBlockIndex(LuminosityBlockIndex::invalidLuminosityBlockIndex());
335  streamContext.setTimestamp(Timestamp());
336  ParentContext parentContext(&streamContext);
337  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
339  ModuleBeginStreamSignalSentry beginSentry(actReg_.get(), streamContext, moduleCallingContext_);
340  implBeginStream(id);
341  });
342  } catch (cms::Exception& ex) {
343  state_ = Exception;
344  std::ostringstream ost;
345  ost << "Calling beginStream for module " << description()->moduleName() << "/'" << description()->moduleLabel()
346  << "'";
347  ex.addContext(ost.str());
348  throw;
349  }
350  }
ModuleDescription const * description() const
Definition: Worker.h:188
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
std::string const & moduleName() const
std::string const & moduleLabel() const
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
static RunIndex invalidRunIndex()
Definition: RunIndex.cc:9
std::atomic< State > state_
Definition: Worker.h:572
static LuminosityBlockIndex invalidLuminosityBlockIndex()
void addContext(std::string const &context)
Definition: Exception.cc:165
virtual void implBeginStream(StreamID)=0
auto wrap(F iFunc) -> decltype(iFunc())
void edm::Worker::callWhenDoneAsync ( WaitingTaskHolder  task)
inline

Definition at line 167 of file Worker.h.

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

Referenced by edm::PuttableProductResolver::prefetchAsync_(), and edm::SwitchProducerProductResolver::prefetchAsync_().

167 { waitingTasks_.add(std::move(task)); }
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:585
def move
Definition: eostools.py:511
void add(tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
void edm::Worker::clearCounters ( )
inline

Definition at line 222 of file Worker.h.

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

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

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  }
std::atomic< int > timesVisited_
Definition: Worker.h:568
std::atomic< int > timesExcept_
Definition: Worker.h:571
std::atomic< int > timesFailed_
Definition: Worker.h:570
std::atomic< int > timesPassed_
Definition: Worker.h:569
std::atomic< int > timesRun_
Definition: Worker.h:567
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:588
virtual void doClearModule()=0
virtual std::vector<ConsumesInfo> edm::Worker::consumesInfo ( ) const
pure virtual
virtual void edm::Worker::convertCurrentProcessAlias ( std::string const &  processName)
pure virtual

Implemented in edm::WorkerT< T >.

ModuleDescription const* edm::Worker::description ( ) const
inline
virtual void edm::Worker::doClearModule ( )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by clearModule().

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

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

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

936  {
937  if (not workerhelper::CallImpl<T>::wantsTransition(this)) {
938  return;
939  }
940 
941  //Need to check workStarted_ before adding to waitingTasks_
942  bool expected = false;
943  bool workStarted = workStarted_.compare_exchange_strong(expected, true);
944 
945  waitingTasks_.add(task);
946  if constexpr (T::isEvent_) {
947  timesVisited_.fetch_add(1, std::memory_order_relaxed);
948  }
949 
950  if (workStarted) {
952 
953  //if have TriggerResults based selection we want to reject the event before doing prefetching
954  if (workerhelper::CallImpl<T>::needToRunSelection(this)) {
955  //We need to run the selection in a different task so that
956  // we can prefetch the data needed for the selection
957  WaitingTask* moduleTask =
958  new RunModuleTask<T>(this, transitionInfo, token, streamID, parentContext, context, task.group());
959 
960  //make sure the task is either run or destroyed
961  struct DestroyTask {
962  DestroyTask(edm::WaitingTask* iTask) : m_task(iTask) {}
963 
964  ~DestroyTask() {
965  auto p = m_task.exchange(nullptr);
966  if (p) {
967  TaskSentry s{p};
968  }
969  }
970 
971  edm::WaitingTask* release() { return m_task.exchange(nullptr); }
972 
973  private:
974  std::atomic<edm::WaitingTask*> m_task;
975  };
976  if constexpr (T::isEvent_) {
977  if (hasAcquire()) {
978  auto ownRunTask = std::make_shared<DestroyTask>(moduleTask);
979  ServiceWeakToken weakToken = token;
980  auto* group = task.group();
981  moduleTask = make_waiting_task(
982  [this, weakToken, transitionInfo, parentContext, ownRunTask, group](std::exception_ptr const* iExcept) {
983  WaitingTaskWithArenaHolder runTaskHolder(
984  *group, new HandleExternalWorkExceptionTask(this, group, ownRunTask->release(), parentContext));
985  AcquireTask<T> t(this, transitionInfo, weakToken.lock(), parentContext, runTaskHolder);
986  t.execute();
987  });
988  }
989  }
990  auto* group = task.group();
991  auto ownModuleTask = std::make_shared<DestroyTask>(moduleTask);
992  ServiceWeakToken weakToken = token;
993  auto selectionTask =
994  make_waiting_task([ownModuleTask, parentContext, info = transitionInfo, weakToken, group, this](
995  std::exception_ptr const*) mutable {
996  ServiceRegistry::Operate guard(weakToken.lock());
997  prefetchAsync<T>(WaitingTaskHolder(*group, ownModuleTask->release()),
998  weakToken.lock(),
999  parentContext,
1000  info,
1001  T::transition_);
1002  });
1003  prePrefetchSelectionAsync(*group, selectionTask, token, streamID, &transitionInfo.principal());
1004  } else {
1005  WaitingTask* moduleTask =
1006  new RunModuleTask<T>(this, transitionInfo, token, streamID, parentContext, context, task.group());
1007  auto group = task.group();
1008  if constexpr (T::isEvent_) {
1009  if (hasAcquire()) {
1010  WaitingTaskWithArenaHolder runTaskHolder(
1011  *group, new HandleExternalWorkExceptionTask(this, group, moduleTask, parentContext));
1012  moduleTask = new AcquireTask<T>(this, transitionInfo, token, parentContext, std::move(runTaskHolder));
1013  }
1014  }
1015  prefetchAsync<T>(WaitingTaskHolder(*group, moduleTask), token, parentContext, transitionInfo, T::transition_);
1016  }
1017  }
1018  }
virtual bool hasAcquire() const =0
std::atomic< int > timesVisited_
Definition: Worker.h:568
static const TGPicture * info(bool iBackgroundIsBlack)
std::atomic< bool > workStarted_
Definition: Worker.h:586
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:585
def move
Definition: eostools.py:511
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
void add(tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
tuple group
Definition: watchdog.py:82
void prePrefetchSelectionAsync(tbb::task_group &, WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *)
Definition: Worker.cc:152
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 1047 of file Worker.h.

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

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

1052  {
1053  if (not workerhelper::CallImpl<T>::wantsTransition(this)) {
1054  return;
1055  }
1056 
1057  //Need to check workStarted_ before adding to waitingTasks_
1058  bool expected = false;
1059  auto workStarted = workStarted_.compare_exchange_strong(expected, true);
1060 
1061  waitingTasks_.add(task);
1062  if (workStarted) {
1063  ServiceWeakToken weakToken = serviceToken;
1064  auto toDo = [this, info = transitionInfo, streamID, parentContext, context, weakToken]() {
1065  std::exception_ptr exceptionPtr;
1066  // Caught exception is propagated via WaitingTaskList
1067  CMS_SA_ALLOW try {
1068  //Need to make the services available
1069  ServiceRegistry::Operate guard(weakToken.lock());
1070 
1071  this->runModule<T>(info, streamID, parentContext, context);
1072  } catch (...) {
1073  exceptionPtr = std::current_exception();
1074  }
1075  this->waitingTasks_.doneWaiting(exceptionPtr);
1076  };
1077 
1078  if (needsESPrefetching(T::transition_)) {
1079  auto group = task.group();
1080  auto afterPrefetch =
1081  edm::make_waiting_task([toDo = std::move(toDo), group, this](std::exception_ptr const* iExcept) {
1082  if (iExcept) {
1083  this->waitingTasks_.doneWaiting(*iExcept);
1084  } else {
1085  if (auto queue = this->serializeRunModule()) {
1086  queue.push(*group, toDo);
1087  } else {
1088  group->run(toDo);
1089  }
1090  }
1091  });
1093  WaitingTaskHolder(*group, afterPrefetch), transitionInfo.eventSetupImpl(), T::transition_, serviceToken);
1094  } else {
1095  auto group = task.group();
1096  if (auto queue = this->serializeRunModule()) {
1097  queue.push(*group, toDo);
1098  } else {
1099  group->run(toDo);
1100  }
1101  }
1102  }
1103  }
static const TGPicture * info(bool iBackgroundIsBlack)
#define CMS_SA_ALLOW
std::atomic< bool > workStarted_
Definition: Worker.h:586
bool needsESPrefetching(Transition iTrans) const noexcept
Definition: Worker.h:345
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:585
def move
Definition: eostools.py:511
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
void esPrefetchAsync(WaitingTaskHolder, EventSetupImpl const &, Transition, ServiceToken const &)
Definition: Worker.cc:201
void add(tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
tuple group
Definition: watchdog.py:82
virtual TaskQueueAdaptor serializeRunModule()=0
void edm::Worker::edPrefetchAsync ( WaitingTaskHolder  iTask,
ServiceToken const &  token,
Principal const &  iPrincipal 
) const
private

Definition at line 272 of file Worker.cc.

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

Referenced by prefetchAsync().

272  {
273  // Prefetch products the module declares it consumes
274  std::vector<ProductResolverIndexAndSkipBit> const& items = itemsToGetFrom(iPrincipal.branchType());
275 
276  for (auto const& item : items) {
277  ProductResolverIndex productResolverIndex = item.productResolverIndex();
278  bool skipCurrentProcess = item.skipCurrentProcess();
279  if (productResolverIndex != ProductResolverIndexAmbiguous) {
280  iPrincipal.prefetchAsync(iTask, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
281  }
282  }
283  }
unsigned int ProductResolverIndex
virtual std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType) const =0
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
void edm::Worker::emitPostModuleEventPrefetchingSignal ( )
inlineprivate

Definition at line 349 of file Worker.h.

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

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

349  {
350  actReg_->postModuleEventPrefetchingSignal_.emit(*moduleCallingContext_.getStreamContext(), moduleCallingContext_);
351  }
StreamContext const * getStreamContext() const
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
void edm::Worker::endJob ( void  )

Definition at line 311 of file Worker.cc.

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

311  {
312  try {
313  convertException::wrap([&]() {
314  ModuleDescription const* desc = description();
315  assert(desc != nullptr);
316  ModuleEndJobSignalSentry cpp(actReg_.get(), *desc);
317  implEndJob();
318  });
319  } catch (cms::Exception& ex) {
320  state_ = Exception;
321  std::ostringstream ost;
322  ost << "Calling endJob for module " << description()->moduleName() << "/'" << description()->moduleLabel() << "'";
323  ex.addContext(ost.str());
324  throw;
325  }
326  }
ModuleDescription const * description() const
Definition: Worker.h:188
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
std::string const & moduleName() const
assert(be >=bs)
std::string const & moduleLabel() const
std::atomic< State > state_
Definition: Worker.h:572
virtual void implEndJob()=0
void addContext(std::string const &context)
Definition: Exception.cc:165
auto wrap(F iFunc) -> decltype(iFunc())
void edm::Worker::endStream ( StreamID  id,
StreamContext streamContext 
)

Definition at line 352 of file Worker.cc.

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().

352  {
353  try {
354  convertException::wrap([&]() {
355  streamContext.setTransition(StreamContext::Transition::kEndStream);
356  streamContext.setEventID(EventID(0, 0, 0));
357  streamContext.setRunIndex(RunIndex::invalidRunIndex());
358  streamContext.setLuminosityBlockIndex(LuminosityBlockIndex::invalidLuminosityBlockIndex());
359  streamContext.setTimestamp(Timestamp());
360  ParentContext parentContext(&streamContext);
361  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
363  ModuleEndStreamSignalSentry endSentry(actReg_.get(), streamContext, moduleCallingContext_);
364  implEndStream(id);
365  });
366  } catch (cms::Exception& ex) {
367  state_ = Exception;
368  std::ostringstream ost;
369  ost << "Calling endStream for module " << description()->moduleName() << "/'" << description()->moduleLabel()
370  << "'";
371  ex.addContext(ost.str());
372  throw;
373  }
374  }
ModuleDescription const * description() const
Definition: Worker.h:188
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
std::string const & moduleName() const
std::string const & moduleLabel() const
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
static RunIndex invalidRunIndex()
Definition: RunIndex.cc:9
std::atomic< State > state_
Definition: Worker.h:572
static LuminosityBlockIndex invalidLuminosityBlockIndex()
void addContext(std::string const &context)
Definition: Exception.cc:165
virtual void implEndStream(StreamID)=0
auto wrap(F iFunc) -> decltype(iFunc())
virtual std::vector<ESProxyIndex> const& edm::Worker::esItemsToGetFrom ( Transition  ) const
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by esPrefetchAsync(), and needsESPrefetching().

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

Definition at line 201 of file Worker.cc.

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

204  {
206  return;
207  }
208  auto const& recs = esRecordsToGetFrom(iTrans);
209  auto const& items = esItemsToGetFrom(iTrans);
210 
211  assert(items.size() == recs.size());
212  if (items.empty()) {
213  return;
214  }
215 
216  //Thread case of 1 thread special. The master thread is doing a wait_for_all on the
217  // default tbb arena. It will not process any tasks on the es arena. We need to add a
218  // task that will synchronously do a wait_for_all in the es arena to be sure prefetching
219  // will work.
220 
221  if UNLIKELY (tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism) == 1) {
222  auto taskGroup = iTask.group();
223  ServiceWeakToken weakToken = iToken;
224  taskGroup->run([this, task = std::move(iTask), iTrans, &iImpl, weakToken]() {
225  std::exception_ptr exceptPtr{};
226  iImpl.taskArena()->execute([this, iTrans, &iImpl, weakToken, &exceptPtr]() {
227  exceptPtr = syncWait([&](WaitingTaskHolder&& iHolder) {
228  auto const& recs = esRecordsToGetFrom(iTrans);
229  auto const& items = esItemsToGetFrom(iTrans);
230  auto hWaitTask = std::move(iHolder);
231  auto token = weakToken.lock();
232  for (size_t i = 0; i != items.size(); ++i) {
233  if (recs[i] != ESRecordIndex{}) {
234  auto rec = iImpl.findImpl(recs[i]);
235  if (rec) {
236  rec->prefetchAsync(hWaitTask, items[i], &iImpl, token, ESParentContext(&moduleCallingContext_));
237  }
238  }
239  }
240  }); //syncWait
241  }); //esTaskArena().execute
242  //note use of a copy gets around declaring the lambda as mutable
243  auto tempTask = task;
244  tempTask.doneWaiting(exceptPtr);
245  }); //group.run
246  } else {
247  auto group = iTask.group();
248  //We need iTask to run in the default arena since it is not an ES task
249  auto task = make_waiting_task(
250  [holder = WaitingTaskWithArenaHolder(std::move(iTask))](std::exception_ptr const* iExcept) mutable {
251  if (iExcept) {
252  holder.doneWaiting(*iExcept);
253  } else {
254  holder.doneWaiting(std::exception_ptr{});
255  }
256  });
257 
258  WaitingTaskHolder tempH(*group, task);
259  iImpl.taskArena()->execute([&]() {
260  for (size_t i = 0; i != items.size(); ++i) {
261  if (recs[i] != ESRecordIndex{}) {
262  auto rec = iImpl.findImpl(recs[i]);
263  if (rec) {
264  rec->prefetchAsync(tempH, items[i], &iImpl, iToken, ESParentContext(&moduleCallingContext_));
265  }
266  }
267  }
268  });
269  }
270  }
std::exception_ptr syncWait(F &&iFunc)
assert(be >=bs)
virtual std::vector< ESProxyIndex > const & esItemsToGetFrom(Transition) const =0
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
virtual std::vector< ESRecordIndex > const & esRecordsToGetFrom(Transition) const =0
def move
Definition: eostools.py:511
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
tuple group
Definition: watchdog.py:82
#define UNLIKELY(x)
Definition: Likely.h:21
virtual std::vector<ESRecordIndex> const& edm::Worker::esRecordsToGetFrom ( Transition  ) const
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by esPrefetchAsync().

virtual SerialTaskQueue* edm::Worker::globalLuminosityBlocksQueue ( )
pure virtual
virtual SerialTaskQueue* edm::Worker::globalRunsQueue ( )
pure virtual
std::exception_ptr edm::Worker::handleExternalWorkException ( std::exception_ptr const *  iEPtr,
ParentContext const &  parentContext 
)
private

Definition at line 440 of file Worker.cc.

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

441  {
443  try {
444  convertException::wrap([iEPtr]() { std::rethrow_exception(*iEPtr); });
445  } catch (cms::Exception& ex) {
446  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
448  return std::current_exception();
449  }
450  }
451  return *iEPtr;
452  }
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
bool ranAcquireWithoutException_
Definition: Worker.h:587
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
auto wrap(F iFunc) -> decltype(iFunc())
virtual bool edm::Worker::hasAccumulator ( ) const
pure virtual
virtual bool edm::Worker::hasAcquire ( ) const
privatepure virtual
virtual void edm::Worker::implBeginJob ( )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by beginJob().

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

Implemented in edm::WorkerT< T >.

Referenced by beginStream().

virtual bool edm::Worker::implDo ( EventTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual
virtual bool edm::Worker::implDoAccessInputProcessBlock ( ProcessBlockPrincipal const &  ,
ModuleCallingContext const *   
)
protectedpure virtual
virtual void edm::Worker::implDoAcquire ( EventTransitionInfo const &  ,
ModuleCallingContext const *  ,
WaitingTaskWithArenaHolder  
)
protectedpure virtual
virtual bool edm::Worker::implDoBegin ( RunTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual
virtual bool edm::Worker::implDoBegin ( LumiTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

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

Implemented in edm::WorkerT< T >.

virtual bool edm::Worker::implDoEndProcessBlock ( ProcessBlockPrincipal const &  ,
ModuleCallingContext const *   
)
protectedpure virtual
virtual bool edm::Worker::implDoPrePrefetchSelection ( StreamID  ,
EventPrincipal const &  ,
ModuleCallingContext const *   
)
protectedpure virtual
virtual bool edm::Worker::implDoStreamBegin ( StreamID  ,
RunTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual
virtual bool edm::Worker::implDoStreamBegin ( StreamID  ,
LumiTransitionInfo const &  ,
ModuleCallingContext const *   
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

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

Implemented in edm::WorkerT< T >.

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

Implemented in edm::WorkerT< T >.

Referenced by endJob().

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

Implemented in edm::WorkerT< T >.

Referenced by endStream().

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

Implemented in edm::WorkerT< T >.

Referenced by registerThinnedAssociations().

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

Implemented in edm::WorkerT< T >.

Referenced by respondToCloseInputFile().

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

Implemented in edm::WorkerT< T >.

Referenced by respondToCloseOutputFile().

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

Implemented in edm::WorkerT< T >.

Referenced by respondToOpenInputFile().

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

Implemented in edm::WorkerT< T >.

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

Implemented in edm::WorkerT< T >.

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

Implemented in edm::WorkerT< T >.

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

Implemented in edm::WorkerT< T >.

Referenced by edPrefetchAsync().

virtual ConcurrencyTypes edm::Worker::moduleConcurrencyType ( ) const
pure virtual
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 >.

virtual Types edm::Worker::moduleType ( ) const
pure virtual
bool edm::Worker::needsESPrefetching ( Transition  iTrans) const
inlineprivatenoexcept

Definition at line 345 of file Worker.h.

References esItemsToGetFrom(), and edm::NumberOfEventSetupTransitions.

Referenced by doWorkNoPrefetchingAsync().

345  {
346  return iTrans < edm::Transition::NumberOfEventSetupTransitions ? not esItemsToGetFrom(iTrans).empty() : false;
347  }
virtual std::vector< ESProxyIndex > const & esItemsToGetFrom(Transition) const =0
Worker& edm::Worker::operator= ( Worker const &  )
delete
void edm::Worker::postDoEvent ( EventPrincipal const &  iEvent)

Definition at line 394 of file Worker.cc.

References earlyDeleteHelper_.

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

394  {
395  if (earlyDeleteHelper_) {
396  earlyDeleteHelper_->moduleRan(iEvent);
397  }
398  }
int iEvent
Definition: GenABIO.cc:224
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:583
virtual void edm::Worker::preActionBeforeRunEventAsync ( WaitingTaskHolder  iTask,
ModuleCallingContext const &  moduleCallingContext,
Principal const &  iPrincipal 
) const
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by 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 909 of file Worker.h.

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

913  {
914  Principal const& principal = transitionInfo.principal();
915 
917 
918  if (principal.branchType() == InEvent) {
919  actReg_->preModuleEventPrefetchingSignal_.emit(*moduleCallingContext_.getStreamContext(), moduleCallingContext_);
920  }
921 
922  workerhelper::CallImpl<T>::esPrefetchAsync(this, iTask, token, transitionInfo, iTransition);
923  edPrefetchAsync(iTask, token, principal);
924 
925  if (principal.branchType() == InEvent) {
927  }
928  }
virtual void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const &moduleCallingContext, Principal const &iPrincipal) const =0
StreamContext const * getStreamContext() const
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
void edPrefetchAsync(WaitingTaskHolder, ServiceToken const &, Principal const &) const
Definition: Worker.cc:272
void edm::Worker::prePrefetchSelectionAsync ( tbb::task_group &  group,
WaitingTask task,
ServiceToken const &  token,
StreamID  stream,
EventPrincipal const *  iPrincipal 
)

Definition at line 152 of file Worker.cc.

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().

156  {
157  successTask->increment_ref_count();
158 
159  ServiceWeakToken weakToken = token;
160  auto choiceTask =
161  edm::make_waiting_task([id, successTask, iPrincipal, this, weakToken, &group](std::exception_ptr const*) {
162  ServiceRegistry::Operate guard(weakToken.lock());
163  // There is no reasonable place to rethrow, and implDoPrePrefetchSelection() should not throw in the first place.
164  CMS_SA_ALLOW try {
165  if (not implDoPrePrefetchSelection(id, *iPrincipal, &moduleCallingContext_)) {
166  timesRun_.fetch_add(1, std::memory_order_relaxed);
167  setPassed<true>();
168  waitingTasks_.doneWaiting(nullptr);
169  //TBB requires that destroyed tasks have count 0
170  if (0 == successTask->decrement_ref_count()) {
171  TaskSentry s(successTask);
172  }
173  return;
174  }
175  } catch (...) {
176  }
177  if (0 == successTask->decrement_ref_count()) {
178  group.run([successTask]() {
179  TaskSentry s(successTask);
180  successTask->execute();
181  });
182  }
183  });
184 
185  WaitingTaskHolder choiceHolder{group, choiceTask};
186 
187  std::vector<ProductResolverIndexAndSkipBit> items;
188  itemsToGetForSelection(items);
189 
190  for (auto const& item : items) {
191  ProductResolverIndex productResolverIndex = item.productResolverIndex();
192  bool skipCurrentProcess = item.skipCurrentProcess();
193  if (productResolverIndex != ProductResolverIndexAmbiguous) {
194  iPrincipal->prefetchAsync(
195  choiceHolder, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
196  }
197  }
198  choiceHolder.doneWaiting(std::exception_ptr{});
199  }
#define CMS_SA_ALLOW
unsigned int ProductResolverIndex
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
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:585
virtual void itemsToGetForSelection(std::vector< ProductResolverIndexAndSkipBit > &) const =0
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
tuple group
Definition: watchdog.py:82
std::atomic< int > timesRun_
Definition: Worker.h:567
void edm::Worker::prePrefetchSelectionAsync ( tbb::task_group &  ,
WaitingTask task,
ServiceToken const &  ,
StreamID  stream,
void const *   
)
inline

Definition at line 140 of file Worker.h.

References cms::cuda::assert().

141  {
142  assert(false);
143  }
assert(be >=bs)
void edm::Worker::registerThinnedAssociations ( ProductRegistry const &  registry,
ThinnedAssociationsHelper helper 
)

Definition at line 376 of file Worker.cc.

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

376  {
377  try {
378  implRegisterThinnedAssociations(registry, helper);
379  } catch (cms::Exception& ex) {
380  ex.addContext("Calling registerThinnedAssociations() for module " + description()->moduleLabel());
381  throw ex;
382  }
383  }
ModuleDescription const * description() const
Definition: Worker.h:188
virtual void implRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)=0
void addContext(std::string const &context)
Definition: Exception.cc:165
void edm::Worker::reset ( void  )
inline

Definition at line 178 of file Worker.h.

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

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

178  {
179  cached_exception_ = std::exception_ptr();
180  state_ = Ready;
182  workStarted_ = false;
184  }
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:574
std::atomic< bool > workStarted_
Definition: Worker.h:586
void reset()
Resets access to the resource so that added tasks will wait.
std::exception_ptr cached_exception_
Definition: Worker.h:579
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:585
std::atomic< State > state_
Definition: Worker.h:572
int numberOfPathsOn_
Definition: Worker.h:573
void edm::Worker::resetModuleDescription ( ModuleDescription const *  iDesc)
protected
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 >.

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

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

Definition at line 174 of file Worker.h.

References implRespondToCloseInputFile().

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

virtual void implRespondToCloseInputFile(FileBlock const &fb)=0
void edm::Worker::respondToCloseOutputFile ( )
inline

Definition at line 175 of file Worker.h.

References implRespondToCloseOutputFile().

virtual void implRespondToCloseOutputFile()=0
void edm::Worker::respondToOpenInputFile ( FileBlock const &  fb)
inline

Definition at line 173 of file Worker.h.

References implRespondToOpenInputFile().

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

virtual void implRespondToOpenInputFile(FileBlock const &fb)=0
void edm::Worker::runAcquire ( EventTransitionInfo const &  info,
ParentContext const &  parentContext,
WaitingTaskWithArenaHolder holder 
)
private

Definition at line 400 of file Worker.cc.

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

Referenced by runAcquireAfterAsyncPrefetch().

402  {
403  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
404  try {
405  convertException::wrap([&]() { this->implDoAcquire(info, &moduleCallingContext_, holder); });
406  } catch (cms::Exception& ex) {
408  if (shouldRethrowException(std::current_exception(), parentContext, true)) {
409  timesRun_.fetch_add(1, std::memory_order_relaxed);
410  throw;
411  }
412  }
413  }
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:576
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent) const
Definition: Worker.cc:112
auto wrap(F iFunc) -> decltype(iFunc())
std::atomic< int > timesRun_
Definition: Worker.h:567
void edm::Worker::runAcquireAfterAsyncPrefetch ( std::exception_ptr const *  iEPtr,
EventTransitionInfo const &  eventTransitionInfo,
ParentContext const &  parentContext,
WaitingTaskWithArenaHolder  holder 
)
private

Definition at line 415 of file Worker.cc.

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

418  {
420  std::exception_ptr exceptionPtr;
421  if (iEPtr) {
422  assert(*iEPtr);
423  if (shouldRethrowException(*iEPtr, parentContext, true)) {
424  exceptionPtr = *iEPtr;
425  }
427  } else {
428  // Caught exception is propagated via WaitingTaskWithArenaHolder
429  CMS_SA_ALLOW try {
430  runAcquire(eventTransitionInfo, parentContext, holder);
432  } catch (...) {
433  exceptionPtr = std::current_exception();
434  }
435  }
436  // It is important this is after runAcquire completely finishes
437  holder.doneWaiting(exceptionPtr);
438  }
#define CMS_SA_ALLOW
assert(be >=bs)
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
bool ranAcquireWithoutException_
Definition: Worker.h:587
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent) const
Definition: Worker.cc:112
void runAcquire(EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder &)
Definition: Worker.cc:400
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 1106 of file Worker.h.

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

1109  {
1110  //unscheduled producers should advance this
1111  //if (T::isEvent_) {
1112  // ++timesVisited_;
1113  //}
1114  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
1115  if constexpr (T::isEvent_) {
1116  timesRun_.fetch_add(1, std::memory_order_relaxed);
1117  }
1118 
1119  bool rc = true;
1120  try {
1121  convertException::wrap([&]() {
1122  rc = workerhelper::CallImpl<T>::call(
1123  this, streamID, transitionInfo, actReg_.get(), &moduleCallingContext_, context);
1124 
1125  if (rc) {
1126  setPassed<T::isEvent_>();
1127  } else {
1128  setFailed<T::isEvent_>();
1129  }
1130  });
1131  } catch (cms::Exception& ex) {
1133  if (shouldRethrowException(std::current_exception(), parentContext, T::isEvent_)) {
1135  setException<T::isEvent_>(std::current_exception());
1136  std::rethrow_exception(cached_exception_);
1137  } else {
1138  rc = setPassed<T::isEvent_>();
1139  }
1140  }
1141 
1142  return rc;
1143  }
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
assert(be >=bs)
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
std::exception_ptr cached_exception_
Definition: Worker.h:579
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent) const
Definition: Worker.cc:112
auto wrap(F iFunc) -> decltype(iFunc())
std::atomic< int > timesRun_
Definition: Worker.h:567
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 1021 of file Worker.h.

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().

1025  {
1026  std::exception_ptr exceptionPtr;
1027  if (iEPtr) {
1028  assert(*iEPtr);
1029  if (shouldRethrowException(*iEPtr, parentContext, T::isEvent_)) {
1030  exceptionPtr = *iEPtr;
1031  setException<T::isEvent_>(exceptionPtr);
1032  } else {
1033  setPassed<T::isEvent_>();
1034  }
1036  } else {
1037  // Caught exception is propagated via WaitingTaskList
1038  CMS_SA_ALLOW try { runModule<T>(transitionInfo, streamID, parentContext, context); } catch (...) {
1039  exceptionPtr = std::current_exception();
1040  }
1041  }
1042  waitingTasks_.doneWaiting(exceptionPtr);
1043  return exceptionPtr;
1044  }
#define CMS_SA_ALLOW
assert(be >=bs)
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:576
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:585
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent) const
Definition: Worker.cc:112
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 1146 of file Worker.h.

References visDQMUpload::context, and timesVisited_.

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

1149  {
1150  timesVisited_.fetch_add(1, std::memory_order_relaxed);
1151  std::exception_ptr const* prefetchingException = nullptr; // null because there was no prefetching to do
1152  return runModuleAfterAsyncPrefetch<T>(prefetchingException, transitionInfo, streamID, parentContext, context);
1153  }
std::atomic< int > timesVisited_
Definition: Worker.h:568
virtual void edm::Worker::selectInputProcessBlocks ( ProductRegistry const &  ,
ProcessBlockHelperBase const &   
)
pure virtual

Implemented in edm::WorkerT< T >.

virtual TaskQueueAdaptor edm::Worker::serializeRunModule ( )
privatepure virtual
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.

References actReg_, and edm::areg.

110 { actReg_ = areg; }
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:581
areg
Definition: Schedule.cc:687
void edm::Worker::setEarlyDeleteHelper ( EarlyDeleteHelper iHelper)

Definition at line 285 of file Worker.cc.

References earlyDeleteHelper_.

285 { earlyDeleteHelper_ = iHelper; }
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:583
template<bool IS_EVENT>
std::exception_ptr edm::Worker::setException ( std::exception_ptr  iException)
inlineprivate

Definition at line 326 of file Worker.h.

References cached_exception_, Exception, state_, and timesExcept_.

326  {
327  if (IS_EVENT) {
328  timesExcept_.fetch_add(1, std::memory_order_relaxed);
329  }
330  cached_exception_ = iException; // propagate_const<T> has no reset() function
331  state_ = Exception;
332  return cached_exception_;
333  }
std::atomic< int > timesExcept_
Definition: Worker.h:571
std::exception_ptr cached_exception_
Definition: Worker.h:579
std::atomic< State > state_
Definition: Worker.h:572
template<bool IS_EVENT>
bool edm::Worker::setFailed ( )
inlineprivate

Definition at line 317 of file Worker.h.

References Fail, state_, and timesFailed_.

317  {
318  if (IS_EVENT) {
319  timesFailed_.fetch_add(1, std::memory_order_relaxed);
320  }
321  state_ = Fail;
322  return false;
323  }
std::atomic< int > timesFailed_
Definition: Worker.h:570
std::atomic< State > state_
Definition: Worker.h:572
template<bool IS_EVENT>
bool edm::Worker::setPassed ( )
inlineprivate

Definition at line 308 of file Worker.h.

References Pass, state_, and timesPassed_.

308  {
309  if (IS_EVENT) {
310  timesPassed_.fetch_add(1, std::memory_order_relaxed);
311  }
312  state_ = Pass;
313  return true;
314  }
std::atomic< State > state_
Definition: Worker.h:572
std::atomic< int > timesPassed_
Definition: Worker.h:569
bool edm::Worker::shouldRethrowException ( std::exception_ptr  iPtr,
ParentContext const &  parentContext,
bool  isEvent 
) const
private

Definition at line 112 of file Worker.cc.

References mps_fire::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().

112  {
113  // NOTE: the warning printed as a result of ignoring or failing
114  // a module will only be printed during the full true processing
115  // pass of this module
116 
117  // Get the action corresponding to this exception. However, if processing
118  // something other than an event (e.g. run, lumi) always rethrow.
119  if (not isEvent) {
120  return true;
121  }
122  try {
123  convertException::wrap([&]() { std::rethrow_exception(iPtr); });
124  } catch (cms::Exception& ex) {
126 
127  if (action == exception_actions::Rethrow) {
128  return true;
129  }
130 
131  ModuleCallingContext tempContext(description(), ModuleCallingContext::State::kInvalid, parentContext, nullptr);
132 
133  // If we are processing an endpath and the module was scheduled, treat SkipEvent or FailPath
134  // as IgnoreCompletely, so any subsequent OutputModules are still run.
135  // For unscheduled modules only treat FailPath as IgnoreCompletely but still allow SkipEvent to throw
136  ModuleCallingContext const* top_mcc = tempContext.getTopModuleCallingContext();
137  if (top_mcc->type() == ParentContext::Type::kPlaceInPath &&
138  top_mcc->placeInPathContext()->pathContext()->isEndPath()) {
139  if ((action == exception_actions::SkipEvent && tempContext.type() == ParentContext::Type::kPlaceInPath) ||
140  action == exception_actions::FailPath) {
142  }
143  }
144  if (action == exception_actions::IgnoreCompletely) {
145  edm::printCmsExceptionWarning("IgnoreCompletely", ex);
146  return false;
147  }
148  }
149  return true;
150  }
ModuleDescription const * description() const
Definition: Worker.h:188
std::string const & category() const
Definition: Exception.cc:143
exception_actions::ActionCodes find(const std::string &category) const
ExceptionToActionTable const * actions_
Definition: Worker.h:578
string action
Definition: mps_fire.py:183
auto wrap(F iFunc) -> decltype(iFunc())
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
void edm::Worker::skipOnPath ( EventPrincipal const &  iEvent)

Definition at line 385 of file Worker.cc.

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

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

385  {
386  if (earlyDeleteHelper_) {
387  earlyDeleteHelper_->pathFinished(iEvent);
388  }
389  if (0 == --numberOfPathsLeftToRun_) {
391  }
392  }
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:574
std::exception_ptr cached_exception_
Definition: Worker.h:579
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:585
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:583
State edm::Worker::state ( ) const
inline

Definition at line 237 of file Worker.h.

References state_.

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

237 { return state_; }
std::atomic< State > state_
Definition: Worker.h:572
int edm::Worker::timesExcept ( ) const
inline

Definition at line 236 of file Worker.h.

References timesExcept_.

Referenced by edm::fillWorkerSummaryAux().

236 { return timesExcept_.load(std::memory_order_acquire); }
std::atomic< int > timesExcept_
Definition: Worker.h:571
int edm::Worker::timesFailed ( ) const
inline

Definition at line 235 of file Worker.h.

References timesFailed_.

Referenced by edm::fillWorkerSummaryAux().

235 { return timesFailed_.load(std::memory_order_acquire); }
std::atomic< int > timesFailed_
Definition: Worker.h:570
int edm::Worker::timesPass ( ) const
inline

Definition at line 239 of file Worker.h.

References timesPassed().

239 { return timesPassed(); } // for backward compatibility only - to be removed soon
int timesPassed() const
Definition: Worker.h:234
int edm::Worker::timesPassed ( ) const
inline

Definition at line 234 of file Worker.h.

References timesPassed_.

Referenced by edm::fillWorkerSummaryAux(), and timesPass().

234 { return timesPassed_.load(std::memory_order_acquire); }
std::atomic< int > timesPassed_
Definition: Worker.h:569
int edm::Worker::timesRun ( ) const
inline

Definition at line 232 of file Worker.h.

References timesRun_.

Referenced by edm::fillWorkerSummaryAux().

232 { return timesRun_.load(std::memory_order_acquire); }
std::atomic< int > timesRun_
Definition: Worker.h:567
int edm::Worker::timesVisited ( ) const
inline

Definition at line 233 of file Worker.h.

References timesVisited_.

Referenced by edm::fillWorkerSummaryAux().

233 { return timesVisited_.load(std::memory_order_acquire); }
std::atomic< int > timesVisited_
Definition: Worker.h:568
virtual void edm::Worker::updateLookup ( BranchType  iBranchType,
ProductResolverIndexHelper const &   
)
pure virtual

Implemented in edm::WorkerT< T >.

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

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

Implemented in edm::WorkerT< T >.

virtual bool edm::Worker::wantsGlobalLuminosityBlocks ( ) const
pure virtual
virtual bool edm::Worker::wantsGlobalRuns ( ) const
pure virtual
virtual bool edm::Worker::wantsInputProcessBlocks ( ) const
pure virtual
virtual bool edm::Worker::wantsProcessBlocks ( ) const
pure virtual
virtual bool edm::Worker::wantsStreamLuminosityBlocks ( ) const
pure virtual
virtual bool edm::Worker::wantsStreamRuns ( ) const
pure virtual
virtual std::string edm::Worker::workerType ( ) const
protectedpure virtual

Implemented in edm::WorkerT< T >.

Friends And Related Function Documentation

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

Definition at line 245 of file Worker.h.

Member Data Documentation

ExceptionToActionTable const* edm::Worker::actions_
private

Definition at line 578 of file Worker.h.

Referenced by shouldRethrowException().

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

Definition at line 579 of file Worker.h.

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

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

Definition at line 583 of file Worker.h.

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

ModuleCallingContext edm::Worker::moduleCallingContext_
private
bool edm::Worker::moduleValid_ = true
private

Definition at line 588 of file Worker.h.

Referenced by clearModule(), and description().

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

Definition at line 574 of file Worker.h.

Referenced by reset(), and skipOnPath().

int edm::Worker::numberOfPathsOn_
private

Definition at line 573 of file Worker.h.

Referenced by addedToPath(), and reset().

bool edm::Worker::ranAcquireWithoutException_
private

Definition at line 587 of file Worker.h.

Referenced by handleExternalWorkException(), and runAcquireAfterAsyncPrefetch().

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

Definition at line 571 of file Worker.h.

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

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

Definition at line 570 of file Worker.h.

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

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

Definition at line 569 of file Worker.h.

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

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

Definition at line 567 of file Worker.h.

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

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

Definition at line 568 of file Worker.h.

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

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

Definition at line 586 of file Worker.h.

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