|
|
#include <Worker.h>
|
enum | ConcurrencyTypes {
kGlobal,
kLimited,
kOne,
kStream,
kLegacy
} |
|
enum | State { Ready,
Pass,
Fail,
Exception
} |
|
enum | Types { kAnalyzer,
kFilter,
kProducer,
kOutputModule
} |
|
|
void | addedToPath () |
|
void | beginJob () |
|
void | beginStream (StreamID id, StreamContext &streamContext) |
|
void | callWhenDoneAsync (WaitingTaskHolder task) |
|
void | clearCounters () |
|
void | clearModule () |
|
virtual std::vector< ConsumesInfo > | consumesInfo () 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 SerialTaskQueue * | globalLuminosityBlocksQueue ()=0 |
|
virtual SerialTaskQueue * | globalRunsQueue ()=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 |
|
Worker & | operator= (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 ®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 | 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 () |
|
|
ActivityRegistry * | activityRegistry () |
|
virtual void | doClearModule ()=0 |
|
virtual void | implBeginJob ()=0 |
|
virtual void | implBeginStream (StreamID)=0 |
|
virtual bool | implDo (EventTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoAccessInputProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0 |
|
virtual void | implDoAcquire (EventTransitionInfo const &, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)=0 |
|
virtual bool | implDoBegin (LumiTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoBegin (RunTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoBeginProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoEnd (LumiTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoEnd (RunTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoEndProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoPrePrefetchSelection (StreamID, EventPrincipal const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoStreamBegin (StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoStreamBegin (StreamID, RunTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoStreamEnd (StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual bool | implDoStreamEnd (StreamID, RunTransitionInfo const &, ModuleCallingContext const *)=0 |
|
virtual void | implEndJob ()=0 |
|
virtual void | implEndStream (StreamID)=0 |
|
virtual bool | implNeedToRunSelection () const =0 |
|
virtual void | itemsToGetForSelection (std::vector< ProductResolverIndexAndSkipBit > &) const =0 |
|
void | resetModuleDescription (ModuleDescription const *) |
|
virtual std::string | workerType () const =0 |
|
|
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 |
|
Definition at line 91 of file Worker.h.
◆ ConcurrencyTypes
Enumerator |
---|
kGlobal | |
kLimited | |
kOne | |
kStream | |
kLegacy | |
Definition at line 95 of file Worker.h.
◆ State
Enumerator |
---|
Ready | |
Pass | |
Fail | |
Exception | |
Definition at line 93 of file Worker.h.
◆ Types
Enumerator |
---|
kAnalyzer | |
kFilter | |
kProducer | |
kOutputModule | |
Definition at line 94 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 380 of file Worker.cc.
384 streamContext.setEventID(EventID(0, 0, 0));
388 ParentContext parentContext(&streamContext);
396 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()
◆ clearCounters()
void edm::Worker::clearCounters |
( |
| ) |
|
|
inline |
◆ clearModule()
void edm::Worker::clearModule |
( |
| ) |
|
|
inline |
◆ consumesInfo()
virtual std::vector<ConsumesInfo> edm::Worker::consumesInfo |
( |
| ) |
const |
|
pure virtual |
◆ convertCurrentProcessAlias()
virtual void edm::Worker::convertCurrentProcessAlias |
( |
std::string const & |
processName | ) |
|
|
pure virtual |
◆ description()
◆ doClearModule()
virtual void edm::Worker::doClearModule |
( |
| ) |
|
|
protectedpure virtual |
◆ doWorkAsync()
Definition at line 933 of file Worker.h.
939 if (not workerhelper::CallImpl<T>::wantsTransition(
this)) {
944 bool expected =
false;
945 bool workStarted =
workStarted_.compare_exchange_strong(expected,
true);
948 if constexpr (T::isEvent_) {
956 if (workerhelper::CallImpl<T>::needToRunSelection(
this)) {
960 new RunModuleTask<T>(
this, transitionInfo,
token, streamID, parentContext,
context,
task.group());
967 auto p = m_task.exchange(
nullptr);
976 std::atomic<edm::WaitingTask*> m_task;
978 if constexpr (T::isEvent_) {
980 auto ownRunTask = std::make_shared<DestroyTask>(moduleTask);
981 ServiceWeakToken weakToken =
token;
984 [
this, weakToken, transitionInfo, parentContext, ownRunTask,
group](std::exception_ptr
const* iExcept) {
985 WaitingTaskWithArenaHolder runTaskHolder(
986 *
group,
new HandleExternalWorkExceptionTask(
this,
group, ownRunTask->release(), parentContext));
987 AcquireTask<T>
t(
this, transitionInfo, weakToken.lock(), parentContext, runTaskHolder);
993 auto ownModuleTask = std::make_shared<DestroyTask>(moduleTask);
994 ServiceWeakToken weakToken =
token;
997 std::exception_ptr
const*)
mutable {
1008 new RunModuleTask<T>(
this, transitionInfo,
token, streamID, parentContext,
context,
task.group());
1010 if constexpr (T::isEvent_) {
1012 WaitingTaskWithArenaHolder runTaskHolder(
1013 *
group,
new HandleExternalWorkExceptionTask(
this,
group, moduleTask, parentContext));
1014 moduleTask =
new AcquireTask<T>(
this, transitionInfo,
token, parentContext,
std::move(runTaskHolder));
References edm::WaitingTaskList::add(), visDQMUpload::context, watchdog::group, hasAcquire(), info(), edm::ModuleCallingContext::kPrefetching, edm::ServiceWeakToken::lock(), edm::make_waiting_task(), moduleCallingContext_, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, prePrefetchSelectionAsync(), fetchall_from_DQM_v2::release, alignCSCRings::s, edm::ModuleCallingContext::setContext(), submitPVValidationJobs::t, TrackValidation_cff::task, timesVisited_, unpackBuffers-CaloStage2::token, waitingTasks_, and workStarted_.
Referenced by edm::UnscheduledProductResolver::prefetchAsync_(), and edm::WorkerInPath::runWorkerAsync().
◆ doWorkNoPrefetchingAsync()
template<typename T >
void edm::Worker::doWorkNoPrefetchingAsync |
( |
WaitingTaskHolder |
task, |
|
|
typename T::TransitionInfoType const & |
transitionInfo, |
|
|
ServiceToken const & |
serviceToken, |
|
|
StreamID |
streamID, |
|
|
ParentContext const & |
parentContext, |
|
|
typename T::Context const * |
context |
|
) |
| |
Definition at line 1049 of file Worker.h.
1055 if (not workerhelper::CallImpl<T>::wantsTransition(
this)) {
1060 bool expected =
false;
1061 auto workStarted =
workStarted_.compare_exchange_strong(expected,
true);
1065 ServiceWeakToken weakToken = serviceToken;
1066 auto toDo = [
this,
info = transitionInfo, streamID, parentContext,
context, weakToken]() {
1067 std::exception_ptr exceptionPtr;
1073 this->runModule<T>(
info, streamID, parentContext,
context);
1075 exceptionPtr = std::current_exception();
1082 auto afterPrefetch =
1095 WaitingTaskHolder(*
group, afterPrefetch), transitionInfo.eventSetupImpl(), T::transition_, serviceToken);
References edm::WaitingTaskList::add(), CMS_SA_ALLOW, visDQMUpload::context, edm::WaitingTaskList::doneWaiting(), esPrefetchAsync(), watchdog::group, info(), edm::ServiceWeakToken::lock(), edm::make_waiting_task(), eostools::move(), needsESPrefetching(), createBeamHaloJobs::queue, serializeRunModule(), TrackValidation_cff::task, waitingTasks_, and workStarted_.
Referenced by edm::WorkerInPath::runWorkerAsync().
◆ edPrefetchAsync()
◆ emitPostModuleEventPrefetchingSignal()
void edm::Worker::emitPostModuleEventPrefetchingSignal |
( |
| ) |
|
|
inlineprivate |
◆ endJob()
void edm::Worker::endJob |
( |
void |
| ) |
|
Definition at line 363 of file Worker.cc.
368 ModuleEndJobSignalSentry cpp(
actReg_.get(), *
desc);
373 std::ostringstream ost;
References actReg_, cms::Exception::addContext(), cms::cuda::assert(), submitPVResolutionJobs::desc, description(), Exception, implEndJob(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), state_, and edm::convertException::wrap().
◆ endStream()
Definition at line 404 of file Worker.cc.
408 streamContext.setEventID(EventID(0, 0, 0));
412 ParentContext parentContext(&streamContext);
420 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 253 of file Worker.cc.
273 if UNLIKELY (tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism) == 1) {
274 auto taskGroup = iTask.group();
275 ServiceWeakToken weakToken = iToken;
276 taskGroup->run([
this,
task =
std::move(iTask), iTrans, &iImpl, weakToken]() {
277 std::exception_ptr exceptPtr{};
278 iImpl.taskArena()->execute([
this, iTrans, &iImpl, weakToken, &exceptPtr]() {
283 auto token = weakToken.lock();
284 for (
size_t i = 0;
i !=
items.size(); ++
i) {
286 auto rec = iImpl.findImpl(recs[
i]);
295 auto tempTask =
task;
296 tempTask.doneWaiting(exceptPtr);
299 auto group = iTask.group();
302 [holder = WaitingTaskWithArenaHolder(
std::move(iTask))](std::exception_ptr
const* iExcept)
mutable {
304 holder.doneWaiting(*iExcept);
306 holder.doneWaiting(std::exception_ptr{});
311 iImpl.taskArena()->execute([&]() {
312 for (
size_t i = 0;
i !=
items.size(); ++
i) {
314 auto rec = iImpl.findImpl(recs[
i]);
References cms::cuda::assert(), esItemsToGetFrom(), esRecordsToGetFrom(), edm::EventSetupImpl::findImpl(), edm::WaitingTaskHolder::group(), watchdog::group, mps_fire::i, mps_monitormerge::items, edm::ServiceWeakToken::lock(), edm::make_waiting_task(), moduleCallingContext_, eostools::move(), edm::NumberOfEventSetupTransitions, edm::eventsetup::EventSetupRecordImpl::prefetchAsync(), edm::syncWait(), TrackValidation_cff::task, edm::EventSetupImpl::taskArena(), unpackBuffers-CaloStage2::token, and UNLIKELY.
Referenced by doWorkNoPrefetchingAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > >::esPrefetchAsync(), edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::esPrefetchAsync(), and edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > >::esPrefetchAsync().
◆ esRecordsToGetFrom()
◆ 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 |
◆ implRespondToCloseOutputFile()
virtual void edm::Worker::implRespondToCloseOutputFile |
( |
| ) |
|
|
privatepure virtual |
◆ implRespondToOpenInputFile()
virtual void edm::Worker::implRespondToOpenInputFile |
( |
FileBlock const & |
fb | ) |
|
|
privatepure virtual |
◆ itemsMayGet()
◆ itemsShouldPutInEvent()
◆ itemsToGet()
◆ itemsToGetForSelection()
◆ itemsToGetFrom()
◆ moduleConcurrencyType()
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 >.
◆ 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 911 of file Worker.h.
916 Principal
const& principal = transitionInfo.principal();
920 if (principal.branchType() ==
InEvent) {
924 workerhelper::CallImpl<T>::esPrefetchAsync(
this, iTask,
token, transitionInfo, iTransition);
927 if (principal.branchType() ==
InEvent) {
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.
209 successTask->increment_ref_count();
211 ServiceWeakToken weakToken =
token;
218 timesRun_.fetch_add(1, std::memory_order_relaxed);
222 if (0 == successTask->decrement_ref_count()) {
223 TaskSentry
s(successTask);
229 if (0 == successTask->decrement_ref_count()) {
230 group.run([successTask]() {
231 TaskSentry
s(successTask);
232 successTask->execute();
239 std::vector<ProductResolverIndexAndSkipBit>
items;
244 bool skipCurrentProcess =
item.skipCurrentProcess();
246 iPrincipal->prefetchAsync(
250 choiceHolder.doneWaiting(std::exception_ptr{});
References CMS_SA_ALLOW, edm::TaskBase::decrement_ref_count(), edm::WaitingTaskList::doneWaiting(), edm::TaskBase::execute(), watchdog::group, implDoPrePrefetchSelection(), edm::TaskBase::increment_ref_count(), B2GTnPMonitor_cfi::item, mps_monitormerge::items, itemsToGetForSelection(), edm::ServiceWeakToken::lock(), edm::make_waiting_task(), moduleCallingContext_, edm::Principal::prefetchAsync(), edm::ProductResolverIndexAmbiguous, alignCSCRings::s, timesRun_, unpackBuffers-CaloStage2::token, and waitingTasks_.
Referenced by doWorkAsync().
◆ prePrefetchSelectionAsync() [2/2]
◆ registerThinnedAssociations()
◆ reset()
void edm::Worker::reset |
( |
void |
| ) |
|
|
inline |
◆ resetModuleDescription()
◆ resolvePutIndicies()
◆ respondToCloseInputFile()
void edm::Worker::respondToCloseInputFile |
( |
FileBlock const & |
fb | ) |
|
|
inline |
◆ respondToCloseOutputFile()
void edm::Worker::respondToCloseOutputFile |
( |
| ) |
|
|
inline |
◆ respondToOpenInputFile()
void edm::Worker::respondToOpenInputFile |
( |
FileBlock const & |
fb | ) |
|
|
inline |
◆ runAcquire()
◆ runAcquireAfterAsyncPrefetch()
Definition at line 467 of file Worker.cc.
472 std::exception_ptr exceptionPtr;
476 exceptionPtr = *iEPtr;
482 runAcquire(eventTransitionInfo, parentContext, holder);
485 exceptionPtr = std::current_exception();
489 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 1023 of file Worker.h.
1028 std::exception_ptr exceptionPtr;
1032 exceptionPtr = *iEPtr;
1033 setException<T::isEvent_>(exceptionPtr);
1035 setPassed<T::isEvent_>();
1040 CMS_SA_ALLOW try { runModule<T>(transitionInfo, streamID, parentContext,
context); }
catch (...) {
1041 exceptionPtr = std::current_exception();
1045 return exceptionPtr;
References cms::cuda::assert(), CMS_SA_ALLOW, visDQMUpload::context, edm::WaitingTaskList::doneWaiting(), edm::ModuleCallingContext::kInvalid, moduleCallingContext_, edm::ModuleCallingContext::setContext(), shouldRethrowException(), and waitingTasks_.
Referenced by edm::Worker::RunModuleTask< T >::execute().
◆ runModuleDirectly()
template<typename T >
std::exception_ptr edm::Worker::runModuleDirectly |
( |
typename T::TransitionInfoType const & |
transitionInfo, |
|
|
StreamID |
streamID, |
|
|
ParentContext const & |
parentContext, |
|
|
typename T::Context const * |
context |
|
) |
| |
◆ selectInputProcessBlocks()
◆ 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 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 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 578 of file Worker.h.
Referenced by beginStream(), description(), doWorkAsync(), edPrefetchAsync(), emitPostModuleEventPrefetchingSignal(), endStream(), esPrefetchAsync(), handleExternalWorkException(), prefetchAsync(), prePrefetchSelectionAsync(), resetModuleDescription(), runAcquire(), runAcquireAfterAsyncPrefetch(), runModule(), and runModuleAfterAsyncPrefetch().
◆ moduleValid_
bool edm::Worker::moduleValid_ = true |
|
private |
◆ 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 addContext(std::string const &context)
std::shared_ptr< ActivityRegistry > actReg_
virtual void implEndJob()=0
std::atomic< int > timesPassed_
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
std::atomic< int > timesVisited_
std::string const & moduleName() const
ExceptionToActionTable const * actions_
virtual void implBeginJob()=0
std::atomic< int > numberOfPathsLeftToRun_
ModuleDescription const * moduleDescription() const
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
ModuleDescription const * description() 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.
virtual void doClearModule()=0
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_
FunctorWaitingTask< F > * make_waiting_task(F f)
static LuminosityBlockIndex invalidLuminosityBlockIndex()
ModuleCallingContext const * previousModuleOnThread() const
virtual void implRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)=0
StreamContext const * getStreamContext() const
void setState(State state)
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_
void esPrefetchAsync(WaitingTaskHolder, EventSetupImpl const &, Transition, ServiceToken const &)
std::exception_ptr cached_exception_
static RunIndex invalidRunIndex()
bool needsESPrefetching(Transition iTrans) const noexcept
virtual std::vector< ESRecordIndex > const & esRecordsToGetFrom(Transition) const =0
virtual std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType) const =0
virtual bool hasAcquire() const =0
void add(tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
virtual void implRespondToCloseOutputFile()=0
virtual void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const &moduleCallingContext, Principal const &iPrincipal) const =0
void edPrefetchAsync(WaitingTaskHolder, ServiceToken const &, Principal const &) const
virtual std::vector< ESProxyIndex > const & esItemsToGetFrom(Transition) const =0
void prePrefetchSelectionAsync(tbb::task_group &, WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *)
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
std::exception_ptr syncWait(F &&iFunc)
std::string const & category() const
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent) const