CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
edm::Worker Class Referenceabstract

#include <Worker.h>

Inheritance diagram for edm::Worker:
edm::WorkerT< T >

Public Types

enum  State { Ready, Pass, Fail, Exception }
 
enum  Types { kAnalyzer, kFilter, kProducer, kOutputModule }
 

Public Member Functions

void beginJob ()
 
void beginStream (StreamID id, StreamContext &streamContext)
 
void clearCounters ()
 
ModuleDescription const * descPtr () const
 
ModuleDescription const & description () const
 
template<typename T >
bool doWork (typename T::MyPrincipal &, EventSetup const &c, CPUTimer *const timer, StreamID stream, ParentContext const &parentContext, typename T::Context const *context)
 
void endJob ()
 
void endStream (StreamID id, StreamContext &streamContext)
 
virtual Types moduleType () const =0
 
Workeroperator= (Worker const &)=delete
 
void pathFinished (EventPrincipal &)
 
void postDoEvent (EventPrincipal &)
 
void postForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
 
void preForkReleaseResources ()
 
void reset ()
 
void respondToCloseInputFile (FileBlock const &fb)
 
void respondToOpenInputFile (FileBlock const &fb)
 
void setActivityRegistry (boost::shared_ptr< ActivityRegistry > areg)
 
void setEarlyDeleteHelper (EarlyDeleteHelper *iHelper)
 
State state () const
 
std::pair< double, double > timeCpuReal () const
 
int timesExcept () const
 
int timesFailed () const
 
int timesPass () const
 
int timesPassed () const
 
int timesRun () const
 
int timesVisited () const
 
virtual void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)=0
 
void useStopwatch ()
 
 Worker (ModuleDescription const &iMD, ExceptionToActionTable const *iActions)
 
 Worker (Worker const &)=delete
 
virtual ~Worker ()
 

Protected Member Functions

virtual void implBeginJob ()=0
 
virtual void implBeginStream (StreamID)=0
 
virtual bool implDo (EventPrincipal &, EventSetup const &c, ModuleCallingContext const *mcc)=0
 
virtual bool implDoBegin (RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *mcc)=0
 
virtual bool implDoBegin (LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *mcc)=0
 
virtual bool implDoEnd (RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *mcc)=0
 
virtual bool implDoEnd (LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *mcc)=0
 
virtual bool implDoStreamBegin (StreamID id, RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *mcc)=0
 
virtual bool implDoStreamBegin (StreamID id, LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *mcc)=0
 
virtual bool implDoStreamEnd (StreamID id, RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *mcc)=0
 
virtual bool implDoStreamEnd (StreamID id, LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *mcc)=0
 
virtual void implEndJob ()=0
 
virtual void implEndStream (StreamID)=0
 
void resetModuleDescription (ModuleDescription const *)
 
virtual std::string workerType () const =0
 

Private Member Functions

virtual void implPostForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)=0
 
virtual void implPreForkReleaseResources ()=0
 
virtual void implRespondToCloseInputFile (FileBlock const &fb)=0
 
virtual void implRespondToOpenInputFile (FileBlock const &fb)=0
 
virtual void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const =0
 
virtual void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const =0
 
virtual std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const =0
 

Private Attributes

ExceptionToActionTable const * actions_
 
boost::shared_ptr
< ActivityRegistry
actReg_
 
boost::shared_ptr< cms::Exceptioncached_exception_
 
EarlyDeleteHelperearlyDeleteHelper_
 
ModuleCallingContext moduleCallingContext_
 
State state_
 
RunStopwatch::StopwatchPointer stopwatch_
 
int timesExcept_
 
int timesFailed_
 
int timesPassed_
 
int timesRun_
 
int timesVisited_
 

Friends

template<typename O >
class workerhelper::CallImpl
 

Detailed Description

Definition at line 65 of file Worker.h.

Member Enumeration Documentation

Enumerator
Ready 
Pass 
Fail 
Exception 

Definition at line 67 of file Worker.h.

Enumerator
kAnalyzer 
kFilter 
kProducer 
kOutputModule 

Definition at line 68 of file Worker.h.

