CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Worker.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_Worker_h
2 #define FWCore_Framework_Worker_h
3 
4 /*----------------------------------------------------------------------
5 
6 Worker: this is a basic scheduling unit - an abstract base class to
7 something that is really a producer or filter.
8 
9 A worker will not actually call through to the module unless it is
10 in a Ready state. After a module is actually run, the state will not
11 be Ready. The Ready state can only be reestablished by doing a reset().
12 
13 Pre/post module signals are posted only in the Ready state.
14 
15 Execution statistics are kept here.
16 
17 If a module has thrown an exception during execution, that exception
18 will be rethrown if the worker is entered again and the state is not Ready.
19 In other words, execution results (status) are cached and reused until
20 the worker is reset().
21 
22 ----------------------------------------------------------------------*/
23 
45 
47 
48 #include <map>
49 #include <memory>
50 #include <sstream>
51 #include <string>
52 #include <vector>
53 
54 namespace edm {
55  class EventPrincipal;
56  class EarlyDeleteHelper;
57  class ProductHolderIndexHelper;
58  class ProductHolderIndexAndSkipBit;
59  class StreamID;
60  class StreamContext;
61  class ProductRegistry;
62  class ThinnedAssociationsHelper;
63 
64  namespace workerhelper {
65  template< typename O> class CallImpl;
66  }
67 
68  class Worker {
69  public:
70  enum State { Ready, Pass, Fail, Exception };
72 
73  Worker(ModuleDescription const& iMD, ExceptionToActionTable const* iActions);
74  virtual ~Worker();
75 
76  Worker(Worker const&) = delete; // Disallow copying and moving
77  Worker& operator=(Worker const&) = delete; // Disallow copying and moving
78 
79  template <typename T>
80  bool doWork(typename T::MyPrincipal const&, EventSetup const& c,
81  StreamID stream,
82  ParentContext const& parentContext,
83  typename T::Context const* context);
84  void beginJob() ;
85  void endJob();
86  void beginStream(StreamID id, StreamContext& streamContext);
87  void endStream(StreamID id, StreamContext& streamContext);
90 
92  void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren) {implPostForkReacquireResources(iChildIndex, iNumberOfChildren);}
94 
95  void reset() { state_ = Ready; }
96 
97  void pathFinished(EventPrincipal const&);
98  void postDoEvent(EventPrincipal const&);
99 
104  void setActivityRegistry(std::shared_ptr<ActivityRegistry> areg);
105 
107 
108  //Used to make EDGetToken work
109  virtual void updateLookup(BranchType iBranchType,
110  ProductHolderIndexHelper const&) = 0;
111 
112  virtual void modulesDependentUpon(std::vector<const char*>& oModuleLabels, bool iPrint) const = 0;
113 
114  virtual void modulesWhoseProductsAreConsumed(std::vector<ModuleDescription const*>& modules,
115  ProductRegistry const& preg,
116  std::map<std::string, ModuleDescription const*> const& labelsToDesc) const = 0;
117 
118  virtual std::vector<ConsumesInfo> consumesInfo() const = 0;
119 
120  virtual Types moduleType() const =0;
121 
122  void clearCounters() {
124  }
125 
126  int timesRun() const { return timesRun_; }
127  int timesVisited() const { return timesVisited_; }
128  int timesPassed() const { return timesPassed_; }
129  int timesFailed() const { return timesFailed_; }
130  int timesExcept() const { return timesExcept_; }
131  State state() const { return state_; }
132 
133  int timesPass() const { return timesPassed(); } // for backward compatibility only - to be removed soon
134 
135  protected:
136  template<typename O> friend class workerhelper::CallImpl;
137  virtual std::string workerType() const = 0;
138  virtual bool implDo(EventPrincipal const&, EventSetup const& c,
139  ModuleCallingContext const* mcc) = 0;
140  virtual bool implDoPrePrefetchSelection(StreamID id,
141  EventPrincipal const& ep,
142  ModuleCallingContext const* mcc) = 0;
143  virtual bool implDoBegin(RunPrincipal const& rp, EventSetup const& c,
144  ModuleCallingContext const* mcc) = 0;
145  virtual bool implDoStreamBegin(StreamID id, RunPrincipal const& rp, EventSetup const& c,
146  ModuleCallingContext const* mcc) = 0;
147  virtual bool implDoStreamEnd(StreamID id, RunPrincipal const& rp, EventSetup const& c,
148  ModuleCallingContext const* mcc) = 0;
149  virtual bool implDoEnd(RunPrincipal const& rp, EventSetup const& c,
150  ModuleCallingContext const* mcc) = 0;
151  virtual bool implDoBegin(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
152  ModuleCallingContext const* mcc) = 0;
153  virtual bool implDoStreamBegin(StreamID id, LuminosityBlockPrincipal const& lbp, EventSetup const& c,
154  ModuleCallingContext const* mcc) = 0;
155  virtual bool implDoStreamEnd(StreamID id, LuminosityBlockPrincipal const& lbp, EventSetup const& c,
156  ModuleCallingContext const* mcc) = 0;
157  virtual bool implDoEnd(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
158  ModuleCallingContext const* mcc) = 0;
159  virtual void implBeginJob() = 0;
160  virtual void implEndJob() = 0;
161  virtual void implBeginStream(StreamID) = 0;
162  virtual void implEndStream(StreamID) = 0;
163 
165 
167 
168  private:
169 
170  virtual void itemsToGet(BranchType, std::vector<ProductHolderIndexAndSkipBit>&) const = 0;
171  virtual void itemsMayGet(BranchType, std::vector<ProductHolderIndexAndSkipBit>&) const = 0;
172 
173  virtual std::vector<ProductHolderIndexAndSkipBit> const& itemsToGetFromEvent() const = 0;
174 
175  virtual void implRespondToOpenInputFile(FileBlock const& fb) = 0;
176  virtual void implRespondToCloseInputFile(FileBlock const& fb) = 0;
177 
178  virtual void implPreForkReleaseResources() = 0;
179  virtual void implPostForkReacquireResources(unsigned int iChildIndex,
180  unsigned int iNumberOfChildren) = 0;
182 
189 
191 
192  ExceptionToActionTable const* actions_; // memory assumed to be managed elsewhere
194 
195  std::shared_ptr<ActivityRegistry> actReg_; // We do not use propagate_const because the registry itself is mutable.
196 
198  };
199 
200  namespace {
201  template <typename T>
202  class ModuleSignalSentry {
203  public:
204  ModuleSignalSentry(ActivityRegistry *a,
205  typename T::Context const* context,
206  ModuleCallingContext const* moduleCallingContext) :
207  a_(a), context_(context), moduleCallingContext_(moduleCallingContext) {
208 
209  if(a_) T::preModuleSignal(a_, context, moduleCallingContext_);
210  }
211 
212  ~ModuleSignalSentry() {
213  if(a_) T::postModuleSignal(a_, context_, moduleCallingContext_);
214  }
215 
216  private:
217  ActivityRegistry* a_; // We do not use propagate_const because the registry itself is mutable.
218  typename T::Context const* context_;
219  ModuleCallingContext const* moduleCallingContext_;
220  };
221 
222  template <typename T>
223  void exceptionContext(typename T::MyPrincipal const& principal,
224  cms::Exception& ex,
225  ModuleCallingContext const* mcc) {
226 
227  ModuleCallingContext const* imcc = mcc;
228  while(imcc->type() == ParentContext::Type::kModule) {
229  std::ostringstream iost;
230  iost << "Calling method for unscheduled module "
231  << imcc->moduleDescription()->moduleName() << "/'"
232  << imcc->moduleDescription()->moduleLabel() << "'";
233  ex.addContext(iost.str());
234  imcc = imcc->moduleCallingContext();
235  }
236  if(imcc->type() == ParentContext::Type::kInternal) {
237  std::ostringstream iost;
238  iost << "Calling method for unscheduled module "
239  << imcc->moduleDescription()->moduleName() << "/'"
240  << imcc->moduleDescription()->moduleLabel() << "' (probably inside some kind of mixing module)";
241  ex.addContext(iost.str());
242  imcc = imcc->internalContext()->moduleCallingContext();
243  }
244  while(imcc->type() == ParentContext::Type::kModule) {
245  std::ostringstream iost;
246  iost << "Calling method for unscheduled module "
247  << imcc->moduleDescription()->moduleName() << "/'"
248  << imcc->moduleDescription()->moduleLabel() << "'";
249  ex.addContext(iost.str());
250  imcc = imcc->moduleCallingContext();
251  }
252  std::ostringstream ost;
253  if (T::isEvent_) {
254  ost << "Calling event method";
255  }
256  else {
257  // It should be impossible to get here, because
258  // this function only gets called when the IgnoreCompletely
259  // exception behavior is active, which can only be true
260  // for events.
261  ost << "Calling unknown function";
262  }
263  ost << " for module " << imcc->moduleDescription()->moduleName() << "/'" << imcc->moduleDescription()->moduleLabel() << "'";
264  ex.addContext(ost.str());
265 
266  if (imcc->type() == ParentContext::Type::kPlaceInPath) {
267  ost.str("");
268  ost << "Running path '";
269  ost << imcc->placeInPathContext()->pathContext()->pathName() << "'";
270  ex.addContext(ost.str());
271  }
272  ost.str("");
273  ost << "Processing ";
274  ost << principal.id();
275  ex.addContext(ost.str());
276  }
277  }
278 
279  namespace workerhelper {
280  template<>
282  public:
284  static bool call(Worker* iWorker, StreamID,
285  EventPrincipal const& ep, EventSetup const& es,
286  ActivityRegistry* /* actReg */,
287  ModuleCallingContext const* mcc,
288  Arg::Context const* /* context*/) {
289  //Signal sentry is handled by the module
290  return iWorker->implDo(ep,es, mcc);
291  }
292  static bool prePrefetchSelection(Worker* iWorker,StreamID id,
293  typename Arg::MyPrincipal const& ep,
294  ModuleCallingContext const* mcc) {
295  return iWorker->implDoPrePrefetchSelection(id,ep,mcc);
296  }
297  };
298 
299  template<>
301  public:
303  static bool call(Worker* iWorker,StreamID,
304  RunPrincipal const& ep, EventSetup const& es,
305  ActivityRegistry* actReg,
306  ModuleCallingContext const* mcc,
307  Arg::Context const* context) {
308  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
309  return iWorker->implDoBegin(ep,es, mcc);
310  }
311  static bool prePrefetchSelection(Worker* iWorker,StreamID id,
312  typename Arg::MyPrincipal const& ep,
313  ModuleCallingContext const* mcc) {
314  return true;
315  }
316  };
317  template<>
319  public:
321  static bool call(Worker* iWorker,StreamID id,
322  RunPrincipal const & ep, EventSetup const& es,
323  ActivityRegistry* actReg,
324  ModuleCallingContext const* mcc,
325  Arg::Context const* context) {
326  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
327  return iWorker->implDoStreamBegin(id,ep,es, mcc);
328  }
329  static bool prePrefetchSelection(Worker* iWorker,StreamID id,
330  typename Arg::MyPrincipal const& ep,
331  ModuleCallingContext const* mcc) {
332  return true;
333  }
334  };
335  template<>
337  public:
339  static bool call(Worker* iWorker,StreamID,
340  RunPrincipal const& ep, EventSetup const& es,
341  ActivityRegistry* actReg,
342  ModuleCallingContext const* mcc,
343  Arg::Context const* context) {
344  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
345  return iWorker->implDoEnd(ep,es, mcc);
346  }
347  static bool prePrefetchSelection(Worker* iWorker,StreamID id,
348  typename Arg::MyPrincipal const& ep,
349  ModuleCallingContext const* mcc) {
350  return true;
351  }
352  };
353  template<>
355  public:
357  static bool call(Worker* iWorker,StreamID id,
358  RunPrincipal const& ep, EventSetup const& es,
359  ActivityRegistry* actReg,
360  ModuleCallingContext const* mcc,
361  Arg::Context const* context) {
362  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
363  return iWorker->implDoStreamEnd(id,ep,es, mcc);
364  }
365  static bool prePrefetchSelection(Worker* iWorker,StreamID id,
366  typename Arg::MyPrincipal const& ep,
367  ModuleCallingContext const* mcc) {
368  return true;
369  }
370  };
371 
372  template<>
374  public:
376  static bool call(Worker* iWorker,StreamID,
377  LuminosityBlockPrincipal const& ep, EventSetup const& es,
378  ActivityRegistry* actReg,
379  ModuleCallingContext const* mcc,
380  Arg::Context const* context) {
381  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
382  return iWorker->implDoBegin(ep,es, mcc);
383  }
384 
385  static bool prePrefetchSelection(Worker* iWorker,StreamID id,
386  typename Arg::MyPrincipal const& ep,
387  ModuleCallingContext const* mcc) {
388  return true;
389  }
390  };
391  template<>
393  public:
395  static bool call(Worker* iWorker,StreamID id,
396  LuminosityBlockPrincipal const& ep, EventSetup const& es,
397  ActivityRegistry* actReg,
398  ModuleCallingContext const* mcc,
399  Arg::Context const* context) {
400  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
401  return iWorker->implDoStreamBegin(id,ep,es, mcc);
402  }
403 
404  static bool prePrefetchSelection(Worker* iWorker,StreamID id,
405  typename Arg::MyPrincipal const& ep,
406  ModuleCallingContext const* mcc) {
407  return true;
408  }
409 };
410 
411  template<>
413  public:
415  static bool call(Worker* iWorker,StreamID,
416  LuminosityBlockPrincipal const& ep, EventSetup const& es,
417  ActivityRegistry* actReg,
418  ModuleCallingContext const* mcc,
419  Arg::Context const* context) {
420  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
421  return iWorker->implDoEnd(ep,es, mcc);
422  }
423  static bool prePrefetchSelection(Worker* iWorker,StreamID id,
424  typename Arg::MyPrincipal const& ep,
425  ModuleCallingContext const* mcc) {
426  return true;
427  }
428 
429  };
430  template<>
432  public:
434  static bool call(Worker* iWorker,StreamID id,
435  LuminosityBlockPrincipal const& ep, EventSetup const& es,
436  ActivityRegistry* actReg,
437  ModuleCallingContext const* mcc,
438  Arg::Context const* context) {
439  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
440  return iWorker->implDoStreamEnd(id,ep,es, mcc);
441  }
442 
443  static bool prePrefetchSelection(Worker* iWorker,StreamID id,
444  typename Arg::MyPrincipal const& ep,
445  ModuleCallingContext const* mcc) {
446  return true;
447  }
448  };
449  }
450 
451  template <typename T>
452  bool Worker::doWork(typename T::MyPrincipal const& ep,
453  EventSetup const& es,
454  StreamID streamID,
455  ParentContext const& parentContext,
456  typename T::Context const* context) {
457 
458  if (T::isEvent_) {
459  ++timesVisited_;
460  }
461  bool rc = false;
462 
463  switch(state_) {
464  case Ready: break;
465  case Pass: return true;
466  case Fail: return false;
467  case Exception: {
468  cached_exception_->raise();
469  }
470  }
471 
472  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
473 
474  try {
475  convertException::wrap([&]() {
476 
477  if (T::isEvent_) {
478  ++timesRun_;
479 
480  //if have TriggerResults based selection we want to reject the event before doing prefetching
482  state_ = Pass;
483  ++timesPassed_;
484  rc = true;
485  return;
486  }
487  // Prefetch products the module declares it consumes (not including the products it maybe consumes)
488  std::vector<ProductHolderIndexAndSkipBit> const& items = itemsToGetFromEvent();
489  for(auto const& item : items) {
490  ProductHolderIndex productHolderIndex = item.productHolderIndex();
491  bool skipCurrentProcess = item.skipCurrentProcess();
492  if(productHolderIndex != ProductHolderIndexAmbiguous) {
493  ep.prefetch(productHolderIndex, skipCurrentProcess, &moduleCallingContext_);
494  }
495  }
496  }
497 
499  rc = workerhelper::CallImpl<T>::call(this,streamID,ep,es, actReg_.get(), &moduleCallingContext_, context);
500 
501  if (rc) {
502  state_ = Pass;
503  if (T::isEvent_) ++timesPassed_;
504  } else {
505  state_ = Fail;
506  if (T::isEvent_) ++timesFailed_;
507  }
508  });
509  }
510  catch(cms::Exception& ex) {
511 
512  // NOTE: the warning printed as a result of ignoring or failing
513  // a module will only be printed during the full true processing
514  // pass of this module
515 
516  // Get the action corresponding to this exception. However, if processing
517  // something other than an event (e.g. run, lumi) always rethrow.
519 
520  // If we are processing an endpath and the module was scheduled, treat SkipEvent or FailPath
521  // as IgnoreCompletely, so any subsequent OutputModules are still run.
522  // For unscheduled modules only treat FailPath as IgnoreCompletely but still allow SkipEvent to throw
524  if(top_mcc->type() == ParentContext::Type::kPlaceInPath &&
525  top_mcc->placeInPathContext()->pathContext()->isEndPath()) {
526 
529  }
530  switch(action) {
532  rc = true;
533  ++timesPassed_;
534  state_ = Pass;
535  exceptionContext<T>(ep, ex, &moduleCallingContext_);
536  edm::printCmsExceptionWarning("IgnoreCompletely", ex);
537  break;
538  default:
539  if (T::isEvent_) ++timesExcept_;
540  state_ = Exception;
541  cached_exception_ = std::shared_ptr<cms::Exception>(ex.clone()); // propagate_const<T> has no reset() function
542  cached_exception_->raise();
543  }
544  }
545  return rc;
546  }
547 }
548 #endif
static bool call(Worker *iWorker, StreamID, LuminosityBlockPrincipal const &ep, EventSetup const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:415
void resetModuleDescription(ModuleDescription const *)
Definition: Worker.cc:98
ModuleDescription const & description() const
Definition: Worker.h:100
virtual bool implDoStreamBegin(StreamID id, RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)=0
void setEarlyDeleteHelper(EarlyDeleteHelper *iHelper)
Definition: Worker.cc:94
virtual void modulesWhoseProductsAreConsumed(std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc) const =0
static bool prePrefetchSelection(Worker *iWorker, StreamID id, typename Arg::MyPrincipal const &ep, ModuleCallingContext const *mcc)
Definition: Worker.h:347
ModuleCallingContext const * getTopModuleCallingContext() const
virtual void implPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)=0
virtual ~Worker()
Definition: Worker.cc:87
static bool call(Worker *iWorker, StreamID id, RunPrincipal const &ep, EventSetup const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:357
void endJob()
Definition: Worker.cc:120
OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > Arg
Definition: Worker.h:394
OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > Arg
Definition: Worker.h:338
int timesPassed() const
Definition: Worker.h:128
virtual void implRespondToCloseInputFile(FileBlock const &fb)=0
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:195
bool doWork(typename T::MyPrincipal const &, EventSetup const &c, StreamID stream, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:452
State state() const
Definition: Worker.h:131
void clearCounters()
Definition: Worker.h:122
static bool call(Worker *iWorker, StreamID, LuminosityBlockPrincipal const &ep, EventSetup const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:376
std::string const & moduleName() const
std::string const & category() const
Definition: Exception.cc:183
static bool call(Worker *iWorker, StreamID, RunPrincipal const &ep, EventSetup const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:303
exception_actions::ActionCodes find(const std::string &category) const
static bool call(Worker *iWorker, StreamID, EventPrincipal const &ep, EventSetup const &es, ActivityRegistry *, ModuleCallingContext const *mcc, Arg::Context const *)
Definition: Worker.h:284
static bool prePrefetchSelection(Worker *iWorker, StreamID id, typename Arg::MyPrincipal const &ep, ModuleCallingContext const *mcc)
Definition: Worker.h:423
static bool prePrefetchSelection(Worker *iWorker, StreamID id, typename Arg::MyPrincipal const &ep, ModuleCallingContext const *mcc)
Definition: Worker.h:385
unsigned int ProductHolderIndex
ActivityRegistry * activityRegistry()
Definition: Worker.h:166
static bool call(Worker *iWorker, StreamID id, LuminosityBlockPrincipal const &ep, EventSetup const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:434
void beginStream(StreamID id, StreamContext &streamContext)
Definition: Worker.cc:136
virtual void implPreForkReleaseResources()=0
static bool prePrefetchSelection(Worker *iWorker, StreamID id, typename Arg::MyPrincipal const &ep, ModuleCallingContext const *mcc)
Definition: Worker.h:404
virtual std::string workerType() const =0
virtual void itemsToGet(BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const =0
ExceptionToActionTable const * actions_
Definition: Worker.h:192
void setActivityRegistry(std::shared_ptr< ActivityRegistry > areg)
Definition: Worker.cc:90
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:190
BranchType
Definition: BranchType.h:11
bool isEndPath() const
Definition: PathContext.h:42
int timesExcept() const
Definition: Worker.h:130
int timesExcept_
Definition: Worker.h:187
virtual void updateLookup(BranchType iBranchType, ProductHolderIndexHelper const &)=0
Worker & operator=(Worker const &)=delete
virtual bool implDoEnd(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)=0
void reset()
Definition: Worker.h:95
virtual void implRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)=0
int timesVisited() const
Definition: Worker.h:127
PathContext const * pathContext() const
int timesPassed_
Definition: Worker.h:185
OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > Arg
Definition: Worker.h:302
ModuleDescription const * descPtr() const
Definition: Worker.h:101
virtual bool implDoBegin(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)=0
ModuleDescription const * moduleDescription() const
static bool prePrefetchSelection(Worker *iWorker, StreamID id, typename Arg::MyPrincipal const &ep, ModuleCallingContext const *mcc)
Definition: Worker.h:443
virtual std::vector< ConsumesInfo > consumesInfo() const =0
void registerThinnedAssociations(ProductRegistry const &registry, ThinnedAssociationsHelper &helper)
Definition: Worker.h:93
OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > Arg
Definition: Worker.h:414
Worker(ModuleDescription const &iMD, ExceptionToActionTable const *iActions)
Definition: Worker.cc:71
int timesRun() const
Definition: Worker.h:126
static bool call(Worker *iWorker, StreamID id, RunPrincipal const &ep, EventSetup const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:321
static bool call(Worker *iWorker, StreamID, RunPrincipal const &ep, EventSetup const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:339
edm::propagate_const< std::shared_ptr< cms::Exception > > cached_exception_
Definition: Worker.h:193
OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > Arg
Definition: Worker.h:433
virtual void implEndJob()=0
virtual std::vector< ProductHolderIndexAndSkipBit > const & itemsToGetFromEvent() const =0
areg
Definition: Schedule.cc:374
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
Definition: Worker.h:92
virtual Types moduleType() const =0
OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > Arg
Definition: Worker.h:283
virtual bool implDoPrePrefetchSelection(StreamID id, EventPrincipal const &ep, ModuleCallingContext const *mcc)=0
OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > Arg
Definition: Worker.h:320
virtual void implBeginJob()=0
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:88
virtual void itemsMayGet(BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const =0
int timesRun_
Definition: Worker.h:183
int timesPass() const
Definition: Worker.h:133
void pathFinished(EventPrincipal const &)
Definition: Worker.cc:184
void addContext(std::string const &context)
Definition: Exception.cc:227
virtual void implBeginStream(StreamID)=0
virtual void modulesDependentUpon(std::vector< const char * > &oModuleLabels, bool iPrint) const =0
string action
Definition: mps_fire.py:28
static bool call(Worker *iWorker, StreamID id, LuminosityBlockPrincipal const &ep, EventSetup const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:395
virtual void implEndStream(StreamID)=0
int timesFailed() const
Definition: Worker.h:129
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:89
void preForkReleaseResources()
Definition: Worker.h:91
static bool prePrefetchSelection(Worker *iWorker, StreamID id, typename Arg::MyPrincipal const &ep, ModuleCallingContext const *mcc)
Definition: Worker.h:292
virtual bool implDo(EventPrincipal const &, EventSetup const &c, ModuleCallingContext const *mcc)=0
double a
Definition: hdecay.h:121
void beginJob()
Definition: Worker.cc:104
void endStream(StreamID id, StreamContext &streamContext)
Definition: Worker.cc:160
void postDoEvent(EventPrincipal const &)
Definition: Worker.cc:189
int timesFailed_
Definition: Worker.h:186
virtual bool implDoStreamEnd(StreamID id, RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)=0
auto wrap(F iFunc) -> decltype(iFunc())
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:197
static bool prePrefetchSelection(Worker *iWorker, StreamID id, typename Arg::MyPrincipal const &ep, ModuleCallingContext const *mcc)
Definition: Worker.h:311
static Interceptor::Registry registry("Interceptor")
OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > Arg
Definition: Worker.h:375
static bool prePrefetchSelection(Worker *iWorker, StreamID id, typename Arg::MyPrincipal const &ep, ModuleCallingContext const *mcc)
Definition: Worker.h:365
preg
Definition: Schedule.cc:374
virtual void implRespondToOpenInputFile(FileBlock const &fb)=0
PlaceInPathContext const * placeInPathContext() const
OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > Arg
Definition: Worker.h:356
State state_
Definition: Worker.h:188
static bool prePrefetchSelection(Worker *iWorker, StreamID id, typename Arg::MyPrincipal const &ep, ModuleCallingContext const *mcc)
Definition: Worker.h:329
int timesVisited_
Definition: Worker.h:184
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)