#include <Worker.h>
Classes | |
class | RunModuleTask |
class | TransitionIDValue |
class | TransitionIDValueBase |
Public Types | |
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 (WaitingTask *task) |
void | clearCounters () |
virtual std::vector< ConsumesInfo > | consumesInfo () const =0 |
ModuleDescription const * | descPtr () const |
ModuleDescription const & | description () const |
template<typename T > | |
bool | doWork (typename T::MyPrincipal const &, EventSetup const &c, StreamID stream, ParentContext const &parentContext, typename T::Context const *context) |
template<typename T > | |
void | doWorkAsync (WaitingTask *task, typename T::MyPrincipal const &, EventSetup const &c, StreamID stream, ParentContext const &parentContext, typename T::Context const *context) |
void | endJob () |
void | endStream (StreamID id, StreamContext &streamContext) |
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 | postForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren) |
void | preForkReleaseResources () |
void | registerThinnedAssociations (ProductRegistry const ®istry, ThinnedAssociationsHelper &helper) |
void | reset () |
virtual void | resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies)=0 |
void | respondToCloseInputFile (FileBlock const &fb) |
void | respondToOpenInputFile (FileBlock const &fb) |
void | setActivityRegistry (std::shared_ptr< ActivityRegistry > areg) |
void | setEarlyDeleteHelper (EarlyDeleteHelper *iHelper) |
void | skipOnPath () |
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 |
Worker (ModuleDescription const &iMD, ExceptionToActionTable const *iActions) | |
Worker (Worker const &)=delete | |
virtual | ~Worker () |
Private Member Functions | |
void | emitPostModuleEventPrefetchingSignal () |
virtual void | implPostForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)=0 |
virtual void | implPreForkReleaseResources ()=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 & | itemsToGetFromEvent () const =0 |
void | prefetchAsync (WaitingTask *, ParentContext const &parentContext, Principal const &) |
template<typename T > | |
bool | runModule (typename T::MyPrincipal const &, EventSetup const &c, StreamID stream, ParentContext const &parentContext, typename T::Context const *context) |
template<typename T > | |
void | runModuleAfterAsyncPrefetch (std::exception_ptr const *iEPtr, typename T::MyPrincipal const &ep, EventSetup const &es, StreamID streamID, ParentContext const &parentContext, typename T::Context const *context) |
virtual SerialTaskQueueChain * | 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 (cms::Exception &ex, ParentContext const &parentContext, bool isEvent, TransitionIDValueBase const &iID) const |
Static Private Member Functions | |
static void | exceptionContext (const std::string &iID, bool iIsEvent, cms::Exception &ex, ModuleCallingContext const *mcc) |
Private Attributes | |
ExceptionToActionTable const * | actions_ |
std::shared_ptr< ActivityRegistry > | actReg_ |
std::exception_ptr | cached_exception_ |
edm::propagate_const < EarlyDeleteHelper * > | earlyDeleteHelper_ |
ModuleCallingContext | moduleCallingContext_ |
std::atomic< int > | numberOfPathsLeftToRun_ |
int | numberOfPathsOn_ |
std::atomic< State > | state_ |
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 |
enum edm::Worker::State |
Enumerator | |
---|---|
Ready | |
Pass | |
Fail | |
Exception |
enum edm::Worker::Types |
Enumerator | |
---|---|
kAnalyzer | |
kFilter | |
kProducer | |
kOutputModule |
edm::Worker::Worker | ( | ModuleDescription const & | iMD, |
ExceptionToActionTable const * | iActions | ||
) |
Definition at line 72 of file Worker.cc.
|
delete |
|
inlineprotected |
|
inline |
Definition at line 153 of file Worker.h.
References numberOfPathsOn_.
Referenced by edm::WorkerInPath::WorkerInPath().
void edm::Worker::beginJob | ( | void | ) |
Definition at line 231 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().
void edm::Worker::beginStream | ( | StreamID | id, |
StreamContext & | streamContext | ||
) |
Definition at line 263 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().
|
inline |
Definition at line 98 of file Worker.h.
References edm::WaitingTaskList::add(), and waitingTasks_.
Referenced by edm::PuttableProductResolver::prefetchAsync_().
|
inline |
Definition at line 145 of file Worker.h.
References timesExcept_, timesFailed_, timesPassed_, timesRun_, and timesVisited_.
Referenced by edm::StreamSchedule::clearCounters().
|
pure virtual |
Implemented in edm::WorkerT< T >.
Referenced by edm::PathsAndConsumesOfModules::doConsumesInfo().
|
inline |
Definition at line 124 of file Worker.h.
References moduleCallingContext_, and edm::ModuleCallingContext::moduleDescription().
|
inline |
Definition at line 123 of file Worker.h.
References moduleCallingContext_, and edm::ModuleCallingContext::moduleDescription().
Referenced by beginJob(), beginStream(), endJob(), endStream(), edm::fillModuleInPathSummary(), edm::StreamSchedule::fillWorkers(), edm::fillWorkerSummaryAux(), runModuleAfterAsyncPrefetch(), and shouldRethrowException().
bool edm::Worker::doWork | ( | typename T::MyPrincipal const & | ep, |
EventSetup const & | c, | ||
StreamID | stream, | ||
ParentContext const & | parentContext, | ||
typename T::Context const * | context | ||
) |
Definition at line 671 of file Worker.h.
References actReg_, edm::WaitingTaskList::add(), assert(), cached_exception_, edm::WaitingTaskList::doneWaiting(), emitPostModuleEventPrefetchingSignal(), Fail, edm::ServiceRegistry::instance(), edm::ModuleCallingContext::kInvalid, edm::ModuleCallingContext::kPrefetching, edm::make_empty_waiting_task(), moduleCallingContext_, Pass, prefetchAsync(), edm::ServiceRegistry::presentToken(), mps_fire::queue, Ready, serializeRunModule(), edm::ModuleCallingContext::setContext(), shouldRethrowException(), state_, timesRun_, timesVisited_, waitingTasks_, workStarted_, and edm::convertException::wrap().
Referenced by edm::WorkerInPath::runWorker().
void edm::Worker::doWorkAsync | ( | WaitingTask * | task, |
typename T::MyPrincipal const & | ep, | ||
EventSetup const & | c, | ||
StreamID | stream, | ||
ParentContext const & | parentContext, | ||
typename T::Context const * | context | ||
) |
Definition at line 602 of file Worker.h.
References edm::WaitingTaskList::add(), edm::WaitingTaskList::doneWaiting(), edm::ModuleCallingContext::kPrefetching, moduleCallingContext_, prefetchAsync(), edm::ModuleCallingContext::setContext(), timesVisited_, waitingTasks_, and workStarted_.
Referenced by edm::UnscheduledProductResolver::prefetchAsync_(), and edm::WorkerInPath::runWorkerAsync().
|
inlineprivate |
Definition at line 290 of file Worker.h.
References actReg_, edm::ModuleCallingContext::getStreamContext(), and moduleCallingContext_.
Referenced by doWork(), and edm::Worker::RunModuleTask< T >::execute().
void edm::Worker::endJob | ( | void | ) |
Definition at line 247 of file Worker.cc.
References actReg_, cms::Exception::addContext(), description(), Exception, implEndJob(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), state_, and edm::convertException::wrap().
void edm::Worker::endStream | ( | StreamID | id, |
StreamContext & | streamContext | ||
) |
Definition at line 287 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().
|
staticprivate |
Definition at line 99 of file Worker.cc.
References cms::Exception::addContext(), edm::ModuleCallingContext::internalContext(), edm::ParentContext::kInternal, edm::ParentContext::kModule, edm::ParentContext::kPlaceInPath, edm::InternalContext::moduleCallingContext(), edm::ModuleCallingContext::moduleCallingContext(), edm::ModuleCallingContext::moduleDescription(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), edm::PlaceInPathContext::pathContext(), edm::PathContext::pathName(), edm::ModuleCallingContext::placeInPathContext(), and edm::ModuleCallingContext::type().
Referenced by shouldRethrowException().
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
Referenced by beginJob().
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
Referenced by beginStream().
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
Referenced by edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::call().
|
protectedpure virtual |
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
|
protectedpure virtual |
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
|
protectedpure virtual |
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
Referenced by endJob().
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
Referenced by endStream().
|
privatepure virtual |
Implemented in edm::WorkerT< T >.
Referenced by postForkReacquireResources().
|
privatepure virtual |
Implemented in edm::WorkerT< T >.
Referenced by preForkReleaseResources().
|
privatepure virtual |
Implemented in edm::WorkerT< T >.
Referenced by registerThinnedAssociations().
|
privatepure virtual |
Implemented in edm::WorkerT< T >.
Referenced by respondToCloseInputFile().
|
privatepure virtual |
Implemented in edm::WorkerT< T >.
Referenced by respondToOpenInputFile().
|
privatepure virtual |
Implemented in edm::WorkerT< T >.
|
privatepure virtual |
Implemented in edm::WorkerT< T >.
|
privatepure virtual |
Implemented in edm::WorkerT< T >.
|
privatepure virtual |
Implemented in edm::WorkerT< T >.
Referenced by prefetchAsync().
|
pure virtual |
Implemented in edm::WorkerT< T >.
|
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 >, and edm::WorkerT< T >.
Referenced by edm::WorkerManager::addToUnscheduledWorkers(), and edm::StreamSchedule::fillWorkers().
void edm::Worker::postDoEvent | ( | EventPrincipal const & | iEvent | ) |
Definition at line 317 of file Worker.cc.
References earlyDeleteHelper_.
Referenced by edm::WorkerT< T >::implDo().
|
inline |
Definition at line 110 of file Worker.h.
References implPostForkReacquireResources().
Referenced by edm::Schedule::postForkReacquireResources().
|
private |
Definition at line 198 of file Worker.cc.
References actReg_, edm::ModuleCallingContext::getStreamContext(), mps_monitormerge::items, itemsToGetFromEvent(), edm::ModuleCallingContext::kPrefetching, moduleCallingContext_, edm::Principal::prefetchAsync(), edm::ProductResolverIndexAmbiguous, and edm::ModuleCallingContext::setContext().
Referenced by doWork(), and doWorkAsync().
|
inline |
Definition at line 109 of file Worker.h.
References implPreForkReleaseResources().
Referenced by edm::Schedule::preForkReleaseResources().
|
inline |
Definition at line 111 of file Worker.h.
References implRegisterThinnedAssociations().
|
inline |
Definition at line 113 of file Worker.h.
References cached_exception_, numberOfPathsLeftToRun_, numberOfPathsOn_, Ready, edm::WaitingTaskList::reset(), state_, waitingTasks_, and workStarted_.
Referenced by edm::WorkerManager::resetAll().
|
protected |
Definition at line 225 of file Worker.cc.
References moduleCallingContext_, edm::ModuleCallingContext::parent(), edm::ModuleCallingContext::previousModuleOnThread(), edm::ModuleCallingContext::state(), and groupFilesInBlocks::temp.
Referenced by edm::WorkerT< T >::setModule().
|
pure virtual |
Implemented in edm::WorkerT< T >.
|
inline |
Definition at line 107 of file Worker.h.
References implRespondToCloseInputFile().
Referenced by edm::Schedule::respondToCloseInputFile().
|
inline |
Definition at line 106 of file Worker.h.
References implRespondToOpenInputFile().
Referenced by edm::Schedule::respondToOpenInputFile().
|
private |
Definition at line 781 of file Worker.h.
References actReg_, moduleCallingContext_, and timesRun_.
|
private |
Definition at line 631 of file Worker.h.
References cms::Exception::addContext(), assert(), cached_exception_, description(), edm::WaitingTaskList::doneWaiting(), edm::ModuleCallingContext::kInvalid, moduleCallingContext_, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), edm::ModuleCallingContext::setContext(), shouldRethrowException(), waitingTasks_, and edm::convertException::wrap().
Referenced by edm::Worker::RunModuleTask< T >::execute().
|
privatepure 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 >, and edm::WorkerT< T >.
Referenced by doWork(), and edm::Worker::RunModuleTask< T >::execute().
void edm::Worker::setActivityRegistry | ( | std::shared_ptr< ActivityRegistry > | areg | ) |
void edm::Worker::setEarlyDeleteHelper | ( | EarlyDeleteHelper * | iHelper | ) |
Definition at line 221 of file Worker.cc.
References earlyDeleteHelper_.
|
inlineprivate |
Definition at line 277 of file Worker.h.
References cached_exception_, Exception, state_, and timesExcept_.
|
inlineprivate |
Definition at line 268 of file Worker.h.
References Fail, state_, and timesFailed_.
|
inlineprivate |
Definition at line 259 of file Worker.h.
References Pass, state_, and timesPassed_.
|
private |
Definition at line 155 of file Worker.cc.
References mps_fire::action, actions_, cms::Exception::category(), description(), exceptionContext(), 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::Worker::TransitionIDValueBase::value().
Referenced by doWork(), and runModuleAfterAsyncPrefetch().
void edm::Worker::skipOnPath | ( | ) |
Definition at line 311 of file Worker.cc.
References cached_exception_, edm::WaitingTaskList::doneWaiting(), numberOfPathsLeftToRun_, and waitingTasks_.
Referenced by edm::WorkerInPath::skipWorker().
|
inline |
Definition at line 162 of file Worker.h.
References state_.
Referenced by edm::WorkerInPath::checkResultsOfRunWorker().
|
inline |
Definition at line 161 of file Worker.h.
References timesExcept_.
Referenced by edm::fillWorkerSummaryAux().
|
inline |
Definition at line 160 of file Worker.h.
References timesFailed_.
Referenced by edm::fillWorkerSummaryAux().
|
inline |
|
inline |
Definition at line 159 of file Worker.h.
References timesPassed_.
Referenced by edm::fillWorkerSummaryAux(), and timesPass().
|
inline |
Definition at line 157 of file Worker.h.
References timesRun_.
Referenced by edm::fillWorkerSummaryAux().
|
inline |
Definition at line 158 of file Worker.h.
References timesVisited_.
Referenced by edm::fillWorkerSummaryAux().
|
pure virtual |
Implemented in edm::WorkerT< T >.
Referenced by edm::Schedule::changeModule().
|
protectedpure virtual |
Implemented in edm::WorkerT< T >.
|
friend |
|
private |
Definition at line 393 of file Worker.h.
Referenced by shouldRethrowException().
|
private |
Definition at line 396 of file Worker.h.
Referenced by activityRegistry(), beginJob(), beginStream(), doWork(), emitPostModuleEventPrefetchingSignal(), endJob(), endStream(), prefetchAsync(), runModule(), and setActivityRegistry().
|
private |
Definition at line 394 of file Worker.h.
Referenced by doWork(), reset(), runModuleAfterAsyncPrefetch(), setException(), and skipOnPath().
|
private |
Definition at line 398 of file Worker.h.
Referenced by postDoEvent(), and setEarlyDeleteHelper().
|
private |
Definition at line 391 of file Worker.h.
Referenced by beginStream(), descPtr(), description(), doWork(), doWorkAsync(), emitPostModuleEventPrefetchingSignal(), endStream(), prefetchAsync(), resetModuleDescription(), runModule(), and runModuleAfterAsyncPrefetch().
|
private |
Definition at line 389 of file Worker.h.
Referenced by reset(), and skipOnPath().
|
private |
Definition at line 388 of file Worker.h.
Referenced by addedToPath(), and reset().
|
private |
Definition at line 387 of file Worker.h.
Referenced by beginJob(), beginStream(), doWork(), endJob(), endStream(), reset(), setException(), setFailed(), setPassed(), and state().
|
private |
Definition at line 386 of file Worker.h.
Referenced by clearCounters(), setException(), and timesExcept().
|
private |
Definition at line 385 of file Worker.h.
Referenced by clearCounters(), setFailed(), and timesFailed().
|
private |
Definition at line 384 of file Worker.h.
Referenced by clearCounters(), setPassed(), and timesPassed().
|
private |
Definition at line 382 of file Worker.h.
Referenced by clearCounters(), doWork(), runModule(), and timesRun().
|
private |
Definition at line 383 of file Worker.h.
Referenced by clearCounters(), doWork(), doWorkAsync(), and timesVisited().
|
private |
Definition at line 400 of file Worker.h.
Referenced by callWhenDoneAsync(), doWork(), doWorkAsync(), reset(), runModuleAfterAsyncPrefetch(), and skipOnPath().
|
private |
Definition at line 401 of file Worker.h.
Referenced by doWork(), doWorkAsync(), and reset().