Constructor & Destructor Documentation

edm::Worker::Worker ( ModuleDescription const &  iMD,
ExceptionToActionTable const *  iActions 
)

Definition at line 77 of file Worker.cc.

78  :
79  stopwatch_(),
80  timesRun_(),
81  timesVisited_(),
82  timesPassed_(),
83  timesFailed_(),
84  timesExcept_(),
85  state_(Ready),
87  actions_(iActions),
89  actReg_(),
90  earlyDeleteHelper_(nullptr)
91  {
92  }
boost::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:186
ExceptionToActionTable const * actions_
Definition: Worker.h:183
EarlyDeleteHelper * earlyDeleteHelper_
Definition: Worker.h:188
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:181
int timesExcept_
Definition: Worker.h:178
int timesPassed_
Definition: Worker.h:176
boost::shared_ptr< cms::Exception > cached_exception_
Definition: Worker.h:184
int timesRun_
Definition: Worker.h:174
RunStopwatch::StopwatchPointer stopwatch_
Definition: Worker.h:172
int timesFailed_
Definition: Worker.h:177
State state_
Definition: Worker.h:179
int timesVisited_
Definition: Worker.h:175
edm::Worker::~Worker ( )
virtual

Definition at line 94 of file Worker.cc.

94  {
95  }
edm::Worker::Worker ( Worker const &  )
delete

Member Function Documentation

void edm::Worker::beginJob ( void  )

Definition at line 111 of file Worker.cc.

References actReg_, cms::Exception::addContext(), edm::convertException::badAllocToEDM(), trackerHits::c, edm::convertException::charPtrToEDM(), description(), alignCSCRings::e, cppFunctionSkipper::exception, Exception, implBeginJob(), 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::WorkerManager::beginJob(), and edm::GlobalSchedule::replaceModule().

111  {
112  try {
113  try {
114  ModuleBeginJobSignalSentry cpp(actReg_.get(), description());
115  implBeginJob();
116  }
117  catch (cms::Exception& e) { throw; }
118  catch(std::bad_alloc& bda) { convertException::badAllocToEDM(); }
119  catch (std::exception& e) { convertException::stdToEDM(e); }
121  catch(char const* c) { convertException::charPtrToEDM(c); }
122  catch (...) { convertException::unknownToEDM(); }
123  }
124  catch(cms::Exception& ex) {
125  state_ = Exception;
126  std::ostringstream ost;
127  ost << "Calling beginJob for module " << description().moduleName() << "/'" << description().moduleLabel() << "'";
128  ex.addContext(ost.str());
129  throw;
130  }
131  }
ModuleDescription const & description() const
Definition: Worker.h:97
boost::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:186
std::string const & moduleName() const
std::string const & moduleLabel() const
void stdToEDM(std::exception const &e)
void charPtrToEDM(char const *c)
void stringToEDM(std::string &s)
virtual void implBeginJob()=0
void addContext(std::string const &context)
Definition: Exception.cc:227
State state_
Definition: Worker.h:179
void edm::Worker::beginStream ( StreamID  id,
StreamContext streamContext 
)

Definition at line 155 of file Worker.cc.

References actReg_, cms::Exception::addContext(), edm::convertException::badAllocToEDM(), trackerHits::c, edm::convertException::charPtrToEDM(), description(), alignCSCRings::e, cppFunctionSkipper::exception, Exception, implBeginStream(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::RunIndex::invalidRunIndex(), edm::StreamContext::kBeginStream, edm::ModuleCallingContext::kRunning, moduleCallingContext_, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), alignCSCRings::s, edm::StreamContext::setEventID(), edm::StreamContext::setLuminosityBlockIndex(), edm::StreamContext::setRunIndex(), edm::ModuleCallingContext::setState(), edm::StreamContext::setTimestamp(), edm::StreamContext::setTransition(), state_, edm::convertException::stdToEDM(), AlCaHLTBitMon_QueryRunRegistry::string, edm::convertException::stringToEDM(), and edm::convertException::unknownToEDM().

Referenced by edm::StreamSchedule::replaceModule().

