|
|
#include <Worker.h>
|
void | addedToPath () |
|
void | beginJob () |
|
void | beginStream (StreamID id, StreamContext &streamContext) |
|
void | callWhenDoneAsync (WaitingTask *task) |
|
void | clearCounters () |
|
virtual std::vector< ConsumesInfo > | consumesInfo () const =0 |
|
virtual void | convertCurrentProcessAlias (std::string const &processName)=0 |
|
ModuleDescription const * | descPtr () const |
|
ModuleDescription const & | description () const |
|
template<typename T > |
bool | doWork (typename T::TransitionInfoType const &, StreamID, ParentContext const &, typename T::Context const *) |
|
template<typename T > |
void | doWorkAsync (WaitingTask *, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *) |
|
template<typename T > |
void | doWorkNoPrefetchingAsync (WaitingTask *, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *) |
|
void | endJob () |
|
void | endStream (StreamID id, StreamContext &streamContext) |
|
virtual SerialTaskQueue * | globalLuminosityBlocksQueue ()=0 |
|
virtual SerialTaskQueue * | globalRunsQueue ()=0 |
|
virtual bool | hasAccumulator () const =0 |
|
virtual void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc) const =0 |
|
virtual Types | moduleType () const =0 |
|
Worker & | operator= (Worker const &)=delete |
|
void | postDoEvent (EventPrincipal const &) |
|
void | prePrefetchSelectionAsync (WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *) |
|
void | prePrefetchSelectionAsync (WaitingTask *task, ServiceToken const &, StreamID stream, void const *) |
|
void | registerThinnedAssociations (ProductRegistry const ®istry, 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 | respondToOpenInputFile (FileBlock const &fb) |
|
template<typename T > |
std::exception_ptr | runModuleDirectly (typename T::TransitionInfoType const &, StreamID, ParentContext const &, typename T::Context const *) |
|
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 () |
|
|
ActivityRegistry * | activityRegistry () |
|
virtual void | implBeginJob ()=0 |
|
virtual void | implBeginStream (StreamID)=0 |
|
virtual bool | implDo (EventTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoAccessInputProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0 |
|
virtual void | implDoAcquire (EventTransitionInfo const &, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)=0 |
|
virtual bool | implDoBegin (LumiTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoBegin (RunTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoBeginProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoEnd (LumiTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoEnd (RunTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoEndProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoPrePrefetchSelection (StreamID, EventPrincipal const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoStreamBegin (StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoStreamBegin (StreamID, RunTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoStreamEnd (StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoStreamEnd (StreamID, RunTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual void | implEndJob ()=0 |
|
virtual void | implEndStream (StreamID)=0 |
|
virtual bool | implNeedToRunSelection () const =0 |
|
virtual void | itemsToGetForSelection (std::vector< ProductResolverIndexAndSkipBit > &) const =0 |
|
void | resetModuleDescription (ModuleDescription const *) |
|
virtual std::string | workerType () const =0 |
|
|
void | edPrefetchAsync (WaitingTask *, ServiceToken const &, Principal const &) const |
|
void | emitPostModuleEventPrefetchingSignal () |
|
virtual std::vector< ESProxyIndex > const & | esItemsToGetFrom (Transition) const =0 |
|
void | esPrefetchAsync (WaitingTask *, 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 | 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 (WaitingTask *iTask, ModuleCallingContext const &moduleCallingContext, Principal const &iPrincipal) const =0 |
|
template<typename T > |
void | prefetchAsync (WaitingTask *, 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 |
|
Definition at line 88 of file Worker.h.
◆ State
Enumerator |
---|
Ready | |
Pass | |
Fail | |
Exception | |
Definition at line 90 of file Worker.h.
◆ Types
Enumerator |
---|
kAnalyzer | |
kFilter | |
kProducer | |
kOutputModule | |
Definition at line 91 of file Worker.h.
◆ Worker() [1/2]
◆ ~Worker()
◆ Worker() [2/2]
edm::Worker::Worker |
( |
Worker const & |
| ) |
|
|
delete |
◆ activityRegistry()
◆ addedToPath()
void edm::Worker::addedToPath |
( |
| ) |
|
|
inline |
◆ beginJob()
void edm::Worker::beginJob |
( |
void |
| ) |
|
◆ beginStream()
Definition at line 379 of file Worker.cc.
383 streamContext.setEventID(EventID(0, 0, 0));
387 ParentContext parentContext(&streamContext);
395 std::ostringstream ost;
References actReg_, cms::Exception::addContext(), description(), Exception, implBeginStream(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::RunIndex::invalidRunIndex(), edm::StreamContext::kBeginStream, edm::ModuleCallingContext::kRunning, moduleCallingContext_, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), edm::StreamContext::setEventID(), edm::StreamContext::setLuminosityBlockIndex(), edm::StreamContext::setRunIndex(), edm::ModuleCallingContext::setState(), edm::StreamContext::setTimestamp(), edm::StreamContext::setTransition(), state_, and edm::convertException::wrap().
◆ callWhenDoneAsync()
void edm::Worker::callWhenDoneAsync |
( |
WaitingTask * |
task | ) |
|
|
inline |
◆ clearCounters()
void edm::Worker::clearCounters |
( |
| ) |
|
|
inline |
◆ consumesInfo()
virtual std::vector<ConsumesInfo> edm::Worker::consumesInfo |
( |
| ) |
const |
|
pure virtual |
◆ convertCurrentProcessAlias()
virtual void edm::Worker::convertCurrentProcessAlias |
( |
std::string const & |
processName | ) |
|
|
pure virtual |
◆ descPtr()
◆ description()
◆ doWork()
template<typename T >
bool edm::Worker::doWork |
( |
typename T::TransitionInfoType const & |
transitionInfo, |
|
|
StreamID |
streamID, |
|
|
ParentContext const & |
parentContext, |
|
|
typename T::Context const * |
context |
|
) |
| |
Definition at line 1077 of file Worker.h.
1081 if constexpr (T::isEvent_) {
1098 bool expected =
false;
1099 if (not
workStarted_.compare_exchange_strong(expected,
true)) {
1102 waitTask->increment_ref_count();
1106 waitTask->wait_for_all();
1124 auto resetContext = [](ModuleCallingContext* iContext) {
1129 if constexpr (T::isEvent_) {
1131 if (workerhelper::CallImpl<T>::needToRunSelection(
this)) {
1133 waitTask->set_ref_count(2);
1136 waitTask->decrement_ref_count();
1137 waitTask->wait_for_all();
1153 waitTask->set_ref_count(2);
1157 waitTask->decrement_ref_count();
1158 waitTask->wait_for_all();
1160 if (waitTask->exceptionPtr() !=
nullptr) {
1162 setException<T::isEvent_>(*waitTask->exceptionPtr());
1166 setPassed<T::isEvent_>();
1174 prefetchSentry.release();
1177 queue.pushAndWait([&]() {
1181 CMS_SA_ALLOW try { rc = runModule<T>(transitionInfo, streamID, parentContext, context); }
catch (...) {
1186 CMS_SA_ALLOW try { rc = runModule<T>(transitionInfo, streamID, parentContext, context); }
catch (...) {
References actReg_, edm::WaitingTaskList::add(), cms::cuda::assert(), cached_exception_, CMS_SA_ALLOW, edm::WaitingTaskList::doneWaiting(), emitPostModuleEventPrefetchingSignal(), Exception, Fail, edm::ServiceRegistry::instance(), edm::ModuleCallingContext::kInvalid, edm::ModuleCallingContext::kPrefetching, edm::make_empty_waiting_task(), moduleCallingContext_, Pass, prePrefetchSelectionAsync(), edm::ServiceRegistry::presentToken(), createBeamHaloJobs::queue, Ready, serializeRunModule(), edm::ModuleCallingContext::setContext(), shouldRethrowException(), state(), state_, timesVisited_, waitingTasks_, and workStarted_.
Referenced by edm::UnscheduledProductResolver::resolveProduct_().
◆ doWorkAsync()
template<typename T >
void edm::Worker::doWorkAsync |
( |
WaitingTask * |
task, |
|
|
typename T::TransitionInfoType const & |
transitionInfo, |
|
|
ServiceToken const & |
token, |
|
|
StreamID |
streamID, |
|
|
ParentContext const & |
parentContext, |
|
|
typename T::Context const * |
context |
|
) |
| |
Definition at line 920 of file Worker.h.
926 if (not workerhelper::CallImpl<T>::wantsTransition(
this)) {
931 bool expected =
false;
932 bool workStarted =
workStarted_.compare_exchange_strong(expected,
true);
935 if constexpr (T::isEvent_) {
943 if (workerhelper::CallImpl<T>::needToRunSelection(
this)) {
946 auto runTask =
new (tbb::task::allocate_root())
947 RunModuleTask<T>(
this, transitionInfo,
token, streamID, parentContext, context);
954 auto p = m_task.load();
956 tbb::task::destroy(*
p);
961 auto t = m_task.load();
962 m_task.store(
nullptr);
966 std::atomic<edm::WaitingTask*> m_task;
969 auto ownRunTask = std::make_shared<DestroyTask>(runTask);
971 tbb::task::allocate_root(),
972 [ownRunTask, parentContext,
info = transitionInfo,
token,
this](std::exception_ptr
const*)
mutable {
974 prefetchAsync<T>(ownRunTask->release(),
token, parentContext,
info, T::transition_);
978 WaitingTask* moduleTask =
new (tbb::task::allocate_root())
979 RunModuleTask<T>(
this, transitionInfo,
token, streamID, parentContext, context);
980 if constexpr (T::isEvent_) {
982 WaitingTaskWithArenaHolder runTaskHolder(
983 new (tbb::task::allocate_root()) HandleExternalWorkExceptionTask(
this, moduleTask, parentContext));
984 moduleTask =
new (tbb::task::allocate_root())
985 AcquireTask<T>(
this, transitionInfo,
token, parentContext,
std::move(runTaskHolder));
988 prefetchAsync<T>(moduleTask,
token, parentContext, transitionInfo, T::transition_);
References edm::WaitingTaskList::add(), hasAcquire(), info(), edm::ModuleCallingContext::kPrefetching, edm::make_waiting_task(), moduleCallingContext_, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, prePrefetchSelectionAsync(), fetchall_from_DQM_v2::release, edm::ModuleCallingContext::setContext(), submitPVValidationJobs::t, TrackValidation_cff::task, timesVisited_, unpackBuffers-CaloStage2::token, waitingTasks_, and workStarted_.
Referenced by edm::UnscheduledProductResolver::prefetchAsync_(), and edm::WorkerInPath::runWorkerAsync().
◆ doWorkNoPrefetchingAsync()
template<typename T >
void edm::Worker::doWorkNoPrefetchingAsync |
( |
WaitingTask * |
task, |
|
|
typename T::TransitionInfoType const & |
transitionInfo, |
|
|
ServiceToken const & |
serviceToken, |
|
|
StreamID |
streamID, |
|
|
ParentContext const & |
parentContext, |
|
|
typename T::Context const * |
context |
|
) |
| |
Definition at line 1020 of file Worker.h.
1026 if (not workerhelper::CallImpl<T>::wantsTransition(
this)) {
1031 bool expected =
false;
1032 auto workStarted =
workStarted_.compare_exchange_strong(expected,
true);
1036 auto toDo = [
this,
info = transitionInfo, streamID, parentContext, context, serviceToken]() {
1037 std::exception_ptr exceptionPtr;
1043 this->runModule<T>(
info, streamID, parentContext, context);
1045 exceptionPtr = std::current_exception();
1052 tbb::task::allocate_root(), [toDo =
std::move(toDo),
this](std::exception_ptr
const* iExcept) {
1060 tbb::task::spawn(*taskToDo);
1064 esPrefetchAsync(afterPrefetch, transitionInfo.eventSetupImpl(), T::transition_, serviceToken);
1070 tbb::task::spawn(*taskToDo);
References edm::WaitingTaskList::add(), CMS_SA_ALLOW, edm::WaitingTaskList::doneWaiting(), esPrefetchAsync(), info(), edm::make_functor_task(), edm::make_waiting_task(), eostools::move(), needsESPrefetching(), createBeamHaloJobs::queue, serializeRunModule(), TrackValidation_cff::task, waitingTasks_, and workStarted_.
Referenced by edm::WorkerInPath::runWorkerAsync().
◆ edPrefetchAsync()
◆ emitPostModuleEventPrefetchingSignal()
void edm::Worker::emitPostModuleEventPrefetchingSignal |
( |
| ) |
|
|
inlineprivate |
◆ endJob()
void edm::Worker::endJob |
( |
void |
| ) |
|
◆ endStream()
Definition at line 403 of file Worker.cc.
407 streamContext.setEventID(EventID(0, 0, 0));
411 ParentContext parentContext(&streamContext);
419 std::ostringstream ost;
References actReg_, cms::Exception::addContext(), description(), Exception, implEndStream(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::RunIndex::invalidRunIndex(), edm::StreamContext::kEndStream, edm::ModuleCallingContext::kRunning, moduleCallingContext_, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), edm::StreamContext::setEventID(), edm::StreamContext::setLuminosityBlockIndex(), edm::StreamContext::setRunIndex(), edm::ModuleCallingContext::setState(), edm::StreamContext::setTimestamp(), edm::StreamContext::setTransition(), state_, and edm::convertException::wrap().
◆ esItemsToGetFrom()
◆ esPrefetchAsync()
Definition at line 247 of file Worker.cc.
267 if UNLIKELY (tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism) == 1) {
269 tbb::task_arena edArena(tbb::task_arena::attach{});
277 waitTask->set_ref_count(2);
278 for (
size_t i = 0;
i !=
items.size(); ++
i) {
280 auto rec = iImpl.findImpl(recs[
i]);
282 rec->prefetchAsync(waitTask.get(),
items[
i], &iImpl, iToken);
286 waitTask->decrement_ref_count();
287 waitTask->wait_for_all();
289 auto exPtr = waitTask->exceptionPtr();
290 tbb::task_arena(edArena).execute([
task, exPtr]() {
293 t.doneWaiting(*exPtr);
295 t.doneWaiting(std::exception_ptr{});
304 [holder = WaitingTaskWithArenaHolder{iTask}](std::exception_ptr
const* iExcept)
mutable {
306 holder.doneWaiting(*iExcept);
308 holder.doneWaiting(std::exception_ptr{});
314 for (
size_t i = 0;
i !=
items.size(); ++
i) {
316 auto rec = iImpl.findImpl(recs[
i]);
318 rec->prefetchAsync(
task,
items[
i], &iImpl, iToken);
References cms::cuda::assert(), esItemsToGetFrom(), esRecordsToGetFrom(), edm::esTaskArena(), edm::EventSetupImpl::findImpl(), mps_fire::i, mps_monitormerge::items, edm::make_empty_waiting_task(), edm::make_functor_task(), edm::make_waiting_task(), eostools::move(), edm::NumberOfEventSetupTransitions, edm::eventsetup::EventSetupRecordImpl::prefetchAsync(), submitPVValidationJobs::t, TrackValidation_cff::task, and UNLIKELY.
Referenced by doWorkNoPrefetchingAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::esPrefetchAsync(), and edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > >::esPrefetchAsync().
◆ esRecordsToGetFrom()
◆ exceptionContext()
Definition at line 112 of file Worker.cc.
113 ModuleCallingContext
const* imcc = mcc;
115 std::ostringstream iost;
117 iost <<
"Prefetching for module ";
119 iost <<
"Calling method for module ";
121 iost << imcc->moduleDescription()->moduleName() <<
"/'" << imcc->moduleDescription()->moduleLabel() <<
"'";
124 iost <<
" (probably inside some kind of mixing module)";
125 imcc = imcc->internalContext()->moduleCallingContext();
127 imcc = imcc->moduleCallingContext();
131 std::ostringstream ost;
133 ost <<
"Prefetching for module ";
135 ost <<
"Calling method for module ";
137 ost << imcc->moduleDescription()->moduleName() <<
"/'" << imcc->moduleDescription()->moduleLabel() <<
"'";
142 ost <<
"Running path '";
143 ost << imcc->placeInPathContext()->pathContext()->pathName() <<
"'";
145 auto streamContext = imcc->placeInPathContext()->pathContext()->streamContext();
References cms::Exception::addContext(), edm::exceptionContext(), edm::ModuleCallingContext::globalContext(), edm::ModuleCallingContext::internalContext(), edm::ParentContext::kGlobal, edm::ParentContext::kInternal, edm::ParentContext::kModule, edm::ParentContext::kPlaceInPath, edm::ModuleCallingContext::kPrefetching, edm::ParentContext::kStream, edm::InternalContext::moduleCallingContext(), edm::ModuleCallingContext::moduleCallingContext(), edm::ModuleCallingContext::moduleDescription(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), or, edm::PlaceInPathContext::pathContext(), edm::PathContext::pathName(), edm::ModuleCallingContext::placeInPathContext(), edm::ModuleCallingContext::state(), edm::PathContext::streamContext(), edm::ModuleCallingContext::streamContext(), and edm::ModuleCallingContext::type().
Referenced by handleExternalWorkException(), runAcquire(), and runModule().
◆ globalLuminosityBlocksQueue()
Implemented in edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, and edm::WorkerT< T >.
Referenced by edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::enableGlobalQueue(), and edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::pauseGlobalQueue().
◆ globalRunsQueue()
Implemented in edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, and edm::WorkerT< T >.
Referenced by edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::enableGlobalQueue(), and edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::pauseGlobalQueue().
◆ handleExternalWorkException()
std::exception_ptr edm::Worker::handleExternalWorkException |
( |
std::exception_ptr const * |
iEPtr, |
|
|
ParentContext const & |
parentContext |
|
) |
| |
|
private |
◆ hasAccumulator()
virtual bool edm::Worker::hasAccumulator |
( |
| ) |
const |
|
pure virtual |
◆ hasAcquire()
virtual bool edm::Worker::hasAcquire |
( |
| ) |
const |
|
privatepure virtual |
◆ implBeginJob()
virtual void edm::Worker::implBeginJob |
( |
| ) |
|
|
protectedpure virtual |
◆ implBeginStream()
virtual void edm::Worker::implBeginStream |
( |
StreamID |
| ) |
|
|
protectedpure virtual |
◆ implDo()
◆ implDoAccessInputProcessBlock()
◆ implDoAcquire()
◆ implDoBegin() [1/2]
◆ implDoBegin() [2/2]
◆ implDoBeginProcessBlock()
◆ implDoEnd() [1/2]
◆ implDoEnd() [2/2]
◆ implDoEndProcessBlock()
◆ implDoPrePrefetchSelection()
◆ implDoStreamBegin() [1/2]
◆ implDoStreamBegin() [2/2]
◆ implDoStreamEnd() [1/2]
◆ implDoStreamEnd() [2/2]
◆ implEndJob()
virtual void edm::Worker::implEndJob |
( |
| ) |
|
|
protectedpure virtual |
◆ implEndStream()
virtual void edm::Worker::implEndStream |
( |
StreamID |
| ) |
|
|
protectedpure virtual |
◆ implNeedToRunSelection()
virtual bool edm::Worker::implNeedToRunSelection |
( |
| ) |
const |
|
protectedpure virtual |
◆ implRegisterThinnedAssociations()
◆ implRespondToCloseInputFile()
virtual void edm::Worker::implRespondToCloseInputFile |
( |
FileBlock const & |
fb | ) |
|
|
privatepure virtual |
◆ implRespondToOpenInputFile()
virtual void edm::Worker::implRespondToOpenInputFile |
( |
FileBlock const & |
fb | ) |
|
|
privatepure virtual |
◆ itemsMayGet()
◆ itemsShouldPutInEvent()
◆ itemsToGet()
◆ itemsToGetForSelection()
◆ itemsToGetFrom()
◆ modulesWhoseProductsAreConsumed()
◆ moduleType()
virtual Types edm::Worker::moduleType |
( |
| ) |
const |
|
pure virtual |
Implemented in edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, and edm::WorkerT< T >.
Referenced by edm::WorkerManager::addToUnscheduledWorkers(), and edm::StreamSchedule::fillWorkers().
◆ needsESPrefetching()
bool edm::Worker::needsESPrefetching |
( |
Transition |
iTrans | ) |
const |
|
inlineprivatenoexcept |
◆ operator=()
◆ postDoEvent()
◆ preActionBeforeRunEventAsync()
◆ prefetchAsync()
Definition at line 890 of file Worker.h.
895 Principal
const& principal = transitionInfo.principal();
899 if (principal.branchType() ==
InEvent) {
904 iTask->increment_ref_count();
906 workerhelper::CallImpl<T>::esPrefetchAsync(
this, iTask,
token, transitionInfo, iTransition);
909 if (principal.branchType() ==
InEvent) {
913 if (0 == iTask->decrement_ref_count()) {
915 tbb::task::spawn(*iTask);
References actReg_, edm::Principal::branchType(), edPrefetchAsync(), edm::ModuleCallingContext::getStreamContext(), edm::InEvent, edm::ModuleCallingContext::kPrefetching, moduleCallingContext_, preActionBeforeRunEventAsync(), edm::ModuleCallingContext::setContext(), and unpackBuffers-CaloStage2::token.
◆ prePrefetchSelectionAsync() [1/2]
Definition at line 204 of file Worker.cc.
208 successTask->increment_ref_count();
211 tbb::task::allocate_root(), [
id, successTask, iPrincipal,
this,
token](std::exception_ptr
const*) {
216 timesRun_.fetch_add(1, std::memory_order_relaxed);
220 if (0 == successTask->decrement_ref_count()) {
221 tbb::task::destroy(*successTask);
227 if (0 == successTask->decrement_ref_count()) {
228 tbb::task::spawn(*successTask);
234 std::vector<ProductResolverIndexAndSkipBit>
items;
239 bool skipCurrentProcess =
item.skipCurrentProcess();
244 choiceHolder.doneWaiting(std::exception_ptr{});
References CMS_SA_ALLOW, edm::WaitingTaskList::doneWaiting(), implDoPrePrefetchSelection(), B2GTnPMonitor_cfi::item, mps_monitormerge::items, itemsToGetForSelection(), edm::make_waiting_task(), moduleCallingContext_, edm::Principal::prefetchAsync(), edm::ProductResolverIndexAmbiguous, timesRun_, unpackBuffers-CaloStage2::token, and waitingTasks_.
Referenced by doWork(), and doWorkAsync().
◆ prePrefetchSelectionAsync() [2/2]
◆ registerThinnedAssociations()
◆ reset()
void edm::Worker::reset |
( |
void |
| ) |
|
|
inline |
◆ resetModuleDescription()
◆ resolvePutIndicies()
◆ respondToCloseInputFile()
void edm::Worker::respondToCloseInputFile |
( |
FileBlock const & |
fb | ) |
|
|
inline |
◆ respondToOpenInputFile()
void edm::Worker::respondToOpenInputFile |
( |
FileBlock const & |
fb | ) |
|
|
inline |
◆ runAcquire()
◆ runAcquireAfterAsyncPrefetch()
Definition at line 466 of file Worker.cc.
471 std::exception_ptr exceptionPtr;
475 exceptionPtr = *iEPtr;
481 runAcquire(eventTransitionInfo, parentContext, holder);
484 exceptionPtr = std::current_exception();
488 holder.doneWaiting(exceptionPtr);
References cms::cuda::assert(), CMS_SA_ALLOW, edm::WaitingTaskWithArenaHolder::doneWaiting(), edm::ModuleCallingContext::kInvalid, moduleCallingContext_, ranAcquireWithoutException_, runAcquire(), edm::ModuleCallingContext::setContext(), and shouldRethrowException().
◆ runModule()
template<typename T >
bool edm::Worker::runModule |
( |
typename T::TransitionInfoType const & |
transitionInfo, |
|
|
StreamID |
streamID, |
|
|
ParentContext const & |
parentContext, |
|
|
typename T::Context const * |
context |
|
) |
| |
|
private |
◆ runModuleAfterAsyncPrefetch()
template<typename T >
std::exception_ptr edm::Worker::runModuleAfterAsyncPrefetch |
( |
std::exception_ptr const * |
iEPtr, |
|
|
typename T::TransitionInfoType const & |
transitionInfo, |
|
|
StreamID |
streamID, |
|
|
ParentContext const & |
parentContext, |
|
|
typename T::Context const * |
context |
|
) |
| |
|
private |
Definition at line 994 of file Worker.h.
999 std::exception_ptr exceptionPtr;
1003 exceptionPtr = *iEPtr;
1004 setException<T::isEvent_>(exceptionPtr);
1006 setPassed<T::isEvent_>();
1011 CMS_SA_ALLOW try { runModule<T>(transitionInfo, streamID, parentContext, context); }
catch (...) {
1012 exceptionPtr = std::current_exception();
1016 return exceptionPtr;
References cms::cuda::assert(), CMS_SA_ALLOW, edm::WaitingTaskList::doneWaiting(), edm::ModuleCallingContext::kInvalid, moduleCallingContext_, edm::ModuleCallingContext::setContext(), shouldRethrowException(), and waitingTasks_.
Referenced by edm::Worker::RunModuleTask< T >::execute().
◆ runModuleDirectly()
template<typename T >
std::exception_ptr edm::Worker::runModuleDirectly |
( |
typename T::TransitionInfoType const & |
transitionInfo, |
|
|
StreamID |
streamID, |
|
|
ParentContext const & |
parentContext, |
|
|
typename T::Context const * |
context |
|
) |
| |
Definition at line 1239 of file Worker.h.
1244 std::exception_ptr
const* prefetchingException =
nullptr;
1245 return runModuleAfterAsyncPrefetch<T>(prefetchingException, transitionInfo, streamID, parentContext, context);
References timesVisited_.
Referenced by edm::Path::finished().
◆ serializeRunModule()
Implemented in edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, edm::WorkerT< T >, and edm::WorkerT< T >.
Referenced by doWork(), doWorkNoPrefetchingAsync(), and edm::Worker::RunModuleTask< T >::execute().
◆ setActivityRegistry()
void edm::Worker::setActivityRegistry |
( |
std::shared_ptr< ActivityRegistry > |
areg | ) |
|
The signals are required to live longer than the last call to 'doWork' this was done to improve performance based on profiling
Definition at line 110 of file Worker.cc.
References actReg_.
◆ setEarlyDeleteHelper()
◆ setException()
template<bool IS_EVENT>
std::exception_ptr edm::Worker::setException |
( |
std::exception_ptr |
iException | ) |
|
|
inlineprivate |
◆ setFailed()
template<bool IS_EVENT>
bool edm::Worker::setFailed |
( |
| ) |
|
|
inlineprivate |
◆ setPassed()
template<bool IS_EVENT>
bool edm::Worker::setPassed |
( |
| ) |
|
|
inlineprivate |
◆ shouldRethrowException()
bool edm::Worker::shouldRethrowException |
( |
std::exception_ptr |
iPtr, |
|
|
ParentContext const & |
parentContext, |
|
|
bool |
isEvent |
|
) |
| const |
|
private |
Definition at line 164 of file Worker.cc.
188 ModuleCallingContext
const* top_mcc = tempContext.getTopModuleCallingContext();
190 top_mcc->placeInPathContext()->pathContext()->isEndPath()) {
References writedatasetfile::action, actions_, cms::Exception::category(), description(), edm::exception_actions::FailPath, edm::ExceptionToActionTable::find(), edm::ModuleCallingContext::getTopModuleCallingContext(), edm::exception_actions::IgnoreCompletely, edm::PathContext::isEndPath(), edm::ModuleCallingContext::kInvalid, edm::ParentContext::kPlaceInPath, edm::PlaceInPathContext::pathContext(), edm::ModuleCallingContext::placeInPathContext(), edm::printCmsExceptionWarning(), edm::exception_actions::Rethrow, edm::exception_actions::SkipEvent, edm::ModuleCallingContext::type(), and edm::convertException::wrap().
Referenced by doWork(), runAcquire(), runAcquireAfterAsyncPrefetch(), runModule(), and runModuleAfterAsyncPrefetch().
◆ skipOnPath()
◆ state()
State edm::Worker::state |
( |
| ) |
const |
|
inline |
◆ timesExcept()
int edm::Worker::timesExcept |
( |
| ) |
const |
|
inline |
◆ timesFailed()
int edm::Worker::timesFailed |
( |
| ) |
const |
|
inline |
◆ timesPass()
int edm::Worker::timesPass |
( |
| ) |
const |
|
inline |
◆ timesPassed()
int edm::Worker::timesPassed |
( |
| ) |
const |
|
inline |
◆ timesRun()
int edm::Worker::timesRun |
( |
| ) |
const |
|
inline |
◆ timesVisited()
int edm::Worker::timesVisited |
( |
| ) |
const |
|
inline |
◆ updateLookup() [1/2]
◆ updateLookup() [2/2]
◆ wantsGlobalLuminosityBlocks()
virtual bool edm::Worker::wantsGlobalLuminosityBlocks |
( |
| ) |
const |
|
pure virtual |
◆ wantsGlobalRuns()
virtual bool edm::Worker::wantsGlobalRuns |
( |
| ) |
const |
|
pure virtual |
◆ wantsInputProcessBlocks()
virtual bool edm::Worker::wantsInputProcessBlocks |
( |
| ) |
const |
|
pure virtual |
◆ wantsProcessBlocks()
virtual bool edm::Worker::wantsProcessBlocks |
( |
| ) |
const |
|
pure virtual |
◆ wantsStreamLuminosityBlocks()
virtual bool edm::Worker::wantsStreamLuminosityBlocks |
( |
| ) |
const |
|
pure virtual |
◆ wantsStreamRuns()
virtual bool edm::Worker::wantsStreamRuns |
( |
| ) |
const |
|
pure virtual |
◆ workerType()
virtual std::string edm::Worker::workerType |
( |
| ) |
const |
|
protectedpure virtual |
◆ workerhelper::CallImpl
◆ actions_
◆ actReg_
◆ cached_exception_
std::exception_ptr edm::Worker::cached_exception_ |
|
private |
◆ earlyDeleteHelper_
◆ moduleCallingContext_
Definition at line 558 of file Worker.h.
Referenced by beginStream(), descPtr(), description(), doWork(), doWorkAsync(), edPrefetchAsync(), emitPostModuleEventPrefetchingSignal(), endStream(), handleExternalWorkException(), prefetchAsync(), prePrefetchSelectionAsync(), resetModuleDescription(), runAcquire(), runAcquireAfterAsyncPrefetch(), runModule(), and runModuleAfterAsyncPrefetch().
◆ numberOfPathsLeftToRun_
std::atomic<int> edm::Worker::numberOfPathsLeftToRun_ |
|
private |
◆ numberOfPathsOn_
int edm::Worker::numberOfPathsOn_ |
|
private |
◆ ranAcquireWithoutException_
bool edm::Worker::ranAcquireWithoutException_ |
|
private |
◆ state_
std::atomic<State> edm::Worker::state_ |
|
private |
◆ timesExcept_
std::atomic<int> edm::Worker::timesExcept_ |
|
private |
◆ timesFailed_
std::atomic<int> edm::Worker::timesFailed_ |
|
private |
◆ timesPassed_
std::atomic<int> edm::Worker::timesPassed_ |
|
private |
◆ timesRun_
std::atomic<int> edm::Worker::timesRun_ |
|
private |
◆ timesVisited_
std::atomic<int> edm::Worker::timesVisited_ |
|
private |
◆ waitingTasks_
◆ workStarted_
std::atomic<bool> edm::Worker::workStarted_ |
|
private |
std::string const & moduleLabel() const
virtual void itemsToGetForSelection(std::vector< ProductResolverIndexAndSkipBit > &) const =0
virtual bool implDoPrePrefetchSelection(StreamID, EventPrincipal const &, ModuleCallingContext const *)=0
void exceptionContext(std::ostream &, GlobalContext const &)
unsigned int ProductResolverIndex
void esPrefetchAsync(WaitingTask *, EventSetupImpl const &, Transition, ServiceToken const &)
void addContext(std::string const &context)
std::shared_ptr< ActivityRegistry > actReg_
virtual void implEndJob()=0
std::atomic< int > timesPassed_
virtual void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &moduleCallingContext, Principal const &iPrincipal) const =0
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
std::atomic< int > timesVisited_
void add(WaitingTask *)
Adds task to the waiting list.
std::string const & moduleName() const
ExceptionToActionTable const * actions_
virtual void implBeginJob()=0
FunctorTask< F > * make_functor_task(ALLOC &&iAlloc, F f)
std::atomic< int > numberOfPathsLeftToRun_
ModuleDescription const * moduleDescription() const
tbb::task_arena & esTaskArena()
virtual void implEndStream(StreamID)=0
std::atomic< bool > workStarted_
ParentContext const & parent() const
void reset()
Resets access to the resource so that added tasks will wait.
virtual void implRespondToCloseInputFile(FileBlock const &fb)=0
void edPrefetchAsync(WaitingTask *, ServiceToken const &, Principal const &) const
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
std::atomic< int > timesRun_
auto wrap(F iFunc) -> decltype(iFunc())
std::atomic< State > state_
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
std::atomic< int > timesExcept_
void runAcquire(EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder &)
virtual TaskQueueAdaptor serializeRunModule()=0
virtual void implDoAcquire(EventTransitionInfo const &, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)=0
edm::WaitingTaskList waitingTasks_
static LuminosityBlockIndex invalidLuminosityBlockIndex()
ModuleCallingContext const * previousModuleOnThread() const
virtual void implRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)=0
ServiceToken presentToken() const
StreamContext const * getStreamContext() const
void setState(State state)
void prePrefetchSelectionAsync(WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *)
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
bool ranAcquireWithoutException_
static void exceptionContext(cms::Exception &ex, ModuleCallingContext const *mcc)
virtual void implRespondToOpenInputFile(FileBlock const &fb)=0
ModuleCallingContext moduleCallingContext_
std::atomic< int > timesFailed_
ModuleDescription const & description() const
std::exception_ptr cached_exception_
static ServiceRegistry & instance()
static RunIndex invalidRunIndex()
bool needsESPrefetching(Transition iTrans) const noexcept
virtual std::vector< ESRecordIndex > const & esRecordsToGetFrom(Transition) const =0
std::unique_ptr< edm::EmptyWaitingTask, waitingtask::TaskDestroyer > make_empty_waiting_task()
Create an EmptyWaitingTask which will properly be destroyed.
virtual std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType) const =0
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
virtual bool hasAcquire() const =0
virtual std::vector< ESProxyIndex > const & esItemsToGetFrom(Transition) const =0
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
exception_actions::ActionCodes find(const std::string &category) const
virtual void implBeginStream(StreamID)=0
void emitPostModuleEventPrefetchingSignal()
std::string const & category() const
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent) const