#include <Worker.h>
enum edm::Worker::State |
edm::Worker::Worker | ( | ModuleDescription const & | iMD, |
WorkerParams const & | iWP | ||
) |
Definition at line 44 of file Worker.cc.
: stopwatch_(), timesRun_(), timesVisited_(), timesPassed_(), timesFailed_(), timesExcept_(), state_(Ready), md_(iMD), actions_(iWP.actions_), cached_exception_(), actReg_(), earlyDeleteHelper_(0) { }
void edm::Worker::beginJob | ( | void | ) |
Definition at line 72 of file Worker.cc.
References actReg_, cms::Exception::addContext(), edm::convertException::badAllocToEDM(), trackerHits::c, edm::convertException::charPtrToEDM(), alignCSCRings::e, exception, Exception, implBeginJob(), md_, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), alignCSCRings::s, state_, edm::convertException::stdToEDM(), AlCaHLTBitMon_QueryRunRegistry::string, edm::convertException::stringToEDM(), and edm::convertException::unknownToEDM().
Referenced by edm::Schedule::beginJob(), and edm::Schedule::changeModule().
{ try { try { ModuleBeginJobSignalSentry cpp(actReg_.get(), md_); implBeginJob(); } catch (cms::Exception& e) { throw; } catch(std::bad_alloc& bda) { convertException::badAllocToEDM(); } catch (std::exception& e) { convertException::stdToEDM(e); } catch(std::string& s) { convertException::stringToEDM(s); } catch(char const* c) { convertException::charPtrToEDM(c); } catch (...) { convertException::unknownToEDM(); } } catch(cms::Exception& ex) { state_ = Exception; std::ostringstream ost; ost << "Calling beginJob for module " << md_.moduleName() << "/'" << md_.moduleLabel() << "'"; ex.addContext(ost.str()); throw; } }
void edm::Worker::clearCounters | ( | ) | [inline] |
Definition at line 85 of file Worker.h.
References timesExcept_, timesFailed_, timesPassed_, timesRun_, and timesVisited_.
Referenced by edm::Schedule::clearCounters().
{ timesRun_ = timesVisited_ = timesPassed_ = timesFailed_ = timesExcept_ = 0; }
ModuleDescription const* edm::Worker::descPtr | ( | ) | const [inline] |
ModuleDescription const& edm::Worker::description | ( | ) | const [inline] |
Definition at line 73 of file Worker.h.
References md_.
Referenced by edm::UnscheduledCallProducer::addWorker(), edm::Schedule::changeModule(), edm::fillModuleInPathSummary(), edm::Schedule::fillWorkers(), edm::fillWorkerSummaryAux(), edm::WorkerMaker< T >::implSwapModule(), and edm::WorkerT< OutputModule >::setModule().
{return md_;}
bool edm::Worker::doWork | ( | typename T::MyPrincipal & | ep, |
EventSetup const & | c, | ||
CurrentProcessingContext const * | cpc, | ||
CPUTimer *const | timer | ||
) |
Definition at line 204 of file Worker.h.
References alignCSCRings::action, actions_, actReg_, edm::convertException::badAllocToEDM(), trackerHits::c, cached_exception_, cms::Exception::category(), edm::convertException::charPtrToEDM(), alignCSCRings::e, exception, Exception, Fail, edm::actions::FailPath, edm::ActionTable::find(), reco_skim_cfg_mod::IgnoreCompletely, edm::actions::IgnoreCompletely, implDoBegin(), implDoEnd(), edm::CurrentProcessingContext::isEndPath(), edm::CurrentProcessingContext::isUnscheduled(), md_, Pass, edm::printCmsExceptionWarning(), edm::actions::Rethrow, alignCSCRings::s, edm::actions::SkipEvent, state_, edm::convertException::stdToEDM(), stopwatch_, AlCaHLTBitMon_QueryRunRegistry::string, edm::convertException::stringToEDM(), timesExcept_, timesFailed_, timesPassed_, timesRun_, timesVisited_, and edm::convertException::unknownToEDM().
Referenced by edm::WorkerInPath::runWorker().
{ // A RunStopwatch, but only if we are processing an event. RunDualStopwatches stopwatch(T::isEvent_ ? stopwatch_ : RunStopwatch::StopwatchPointer(), iTimer); if (T::isEvent_) { ++timesVisited_; } bool rc = false; switch(state_) { case Ready: break; case Pass: return true; case Fail: return false; case Exception: { cached_exception_->raise(); } } if (T::isEvent_) ++timesRun_; try { try { ModuleSignalSentry<T> cpp(actReg_.get(), md_); if (T::begin_) { rc = implDoBegin(ep, es, cpc); } else { rc = implDoEnd(ep, es, cpc); } if (rc) { state_ = Pass; if (T::isEvent_) ++timesPassed_; } else { state_ = Fail; if (T::isEvent_) ++timesFailed_; } } catch (cms::Exception& e) { throw; } catch(std::bad_alloc& bda) { convertException::badAllocToEDM(); } catch (std::exception& e) { convertException::stdToEDM(e); } catch(std::string& s) { convertException::stringToEDM(s); } catch(char const* c) { convertException::charPtrToEDM(c); } catch (...) { convertException::unknownToEDM(); } } catch(cms::Exception& ex) { // NOTE: the warning printed as a result of ignoring or failing // a module will only be printed during the full true processing // pass of this module // Get the action corresponding to this exception. However, if processing // something other than an event (e.g. run, lumi) always rethrow. actions::ActionCodes action = (T::isEvent_ ? actions_->find(ex.category()) : actions::Rethrow); // If we are processing an endpath and the module was scheduled, treat SkipEvent or FailPath // as IgnoreCompletely, so any subsequent OutputModules are still run. // For unscheduled modules only treat FailPath as IgnoreCompletely but still allow SkipEvent to throw if (cpc && cpc->isEndPath()) { if ((action == actions::SkipEvent && !cpc->isUnscheduled()) || action == actions::FailPath) action = actions::IgnoreCompletely; } switch(action) { case actions::IgnoreCompletely: rc = true; ++timesPassed_; state_ = Pass; exceptionContext<T>(ep, ex, cpc); edm::printCmsExceptionWarning("IgnoreCompletely", ex); break; default: if (T::isEvent_) ++timesExcept_; state_ = Exception; cached_exception_.reset(ex.clone()); cached_exception_->raise(); } } return rc; }
void edm::Worker::endJob | ( | void | ) |
Definition at line 94 of file Worker.cc.
References actReg_, cms::Exception::addContext(), edm::convertException::badAllocToEDM(), trackerHits::c, edm::convertException::charPtrToEDM(), alignCSCRings::e, exception, Exception, implEndJob(), md_, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), alignCSCRings::s, state_, edm::convertException::stdToEDM(), AlCaHLTBitMon_QueryRunRegistry::string, edm::convertException::stringToEDM(), and edm::convertException::unknownToEDM().
{ try { try { ModuleEndJobSignalSentry cpp(actReg_.get(), md_); implEndJob(); } catch (cms::Exception& e) { throw; } catch(std::bad_alloc& bda) { convertException::badAllocToEDM(); } catch (std::exception& e) { convertException::stdToEDM(e); } catch(std::string& s) { convertException::stringToEDM(s); } catch(char const* c) { convertException::charPtrToEDM(c); } catch (...) { convertException::unknownToEDM(); } } catch(cms::Exception& ex) { state_ = Exception; std::ostringstream ost; ost << "Calling endJob for module " << md_.moduleName() << "/'" << md_.moduleLabel() << "'"; ex.addContext(ost.str()); throw; } }
virtual void edm::Worker::implBeginJob | ( | ) | [protected, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by beginJob().
virtual bool edm::Worker::implDoBegin | ( | LuminosityBlockPrincipal & | lbp, |
EventSetup const & | c, | ||
CurrentProcessingContext const * | cpc | ||
) | [protected, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
virtual bool edm::Worker::implDoBegin | ( | EventPrincipal & | , |
EventSetup const & | c, | ||
CurrentProcessingContext const * | cpc | ||
) | [protected, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by doWork().
virtual bool edm::Worker::implDoBegin | ( | RunPrincipal & | rp, |
EventSetup const & | c, | ||
CurrentProcessingContext const * | cpc | ||
) | [protected, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
virtual bool edm::Worker::implDoEnd | ( | LuminosityBlockPrincipal & | lbp, |
EventSetup const & | c, | ||
CurrentProcessingContext const * | cpc | ||
) | [protected, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
virtual bool edm::Worker::implDoEnd | ( | EventPrincipal & | , |
EventSetup const & | c, | ||
CurrentProcessingContext const * | cpc | ||
) | [protected, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by doWork().
virtual bool edm::Worker::implDoEnd | ( | RunPrincipal & | rp, |
EventSetup const & | c, | ||
CurrentProcessingContext const * | cpc | ||
) | [protected, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
virtual void edm::Worker::implEndJob | ( | ) | [protected, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by endJob().
virtual void edm::Worker::implPostForkReacquireResources | ( | unsigned int | iChildIndex, |
unsigned int | iNumberOfChildren | ||
) | [private, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by postForkReacquireResources().
virtual void edm::Worker::implPreForkReleaseResources | ( | ) | [private, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by preForkReleaseResources().
virtual void edm::Worker::implRespondToCloseInputFile | ( | FileBlock const & | fb | ) | [private, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by respondToCloseInputFile().
virtual void edm::Worker::implRespondToCloseOutputFiles | ( | FileBlock const & | fb | ) | [private, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by respondToCloseOutputFiles().
virtual void edm::Worker::implRespondToOpenInputFile | ( | FileBlock const & | fb | ) | [private, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by respondToOpenInputFile().
virtual void edm::Worker::implRespondToOpenOutputFiles | ( | FileBlock const & | fb | ) | [private, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
Referenced by respondToOpenOutputFiles().
void edm::Worker::pathFinished | ( | EventPrincipal & | iEvent | ) |
Definition at line 120 of file Worker.cc.
References earlyDeleteHelper_, and edm::EarlyDeleteHelper::pathFinished().
{ if(earlyDeleteHelper_) { earlyDeleteHelper_->pathFinished(iEvent); } }
void edm::Worker::postDoEvent | ( | EventPrincipal & | iEvent | ) |
Definition at line 125 of file Worker.cc.
References earlyDeleteHelper_, and edm::EarlyDeleteHelper::moduleRan().
Referenced by edm::WorkerT< T >::implDoBegin().
{ if(earlyDeleteHelper_) { earlyDeleteHelper_->moduleRan(iEvent); } }
void edm::Worker::postForkReacquireResources | ( | unsigned int | iChildIndex, |
unsigned int | iNumberOfChildren | ||
) | [inline] |
Definition at line 66 of file Worker.h.
References implPostForkReacquireResources().
Referenced by edm::Schedule::postForkReacquireResources().
{implPostForkReacquireResources(iChildIndex, iNumberOfChildren);}
void edm::Worker::preForkReleaseResources | ( | ) | [inline] |
Definition at line 65 of file Worker.h.
References implPreForkReleaseResources().
Referenced by edm::Schedule::preForkReleaseResources().
void edm::Worker::reset | ( | void | ) | [inline] |
void edm::Worker::respondToCloseInputFile | ( | FileBlock const & | fb | ) | [inline] |
Definition at line 61 of file Worker.h.
References implRespondToCloseInputFile().
Referenced by edm::Schedule::respondToCloseInputFile().
void edm::Worker::respondToCloseOutputFiles | ( | FileBlock const & | fb | ) | [inline] |
Definition at line 63 of file Worker.h.
References implRespondToCloseOutputFiles().
Referenced by edm::Schedule::respondToCloseOutputFiles().
void edm::Worker::respondToOpenInputFile | ( | FileBlock const & | fb | ) | [inline] |
Definition at line 60 of file Worker.h.
References implRespondToOpenInputFile().
Referenced by edm::Schedule::respondToOpenInputFile().
void edm::Worker::respondToOpenOutputFiles | ( | FileBlock const & | fb | ) | [inline] |
Definition at line 62 of file Worker.h.
References implRespondToOpenOutputFiles().
Referenced by edm::Schedule::respondToOpenOutputFiles().
void edm::Worker::setActivityRegistry | ( | boost::shared_ptr< ActivityRegistry > | areg | ) |
void edm::Worker::setEarlyDeleteHelper | ( | EarlyDeleteHelper * | iHelper | ) |
Definition at line 68 of file Worker.cc.
References earlyDeleteHelper_.
{ earlyDeleteHelper_=iHelper; }
State edm::Worker::state | ( | ) | const [inline] |
std::pair<double, double> edm::Worker::timeCpuReal | ( | ) | const [inline] |
Definition at line 81 of file Worker.h.
References stopwatch_.
{ return std::pair<double, double>(stopwatch_->cpuTime(), stopwatch_->realTime()); }
int edm::Worker::timesExcept | ( | ) | const [inline] |
Definition at line 95 of file Worker.h.
References timesExcept_.
Referenced by edm::fillWorkerSummaryAux().
{ return timesExcept_; }
int edm::Worker::timesFailed | ( | ) | const [inline] |
Definition at line 94 of file Worker.h.
References timesFailed_.
Referenced by edm::fillWorkerSummaryAux().
{ return timesFailed_; }
int edm::Worker::timesPass | ( | ) | const [inline] |
Definition at line 98 of file Worker.h.
References timesPassed().
{ return timesPassed(); } // for backward compatibility only - to be removed soon
int edm::Worker::timesPassed | ( | ) | const [inline] |
Definition at line 93 of file Worker.h.
References timesPassed_.
Referenced by edm::fillWorkerSummaryAux(), and timesPass().
{ return timesPassed_; }
int edm::Worker::timesRun | ( | ) | const [inline] |
Definition at line 91 of file Worker.h.
References timesRun_.
Referenced by edm::fillWorkerSummaryAux().
{ return timesRun_; }
int edm::Worker::timesVisited | ( | ) | const [inline] |
Definition at line 92 of file Worker.h.
References timesVisited_.
Referenced by edm::fillWorkerSummaryAux().
{ return timesVisited_; }
void edm::Worker::useStopwatch | ( | ) |
Definition at line 116 of file Worker.cc.
References stopwatch_.
Referenced by edm::Schedule::addToAllWorkers().
{ stopwatch_.reset(new RunStopwatch::StopwatchPointer::element_type); }
virtual std::string edm::Worker::workerType | ( | ) | const [protected, pure virtual] |
Implemented in edm::WorkerT< T >, and edm::WorkerT< OutputModule >.
ActionTable const* edm::Worker::actions_ [private] |
boost::shared_ptr<ActivityRegistry> edm::Worker::actReg_ [private] |
Definition at line 139 of file Worker.h.
Referenced by beginJob(), doWork(), endJob(), and setActivityRegistry().
boost::shared_ptr<cms::Exception> edm::Worker::cached_exception_ [private] |
EarlyDeleteHelper* edm::Worker::earlyDeleteHelper_ [private] |
Definition at line 141 of file Worker.h.
Referenced by pathFinished(), postDoEvent(), and setEarlyDeleteHelper().
ModuleDescription edm::Worker::md_ [private] |
Definition at line 135 of file Worker.h.
Referenced by beginJob(), descPtr(), description(), doWork(), and endJob().
State edm::Worker::state_ [private] |
Definition at line 126 of file Worker.h.
Referenced by doWork(), timeCpuReal(), and useStopwatch().
int edm::Worker::timesExcept_ [private] |
Definition at line 132 of file Worker.h.
Referenced by clearCounters(), doWork(), and timesExcept().
int edm::Worker::timesFailed_ [private] |
Definition at line 131 of file Worker.h.
Referenced by clearCounters(), doWork(), and timesFailed().
int edm::Worker::timesPassed_ [private] |
Definition at line 130 of file Worker.h.
Referenced by clearCounters(), doWork(), and timesPassed().
int edm::Worker::timesRun_ [private] |
Definition at line 128 of file Worker.h.
Referenced by clearCounters(), doWork(), and timesRun().
int edm::Worker::timesVisited_ [private] |
Definition at line 129 of file Worker.h.
Referenced by clearCounters(), doWork(), and timesVisited().