155  {
156  try {
157  try {
158  streamContext.setTransition(StreamContext::Transition::kBeginStream);
159  streamContext.setEventID(EventID(0, 0, 0));
160  streamContext.setRunIndex(RunIndex::invalidRunIndex());
161  streamContext.setLuminosityBlockIndex(LuminosityBlockIndex::invalidLuminosityBlockIndex());
162  streamContext.setTimestamp(Timestamp());
163  ParentContext parentContext(&streamContext);
164  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
166  ModuleBeginStreamSignalSentry beginSentry(actReg_.get(), streamContext, moduleCallingContext_);
167  implBeginStream(id);
168  }
169  catch (cms::Exception& e) { throw; }
170  catch(std::bad_alloc& bda) { convertException::badAllocToEDM(); }
171  catch (std::exception& e) { convertException::stdToEDM(e); }
173  catch(char const* c) { convertException::charPtrToEDM(c); }
174  catch (...) { convertException::unknownToEDM(); }
175  }
176  catch(cms::Exception& ex) {
177  state_ = Exception;
178  std::ostringstream ost;
179  ost << "Calling beginStream for module " << description().moduleName() << "/'" << description().moduleLabel() << "'";
180  ex.addContext(ost.str());
181  throw;
182  }
183  }
ModuleDescription const & description() const
Definition: Worker.h:97
boost::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:186
std::string const & moduleName() const
std::string const & moduleLabel() const
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:181
static RunIndex invalidRunIndex()
Definition: RunIndex.cc:9
void stdToEDM(std::exception const &e)
static LuminosityBlockIndex invalidLuminosityBlockIndex()
void charPtrToEDM(char const *c)
void stringToEDM(std::string &s)
void addContext(std::string const &context)
Definition: Exception.cc:227
virtual void implBeginStream(StreamID)=0
State state_
Definition: Worker.h:179
void edm::Worker::clearCounters ( )
inline

Definition at line 116 of file Worker.h.

References timesExcept_, timesFailed_, timesPassed_, timesRun_, and timesVisited_.

Referenced by edm::StreamSchedule::clearCounters().

116  {
118  }
int timesExcept_
Definition: Worker.h:178
int timesPassed_
Definition: Worker.h:176
int timesRun_
Definition: Worker.h:174
int timesFailed_
Definition: Worker.h:177
int timesVisited_
Definition: Worker.h:175
ModuleDescription const* edm::Worker::descPtr ( ) const
inline

Definition at line 98 of file Worker.h.

References moduleCallingContext_, and edm::ModuleCallingContext::moduleDescription().

ModuleCallingContext moduleCallingContext_
Definition: Worker.h:181
ModuleDescription const * moduleDescription() const
ModuleDescription const& edm::Worker::description ( ) const
inline
template<typename T >
bool edm::Worker::doWork ( typename T::MyPrincipal &  ep,
EventSetup const &  c,
CPUTimer *const  timer,
StreamID  stream,
ParentContext const &  parentContext,
typename T::Context const *  context 
)

Definition at line 351 of file Worker.h.

References alignCSCRings::action, actions_, actReg_, edm::convertException::badAllocToEDM(), trackerHits::c, cached_exception_, cms::Exception::category(), edm::convertException::charPtrToEDM(), description(), alignCSCRings::e, cppFunctionSkipper::exception, Exception, Fail, edm::exception_actions::FailPath, edm::ExceptionToActionTable::find(), edm::ModuleCallingContext::getTopModuleCallingContext(), edm::exception_actions::IgnoreCompletely, edm::PathContext::isEndPath(), itemsToGetFromEvent(), edm::ParentContext::kPlaceInPath, edm::ModuleCallingContext::kRunning, moduleCallingContext_, Pass, edm::PlaceInPathContext::pathContext(), edm::ModuleCallingContext::placeInPathContext(), edm::printCmsExceptionWarning(), edm::ProductHolderIndexAmbiguous, Ready, edm::exception_actions::Rethrow, alignCSCRings::s, edm::ModuleCallingContext::setState(), edm::exception_actions::SkipEvent, state_, edm::convertException::stdToEDM(), stopwatch_, AlCaHLTBitMon_QueryRunRegistry::string, edm::convertException::stringToEDM(), timesExcept_, timesFailed_, timesPassed_, timesRun_, timesVisited_, edm::ModuleCallingContext::type(), and edm::convertException::unknownToEDM().

