LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "Worker.h"
Public Types | |
enum | State { Ready, Pass, Fail, Working, ExceptionThrown } |
Public Member Functions | |
virtual | ~Worker () |
Worker (ModuleDescription const &, WorkerParams const &) | |
void | beginJob (detail::SharedResources const &) |
void | endJob () |
void | respondToOpenInputFile (FileBlock const &fb) |
void | respondToCloseInputFile (FileBlock const &fb) |
void | respondToOpenOutputFiles (FileBlock const &fb) |
void | respondToCloseOutputFiles (FileBlock const &fb) |
void | doWork (Transition, Principal &, ModuleContext const &) |
void | doWork_event (hep::concurrency::WaitingTaskPtr workerInPathDoneTask, EventPrincipal &, ModuleContext const &) |
void | doWork_event (EventPrincipal &, ModuleContext const &) |
ScheduleID | scheduleID () const |
bool | returnCode () const |
ModuleDescription const & | description () const |
hep::concurrency::SerialTaskQueueChain * | serialTaskQueueChain () const |
void | reset () |
std::size_t | timesVisited () const |
std::size_t | timesRun () const |
std::size_t | timesPassed () const |
std::size_t | timesFailed () const |
std::size_t | timesExcept () const |
void | runWorker (EventPrincipal &, ModuleContext const &) |
bool | isUnique () const |
Protected Member Functions | |
std::string const & | label () const |
Protected Attributes | |
std::atomic< std::size_t > | counts_visited_ {} |
std::atomic< std::size_t > | counts_run_ {} |
std::atomic< std::size_t > | counts_passed_ {} |
std::atomic< std::size_t > | counts_failed_ {} |
std::atomic< std::size_t > | counts_thrown_ {} |
Private Member Functions | |
virtual hep::concurrency::SerialTaskQueueChain * | doSerialTaskQueueChain () const =0 |
virtual void | doBeginJob (detail::SharedResources const &resources)=0 |
virtual void | doEndJob ()=0 |
virtual void | doBegin (RunPrincipal &rp, ModuleContext const &mc)=0 |
virtual void | doEnd (RunPrincipal &rp, ModuleContext const &mc)=0 |
virtual void | doBegin (SubRunPrincipal &srp, ModuleContext const &mc)=0 |
virtual void | doEnd (SubRunPrincipal &srp, ModuleContext const &mc)=0 |
virtual bool | doProcess (EventPrincipal &, ModuleContext const &)=0 |
virtual void | doRespondToOpenInputFile (FileBlock const &fb)=0 |
virtual void | doRespondToCloseInputFile (FileBlock const &fb)=0 |
virtual void | doRespondToOpenOutputFiles (FileBlock const &fb)=0 |
virtual void | doRespondToCloseOutputFiles (FileBlock const &fb)=0 |
Private Attributes | |
ScheduleID const | scheduleID_ |
ModuleDescription const | md_ |
ActionTable const & | actions_ |
ActivityRegistry const & | actReg_ |
std::atomic< int > | state_ {Ready} |
std::exception_ptr | cached_exception_ {} |
std::atomic< bool > | workStarted_ {false} |
std::atomic< bool > | returnCode_ {false} |
hep::concurrency::WaitingTaskList | waitingTasks_ |
enum art::Worker::State |
Enumerator | |
---|---|
Ready | |
Pass | |
Fail | |
Working | |
ExceptionThrown |
Definition at line 49 of file Worker.h.
|
virtualdefault |
art::Worker::Worker | ( | ModuleDescription const & | md, |
WorkerParams const & | wp | ||
) |
Definition at line 108 of file Worker.cc.
References actions_, actReg_, md_, art::ModuleDescription::moduleLabel(), art::ModuleDescription::moduleName(), art::WorkerParams::scheduleID_, TDEBUG_FUNC_SI, and waitingTasks_.
void art::Worker::beginJob | ( | detail::SharedResources const & | resources | ) |
Definition at line 196 of file Worker.cc.
References actReg_, doBeginJob(), md_, art::ActivityRegistry::sPostModuleBeginJob, and art::ActivityRegistry::sPreModuleBeginJob.
ModuleDescription const & art::Worker::description | ( | ) | const |
Definition at line 121 of file Worker.cc.
References md_.
Referenced by art::OutputWorker::OutputWorker(), and art::OutputWorker::writeEvent().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by doWork().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by beginJob().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by doWork().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by endJob().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by doWork_event(), and runWorker().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by respondToCloseInputFile().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by respondToCloseOutputFiles().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by respondToOpenInputFile().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by respondToOpenOutputFiles().
|
privatepure virtual |
Implemented in art::OutputWorker, and art::WorkerT< T >.
Referenced by serialTaskQueueChain().
void art::Worker::doWork | ( | Transition | trans, |
Principal & | principal, | ||
ModuleContext const & | mc | ||
) |
Definition at line 250 of file Worker.cc.
References actReg_, art::errors::BadAlloc, art::errors::BadExceptionType, art::BeginRun, art::BeginSubRun, cached_exception_, doBegin(), doEnd(), art::EndRun, art::EndSubRun, ExceptionThrown, Fail, md_, art::errors::OtherArt, Pass, Ready, art::errors::ScheduleExecutionFailure, art::ActivityRegistry::sPostModuleBeginRun, art::ActivityRegistry::sPostModuleBeginSubRun, art::ActivityRegistry::sPostModuleEndRun, art::ActivityRegistry::sPostModuleEndSubRun, art::ActivityRegistry::sPreModuleBeginRun, art::ActivityRegistry::sPreModuleBeginSubRun, art::ActivityRegistry::sPreModuleEndRun, art::ActivityRegistry::sPreModuleEndSubRun, state_, art::errors::StdException, art::errors::Unknown, and Working.
void art::Worker::doWork_event | ( | hep::concurrency::WaitingTaskPtr | workerInPathDoneTask, |
EventPrincipal & | , | ||
ModuleContext const & | |||
) |
Referenced by isUnique().
void art::Worker::doWork_event | ( | EventPrincipal & | p, |
ModuleContext const & | mc | ||
) |
Definition at line 366 of file Worker.cc.
References actions_, actReg_, art::errors::BadAlloc, art::errors::BadExceptionType, cached_exception_, counts_failed_, counts_passed_, counts_thrown_, counts_visited_, doProcess(), ExceptionThrown, Fail, art::actions::FailModule, art::ActionTable::find(), art::actions::IgnoreCompletely, md_, art::errors::OtherArt, Pass, returnCode_, art::ActivityRegistry::sPostModule, art::ActivityRegistry::sPreModule, state_, art::errors::StdException, art::errors::Unknown, and Working.
void art::Worker::endJob | ( | ) |
Definition at line 207 of file Worker.cc.
References actReg_, doEndJob(), md_, art::ActivityRegistry::sPostModuleEndJob, and art::ActivityRegistry::sPreModuleEndJob.
bool art::Worker::isUnique | ( | ) | const |
Definition at line 592 of file Worker.cc.
References counts_visited_, doWork_event(), art::ScheduleID::first(), md_, art::ModuleDescription::moduleThreadingType(), art::replicated, runWorker(), art::ModuleContext::scheduleID(), scheduleID_, serialTaskQueueChain(), TDEBUG_BEGIN_FUNC_SI, TDEBUG_END_FUNC_SI, TDEBUG_FUNC_SI, waitingTasks_, and workStarted_.
|
protected |
Definition at line 127 of file Worker.cc.
References md_, and art::ModuleDescription::moduleLabel().
Referenced by art::OutputWorker::closeFile(), art::OutputWorker::openFile(), and art::OutputWorker::OutputWorker().
void art::Worker::reset | ( | ) |
Definition at line 149 of file Worker.cc.
References cached_exception_, Ready, returnCode_, scheduleID_, state_, TDEBUG_FUNC_SI, waitingTasks_, and workStarted_.
void art::Worker::respondToCloseInputFile | ( | FileBlock const & | fb | ) |
Definition at line 226 of file Worker.cc.
References actReg_, doRespondToCloseInputFile(), md_, art::ActivityRegistry::sPostModuleRespondToCloseInputFile, and art::ActivityRegistry::sPreModuleRespondToCloseInputFile.
void art::Worker::respondToCloseOutputFiles | ( | FileBlock const & | fb | ) |
Definition at line 242 of file Worker.cc.
References actReg_, doRespondToCloseOutputFiles(), md_, art::ActivityRegistry::sPostModuleRespondToCloseOutputFiles, and art::ActivityRegistry::sPreModuleRespondToCloseOutputFiles.
void art::Worker::respondToOpenInputFile | ( | FileBlock const & | fb | ) |
Definition at line 218 of file Worker.cc.
References actReg_, doRespondToOpenInputFile(), md_, art::ActivityRegistry::sPostModuleRespondToOpenInputFile, and art::ActivityRegistry::sPreModuleRespondToOpenInputFile.
void art::Worker::respondToOpenOutputFiles | ( | FileBlock const & | fb | ) |
Definition at line 234 of file Worker.cc.
References actReg_, doRespondToOpenOutputFiles(), md_, art::ActivityRegistry::sPostModuleRespondToOpenOutputFiles, and art::ActivityRegistry::sPreModuleRespondToOpenOutputFiles.
bool art::Worker::returnCode | ( | ) | const |
void art::Worker::runWorker | ( | EventPrincipal & | p, |
ModuleContext const & | mc | ||
) |
Definition at line 466 of file Worker.cc.
References actions_, actReg_, art::errors::BadAlloc, art::errors::BadExceptionType, cached_exception_, counts_failed_, counts_passed_, counts_thrown_, doProcess(), ExceptionThrown, Fail, art::actions::FailModule, art::actions::FailPath, art::ActionTable::find(), art::actions::IgnoreCompletely, md_, art::ModuleContext::onEndPath(), art::errors::OtherArt, Pass, returnCode_, art::ModuleContext::scheduleID(), art::actions::SkipEvent, art::ActivityRegistry::sPostModule, art::ActivityRegistry::sPreModule, state_, art::errors::StdException, TDEBUG_BEGIN_TASK_SI, TDEBUG_END_TASK_SI, art::errors::Unknown, waitingTasks_, and Working.
Referenced by isUnique().
|
inline |
SerialTaskQueueChain * art::Worker::serialTaskQueueChain | ( | ) | const |
Definition at line 140 of file Worker.cc.
References doSerialTaskQueueChain().
Referenced by isUnique().
size_t art::Worker::timesExcept | ( | ) | const |
size_t art::Worker::timesFailed | ( | ) | const |
size_t art::Worker::timesPassed | ( | ) | const |
size_t art::Worker::timesRun | ( | ) | const |
size_t art::Worker::timesVisited | ( | ) | const |
|
private |
Definition at line 122 of file Worker.h.
Referenced by doWork_event(), runWorker(), and Worker().
|
private |
Definition at line 123 of file Worker.h.
Referenced by beginJob(), doWork(), doWork_event(), endJob(), respondToCloseInputFile(), respondToCloseOutputFiles(), respondToOpenInputFile(), respondToOpenOutputFiles(), runWorker(), and Worker().
|
private |
Definition at line 134 of file Worker.h.
Referenced by doWork(), doWork_event(), reset(), and runWorker().
|
protected |
Definition at line 101 of file Worker.h.
Referenced by art::WorkerT< T >::doProcess(), art::OutputWorker::doProcess(), doWork_event(), runWorker(), and timesFailed().
|
protected |
Definition at line 100 of file Worker.h.
Referenced by art::WorkerT< T >::doProcess(), art::OutputWorker::doProcess(), doWork_event(), runWorker(), and timesPassed().
|
protected |
Definition at line 99 of file Worker.h.
Referenced by art::WorkerT< T >::doProcess(), art::OutputWorker::doProcess(), and timesRun().
|
protected |
Definition at line 102 of file Worker.h.
Referenced by doWork_event(), runWorker(), and timesExcept().
|
protected |
Definition at line 98 of file Worker.h.
Referenced by doWork_event(), isUnique(), and timesVisited().
|
private |
Definition at line 121 of file Worker.h.
Referenced by beginJob(), description(), doWork(), doWork_event(), endJob(), isUnique(), label(), respondToCloseInputFile(), respondToCloseOutputFiles(), respondToOpenInputFile(), respondToOpenOutputFiles(), runWorker(), and Worker().
|
private |
Definition at line 137 of file Worker.h.
Referenced by doWork_event(), reset(), returnCode(), and runWorker().
|
private |
Definition at line 120 of file Worker.h.
Referenced by isUnique(), and reset().
|
private |
Definition at line 124 of file Worker.h.
Referenced by doWork(), doWork_event(), reset(), and runWorker().
|
private |
Definition at line 143 of file Worker.h.
Referenced by isUnique(), reset(), runWorker(), and Worker().
|
private |
Definition at line 136 of file Worker.h.
Referenced by isUnique(), and reset().