Referenced by edm::WorkerInPath::runWorker().

356  {
357 
358  // A RunStopwatch, but only if we are processing an event.
359  RunDualStopwatches stopwatch(T::isEvent_ ? stopwatch_ : RunStopwatch::StopwatchPointer(),
360  iTimer);
361 
362  if (T::isEvent_) {
363  ++timesVisited_;
364  }
365  bool rc = false;
366 
367  switch(state_) {
368  case Ready: break;
369  case Pass: return true;
370  case Fail: return false;
371  case Exception: {
372  cached_exception_->raise();
373  }
374  }
375 
376  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
377 
378  try {
379  try {
380 
381  if (T::isEvent_) {
382  ++timesRun_;
383 
384  // Prefetch products the module declares it consumes (not including the products it maybe consumes)
385  std::vector<ProductHolderIndexAndSkipBit> const& items = itemsToGetFromEvent();
386  for(auto const& item : items) {
387  ProductHolderIndex productHolderIndex = item.productHolderIndex();
388  bool skipCurrentProcess = item.skipCurrentProcess();
389  if(productHolderIndex != ProductHolderIndexAmbiguous) {
390  ep.prefetch(productHolderIndex, skipCurrentProcess, &moduleCallingContext_);
391  }
392  }
393  }
394 
396  ModuleSignalSentry<T> cpp(actReg_.get(), description(), context, &moduleCallingContext_);
397  rc = workerhelper::CallImpl<T>::call(this,streamID,ep,es, &moduleCallingContext_);
398 
399  if (rc) {
400  state_ = Pass;
401  if (T::isEvent_) ++timesPassed_;
402  } else {
403  state_ = Fail;
404  if (T::isEvent_) ++timesFailed_;
405  }
406  }
407  catch (cms::Exception& e) { throw; }
408  catch(std::bad_alloc& bda) { convertException::badAllocToEDM(); }
409  catch (std::exception& e) { convertException::stdToEDM(e); }
411  catch(char const* c) { convertException::charPtrToEDM(c); }
412  catch (...) { convertException::unknownToEDM(); }
413  }
414  catch(cms::Exception& ex) {
415 
416  // NOTE: the warning printed as a result of ignoring or failing
417  // a module will only be printed during the full true processing
418  // pass of this module
419 
420  // Get the action corresponding to this exception. However, if processing
421  // something other than an event (e.g. run, lumi) always rethrow.
423 
424  // If we are processing an endpath and the module was scheduled, treat SkipEvent or FailPath
425  // as IgnoreCompletely, so any subsequent OutputModules are still run.
426  // For unscheduled modules only treat FailPath as IgnoreCompletely but still allow SkipEvent to throw
427  ModuleCallingContext const* top_mcc = moduleCallingContext_.getTopModuleCallingContext();
428  if(top_mcc->type() == ParentContext::Type::kPlaceInPath &&
429  top_mcc->placeInPathContext()->pathContext()->isEndPath()) {
430 
433  }
434  switch(action) {
436  rc = true;
437  ++timesPassed_;
438  state_ = Pass;
439  exceptionContext<T>(ep, ex, &moduleCallingContext_);
440  edm::printCmsExceptionWarning("IgnoreCompletely", ex);
441  break;
442  default:
443  if (T::isEvent_) ++timesExcept_;
444  state_ = Exception;
445  cached_exception_.reset(ex.clone());
446  cached_exception_->raise();
447  }
448  }
449  return rc;
450  }
ModuleDescription const & description() const
Definition: Worker.h:97
ModuleCallingContext const * getTopModuleCallingContext() const
boost::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:186
std::string const & category() const
Definition: Exception.cc:183
exception_actions::ActionCodes find(const std::string &category) const
unsigned int ProductHolderIndex
ExceptionToActionTable const * actions_
Definition: Worker.h:183
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:181
int timesExcept_
Definition: Worker.h:178
boost::shared_ptr< CPUTimer > StopwatchPointer
Definition: RunStopwatch.h:22
void stdToEDM(std::exception const &e)
int timesPassed_
Definition: Worker.h:176
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e, edm::JobReport *jobRep=0, int rc=-1)
virtual std::vector< ProductHolderIndexAndSkipBit > const & itemsToGetFromEvent() const =0
void charPtrToEDM(char const *c)
void stringToEDM(std::string &s)
boost::shared_ptr< cms::Exception > cached_exception_
Definition: Worker.h:184
int timesRun_
Definition: Worker.h:174
RunStopwatch::StopwatchPointer stopwatch_
Definition: Worker.h:172
int timesFailed_
Definition: Worker.h:177
State state_
Definition: Worker.h:179
int timesVisited_
Definition: Worker.h:175
void edm::Worker::endJob ( void  )

Definition at line 133 of file Worker.cc.

References actReg_, cms::Exception::addContext(), edm::convertException::badAllocToEDM(), trackerHits::c, edm::convertException::charPtrToEDM(), description(), alignCSCRings::e, cppFunctionSkipper::exception, Exception, implEndJob(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), alignCSCRings::s, state_, edm::convertException::stdToEDM(), AlCaHLTBitMon_QueryRunRegistry::string, edm::convertException::stringToEDM(), and edm::convertException::unknownToEDM().

133  {
134  try {
135  try {
136  ModuleEndJobSignalSentry cpp(actReg_.get(), description());
137  implEndJob();
138  }
139  catch (cms::Exception& e) { throw; }
140  catch(std::bad_alloc& bda) { convertException::badAllocToEDM(); }
141  catch (std::exception& e) { convertException::stdToEDM(e); }
143  catch(char const* c) { convertException::charPtrToEDM(c); }
144  catch (...) { convertException::unknownToEDM(); }
145  }
146  catch(cms::Exception& ex) {
147  state_ = Exception;
148  std::ostringstream ost;
149  ost << "Calling endJob for module " << description().moduleName() << "/'" << description().moduleLabel() << "'";
150  ex.addContext(ost.str());
151  throw;
152  }
153  }
ModuleDescription const & description() const
Definition: Worker.h:97
boost::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:186
std::string const & moduleName() const
std::string const & moduleLabel() const
void stdToEDM(std::exception const &e)
virtual void implEndJob()=0
void charPtrToEDM(char const *c)
void stringToEDM(std::string &s)
void addContext(std::string const &context)
Definition: Exception.cc:227
State state_
Definition: Worker.h:179
void edm::Worker::endStream ( StreamID  id,
StreamContext streamContext 
)

Definition at line 185 of file Worker.cc.

References actReg_, cms::Exception::addContext(), edm::convertException::badAllocToEDM(), trackerHits::c, edm::convertException::charPtrToEDM(), description(), alignCSCRings::e, cppFunctionSkipper::exception, Exception, implEndStream(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::RunIndex::invalidRunIndex(), edm::StreamContext::kEndStream, edm::ModuleCallingContext::kRunning, moduleCallingContext_, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), alignCSCRings::s, edm::StreamContext::setEventID(), edm::StreamContext::setLuminosityBlockIndex(), edm::StreamContext::setRunIndex(), edm::ModuleCallingContext::setState(), edm::StreamContext::setTimestamp(), edm::StreamContext::setTransition(), state_, edm::convertException::stdToEDM(), AlCaHLTBitMon_QueryRunRegistry::string, edm::convertException::stringToEDM(), and edm::convertException::unknownToEDM().

185  {
186  try {
187  try {
188  streamContext.setTransition(StreamContext::Transition::kEndStream);
189  streamContext.setEventID(EventID(0, 0, 0));
190  streamContext.setRunIndex(RunIndex::invalidRunIndex());
191  streamContext.setLuminosityBlockIndex(LuminosityBlockIndex::invalidLuminosityBlockIndex());
192  streamContext.setTimestamp(Timestamp());
193  ParentContext parentContext(&streamContext);
194  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
196  ModuleEndStreamSignalSentry endSentry(actReg_.get(), streamContext, moduleCallingContext_);
197  implEndStream(id);
198  }
199  catch (cms::Exception& e) { throw; }
200  catch(std::bad_alloc& bda) { convertException::badAllocToEDM(); }
201  catch (std::exception& e) { convertException::stdToEDM(e); }
203  catch(char const* c) { convertException::charPtrToEDM(c); }
204  catch (...) { convertException::unknownToEDM(); }
205  }
206  catch(cms::Exception& ex) {
207  state_ = Exception;
208  std::ostringstream ost;
209  ost << "Calling endStream for module " << description().moduleName() << "/'" << description().moduleLabel() << "'";
210  ex.addContext(ost.str());
211  throw;
212  }
213  }
ModuleDescription const & description() const
Definition: Worker.h:97
boost::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:186
std::string const & moduleName() const
std::string const & moduleLabel() const
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:181
static RunIndex invalidRunIndex()
Definition: RunIndex.cc:9
void stdToEDM(std::exception const &e)
static LuminosityBlockIndex invalidLuminosityBlockIndex()
void charPtrToEDM(char const *c)
void stringToEDM(std::string &s)
void addContext(std::string const &context)
Definition: Exception.cc:227
virtual void implEndStream(StreamID)=0
State state_
Definition: Worker.h:179
virtual void edm::Worker::implBeginJob ( )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by beginJob().

virtual void edm::Worker::implBeginStream ( StreamID  )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by beginStream().

virtual bool edm::Worker::implDo ( EventPrincipal ,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protectedpure virtual
virtual bool edm::Worker::implDoBegin ( RunPrincipal rp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protectedpure virtual
virtual bool edm::Worker::implDoBegin ( LuminosityBlockPrincipal lbp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

virtual bool edm::Worker::implDoEnd ( RunPrincipal rp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protectedpure virtual
virtual bool edm::Worker::implDoEnd ( LuminosityBlockPrincipal lbp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

virtual bool edm::Worker::implDoStreamBegin ( StreamID  id,
RunPrincipal rp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protectedpure virtual
virtual bool edm::Worker::implDoStreamBegin ( StreamID  id,
LuminosityBlockPrincipal lbp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

virtual bool edm::Worker::implDoStreamEnd ( StreamID  id,
RunPrincipal rp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protectedpure virtual
virtual bool edm::Worker::implDoStreamEnd ( StreamID  id,
LuminosityBlockPrincipal lbp,
EventSetup const &  c,
ModuleCallingContext const *  mcc 
)
protectedpure virtual

Implemented in edm::WorkerT< T >.

virtual void edm::Worker::implEndJob ( )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by endJob().

virtual void edm::Worker::implEndStream ( StreamID  )
protectedpure virtual

Implemented in edm::WorkerT< T >.

Referenced by endStream().

virtual void edm::Worker::implPostForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by postForkReacquireResources().

virtual void edm::Worker::implPreForkReleaseResources ( )
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by preForkReleaseResources().

virtual void edm::Worker::implRespondToCloseInputFile ( FileBlock const &  fb)
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by respondToCloseInputFile().

virtual void edm::Worker::implRespondToOpenInputFile ( FileBlock const &  fb)
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by respondToOpenInputFile().

virtual void edm::Worker::itemsMayGet ( BranchType  ,
std::vector< ProductHolderIndexAndSkipBit > &   
) const
privatepure virtual

Implemented in edm::WorkerT< T >.

virtual void edm::Worker::itemsToGet ( BranchType  ,
std::vector< ProductHolderIndexAndSkipBit > &   
) const
privatepure virtual

Implemented in edm::WorkerT< T >.

virtual std::vector<ProductHolderIndexAndSkipBit> const& edm::Worker::itemsToGetFromEvent ( ) const
privatepure virtual

Implemented in edm::WorkerT< T >.

Referenced by doWork().

virtual Types edm::Worker::moduleType ( ) const
pure virtual
Worker& edm::Worker::operator= ( Worker const &  )
delete
void edm::Worker::pathFinished ( EventPrincipal iEvent)

Definition at line 219 of file Worker.cc.

References earlyDeleteHelper_, and edm::EarlyDeleteHelper::pathFinished().

219  {
220  if(earlyDeleteHelper_) {
222  }
223  }
EarlyDeleteHelper * earlyDeleteHelper_
Definition: Worker.h:188
int iEvent
Definition: GenABIO.cc:243
void pathFinished(EventPrincipal &)
void edm::Worker::postDoEvent ( EventPrincipal iEvent)

Definition at line 224 of file Worker.cc.

References earlyDeleteHelper_, and edm::EarlyDeleteHelper::moduleRan().

Referenced by edm::WorkerT< T >::implDo().

224  {
225  if(earlyDeleteHelper_) {
227  }
228  }
EarlyDeleteHelper * earlyDeleteHelper_
Definition: Worker.h:188
int iEvent
Definition: GenABIO.cc:243
void moduleRan(EventPrincipal &)
void edm::Worker::postForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)
inline

Definition at line 90 of file Worker.h.

References implPostForkReacquireResources().

Referenced by edm::Schedule::postForkReacquireResources().

90 {implPostForkReacquireResources(iChildIndex, iNumberOfChildren);}
virtual void implPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)=0
void edm::Worker::preForkReleaseResources ( )
inline

Definition at line 89 of file Worker.h.

References implPreForkReleaseResources().

Referenced by edm::Schedule::preForkReleaseResources().

virtual void implPreForkReleaseResources()=0
void edm::Worker::reset ( void  )
inline

Definition at line 92 of file Worker.h.

References Ready, and state_.

Referenced by edm::WorkerManager::resetAll().

92 { state_ = Ready; }
State state_
Definition: Worker.h:179
void edm::Worker::resetModuleDescription ( ModuleDescription const *  iDesc)
protected
void edm::Worker::respondToCloseInputFile ( FileBlock const &  fb)
inline

Definition at line 87 of file Worker.h.

References implRespondToCloseInputFile().

Referenced by edm::Schedule::respondToCloseInputFile().

virtual void implRespondToCloseInputFile(FileBlock const &fb)=0
void edm::Worker::respondToOpenInputFile ( FileBlock const &  fb)
inline

Definition at line 86 of file Worker.h.

References implRespondToOpenInputFile().

Referenced by edm::Schedule::respondToOpenInputFile().

virtual void implRespondToOpenInputFile(FileBlock const &fb)=0
void edm::Worker::setActivityRegistry ( boost::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 97 of file Worker.cc.

References actReg_, and edm::areg.

97  {
98  actReg_ = areg;
99  }
boost::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:186
areg
Definition: Schedule.cc:362
void edm::Worker::setEarlyDeleteHelper ( EarlyDeleteHelper iHelper)

Definition at line 101 of file Worker.cc.

References earlyDeleteHelper_.

101  {
102  earlyDeleteHelper_=iHelper;
103  }
EarlyDeleteHelper * earlyDeleteHelper_
Definition: Worker.h:188
State edm::Worker::state ( ) const
inline

Definition at line 127 of file Worker.h.

References state_.

127 { return state_; }
State state_
Definition: Worker.h:179
std::pair<double, double> edm::Worker::timeCpuReal ( ) const
inline

Definition at line 112 of file Worker.h.

References stopwatch_.

Referenced by edm::fillWorkerTimingSummaryAux().

112  {
113  return std::pair<double, double>(stopwatch_->cpuTime(), stopwatch_->realTime());
114  }
RunStopwatch::StopwatchPointer stopwatch_
Definition: Worker.h:172
int edm::Worker::timesExcept ( ) const
inline

Definition at line 126 of file Worker.h.

References timesExcept_.

Referenced by edm::fillWorkerSummaryAux().

126 { return timesExcept_; }
int timesExcept_
Definition: Worker.h:178
int edm::Worker::timesFailed ( ) const
inline

Definition at line 125 of file Worker.h.

References timesFailed_.

Referenced by edm::fillWorkerSummaryAux().

125 { return timesFailed_; }
int timesFailed_
Definition: Worker.h:177
int edm::Worker::timesPass ( ) const
inline

Definition at line 129 of file Worker.h.

References timesPassed().

129 { return timesPassed(); } // for backward compatibility only - to be removed soon
int timesPassed() const
Definition: Worker.h:124
int edm::Worker::timesPassed ( ) const
inline

Definition at line 124 of file Worker.h.

References timesPassed_.

Referenced by edm::fillWorkerSummaryAux(), and timesPass().

124 { return timesPassed_; }
int timesPassed_
Definition: Worker.h:176
int edm::Worker::timesRun ( ) const
inline

Definition at line 122 of file Worker.h.

References timesRun_.

Referenced by edm::fillWorkerSummaryAux(), and edm::fillWorkerTimingSummaryAux().

122 { return timesRun_; }
int timesRun_
Definition: Worker.h:174
int edm::Worker::timesVisited ( ) const
inline

Definition at line 123 of file Worker.h.

References timesVisited_.

Referenced by edm::fillWorkerSummaryAux(), and edm::fillWorkerTimingSummaryAux().

123 { return timesVisited_; }
int timesVisited_
Definition: Worker.h:175
virtual void edm::Worker::updateLookup ( BranchType  iBranchType,
ProductHolderIndexHelper const &   
)
pure virtual

Implemented in edm::WorkerT< T >.

void edm::Worker::useStopwatch ( )

Definition at line 215 of file Worker.cc.

References stopwatch_.

Referenced by edm::WorkerManager::addToAllWorkers().

215  {
216  stopwatch_.reset(new RunStopwatch::StopwatchPointer::element_type);
217  }
RunStopwatch::StopwatchPointer stopwatch_
Definition: Worker.h:172
virtual std::string edm::Worker::workerType ( ) const
protectedpure virtual

Implemented in edm::WorkerT< T >.

Friends And Related Function Documentation

template<typename O >
friend class workerhelper::CallImpl
friend

Definition at line 132 of file Worker.h.

Member Data Documentation

ExceptionToActionTable const* edm::Worker::actions_
private

Definition at line 183 of file Worker.h.

Referenced by doWork().

boost::shared_ptr<ActivityRegistry> edm::Worker::actReg_
private

Definition at line 186 of file Worker.h.

Referenced by beginJob(), beginStream(), doWork(), endJob(), endStream(), and setActivityRegistry().

boost::shared_ptr<cms::Exception> edm::Worker::cached_exception_
private

Definition at line 184 of file Worker.h.

Referenced by doWork().

EarlyDeleteHelper* edm::Worker::earlyDeleteHelper_
private

Definition at line 188 of file Worker.h.

Referenced by pathFinished(), postDoEvent(), and setEarlyDeleteHelper().

ModuleCallingContext edm::Worker::moduleCallingContext_
private

Definition at line 181 of file Worker.h.

Referenced by beginStream(), descPtr(), description(), doWork(), endStream(), and resetModuleDescription().

State edm::Worker::state_
private

Definition at line 179 of file Worker.h.

Referenced by beginJob(), beginStream(), doWork(), endJob(), endStream(), reset(), and state().

RunStopwatch::StopwatchPointer edm::Worker::stopwatch_
private

Definition at line 172 of file Worker.h.

Referenced by doWork(), timeCpuReal(), and useStopwatch().

int edm::Worker::timesExcept_
private

Definition at line 178 of file Worker.h.

Referenced by clearCounters(), doWork(), and timesExcept().

int edm::Worker::timesFailed_
private

Definition at line 177 of file Worker.h.

Referenced by clearCounters(), doWork(), and timesFailed().

int edm::Worker::timesPassed_
private

Definition at line 176 of file Worker.h.

Referenced by clearCounters(), doWork(), and timesPassed().

int edm::Worker::timesRun_
private

Definition at line 174 of file Worker.h.

Referenced by clearCounters(), doWork(), and timesRun().

int edm::Worker::timesVisited_
private

Definition at line 175 of file Worker.h.

Referenced by clearCounters(), doWork(), and timesVisited().