CMS 3D CMS Logo

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 
53 
55 
56 #include <atomic>
57 #include <map>
58 #include <memory>
59 #include <sstream>
60 #include <string>
61 #include <vector>
62 #include <exception>
63 #include <unordered_map>
64 
65 namespace edm {
66  class EventPrincipal;
67  class EarlyDeleteHelper;
68  class ProductResolverIndexHelper;
69  class ProductResolverIndexAndSkipBit;
70  class StreamID;
71  class StreamContext;
72  class ProductRegistry;
73  class ThinnedAssociationsHelper;
74 
75  namespace workerhelper {
76  template <typename O>
77  class CallImpl;
78  }
79  namespace eventsetup {
81  }
82 
83  class Worker {
84  public:
85  enum State { Ready, Pass, Fail, Exception };
90 
91  TaskQueueAdaptor() = default;
93  TaskQueueAdaptor(LimitedTaskQueue* iLimited) : limited_(iLimited) {}
94 
95  operator bool() { return serial_ != nullptr or limited_ != nullptr; }
96 
97  template <class F>
98  void push(F&& iF) {
99  if (serial_) {
100  serial_->push(iF);
101  } else {
102  limited_->push(iF);
103  }
104  }
105  template <class F>
106  void pushAndWait(F&& iF) {
107  if (serial_) {
108  serial_->pushAndWait(iF);
109  } else {
110  limited_->pushAndWait(iF);
111  }
112  }
113  };
114 
115  Worker(ModuleDescription const& iMD, ExceptionToActionTable const* iActions);
116  virtual ~Worker();
117 
118  Worker(Worker const&) = delete; // Disallow copying and moving
119  Worker& operator=(Worker const&) = delete; // Disallow copying and moving
120 
121  virtual bool wantsGlobalRuns() const = 0;
122  virtual bool wantsGlobalLuminosityBlocks() const = 0;
123  virtual bool wantsStreamRuns() const = 0;
124  virtual bool wantsStreamLuminosityBlocks() const = 0;
125 
126  virtual SerialTaskQueue* globalRunsQueue() = 0;
128 
129  template <typename T>
130  bool doWork(typename T::MyPrincipal const&,
131  EventSetupImpl const& c,
133  ParentContext const& parentContext,
134  typename T::Context const* context);
135 
137 
139  assert(false);
140  }
141 
142  template <typename T>
144  typename T::MyPrincipal const&,
145  EventSetupImpl const& c,
146  ServiceToken const& token,
148  ParentContext const& parentContext,
149  typename T::Context const* context);
150 
151  template <typename T>
153  typename T::MyPrincipal const&,
154  EventSetupImpl const& c,
155  ServiceToken const& token,
157  ParentContext const& parentContext,
158  typename T::Context const* context);
159 
160  template <typename T>
161  std::exception_ptr runModuleDirectly(typename T::MyPrincipal const& ep,
162  EventSetupImpl const& es,
163  StreamID streamID,
164  ParentContext const& parentContext,
165  typename T::Context const* context);
166 
168  void skipOnPath(EventPrincipal const& iEvent);
169  void beginJob();
170  void endJob();
171  void beginStream(StreamID id, StreamContext& streamContext);
172  void endStream(StreamID id, StreamContext& streamContext);
175 
178  }
179 
180  void reset() {
181  cached_exception_ = std::exception_ptr();
182  state_ = Ready;
184  workStarted_ = false;
186  }
187 
188  void postDoEvent(EventPrincipal const&);
189 
194  void setActivityRegistry(std::shared_ptr<ActivityRegistry> areg);
195 
197 
198  //Used to make EDGetToken work
199  virtual void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const&) = 0;
200  virtual void updateLookup(eventsetup::ESRecordsToProxyIndices const&) = 0;
201  virtual void resolvePutIndicies(
202  BranchType iBranchType,
203  std::unordered_multimap<std::string, std::tuple<TypeID const*, const char*, edm::ProductResolverIndex>> const&
204  iIndicies) = 0;
205 
206  virtual void modulesWhoseProductsAreConsumed(
207  std::vector<ModuleDescription const*>& modules,
208  ProductRegistry const& preg,
209  std::map<std::string, ModuleDescription const*> const& labelsToDesc) const = 0;
210 
211  virtual void convertCurrentProcessAlias(std::string const& processName) = 0;
212 
213  virtual std::vector<ConsumesInfo> consumesInfo() const = 0;
214 
215  virtual Types moduleType() const = 0;
216 
217  void clearCounters() {
218  timesRun_.store(0, std::memory_order_release);
219  timesVisited_.store(0, std::memory_order_release);
220  timesPassed_.store(0, std::memory_order_release);
221  timesFailed_.store(0, std::memory_order_release);
222  timesExcept_.store(0, std::memory_order_release);
223  }
224 
226  //NOTE: calling state() is done to force synchronization across threads
227  int timesRun() const { return timesRun_.load(std::memory_order_acquire); }
228  int timesVisited() const { return timesVisited_.load(std::memory_order_acquire); }
229  int timesPassed() const { return timesPassed_.load(std::memory_order_acquire); }
230  int timesFailed() const { return timesFailed_.load(std::memory_order_acquire); }
231  int timesExcept() const { return timesExcept_.load(std::memory_order_acquire); }
232  State state() const { return state_; }
233 
234  int timesPass() const { return timesPassed(); } // for backward compatibility only - to be removed soon
235 
236  virtual bool hasAccumulator() const = 0;
237 
238  protected:
239  template <typename O>
241  virtual std::string workerType() const = 0;
242  virtual bool implDo(EventPrincipal const&, EventSetupImpl const& c, ModuleCallingContext const* mcc) = 0;
243 
244  virtual void itemsToGetForSelection(std::vector<ProductResolverIndexAndSkipBit>&) const = 0;
245  virtual bool implNeedToRunSelection() const = 0;
246 
247  virtual void implDoAcquire(EventPrincipal const&,
248  EventSetupImpl const& c,
249  ModuleCallingContext const* mcc,
250  WaitingTaskWithArenaHolder& holder) = 0;
251 
252  virtual bool implDoPrePrefetchSelection(StreamID id, EventPrincipal const& ep, ModuleCallingContext const* mcc) = 0;
253  virtual bool implDoBegin(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const* mcc) = 0;
254  virtual bool implDoStreamBegin(StreamID id,
255  RunPrincipal const& rp,
256  EventSetupImpl const& c,
257  ModuleCallingContext const* mcc) = 0;
258  virtual bool implDoStreamEnd(StreamID id,
259  RunPrincipal const& rp,
260  EventSetupImpl const& c,
261  ModuleCallingContext const* mcc) = 0;
262  virtual bool implDoEnd(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const* mcc) = 0;
263  virtual bool implDoBegin(LuminosityBlockPrincipal const& lbp,
264  EventSetupImpl const& c,
265  ModuleCallingContext const* mcc) = 0;
266  virtual bool implDoStreamBegin(StreamID id,
267  LuminosityBlockPrincipal const& lbp,
268  EventSetupImpl const& c,
269  ModuleCallingContext const* mcc) = 0;
270  virtual bool implDoStreamEnd(StreamID id,
271  LuminosityBlockPrincipal const& lbp,
272  EventSetupImpl const& c,
273  ModuleCallingContext const* mcc) = 0;
274  virtual bool implDoEnd(LuminosityBlockPrincipal const& lbp,
275  EventSetupImpl const& c,
276  ModuleCallingContext const* mcc) = 0;
277  virtual void implBeginJob() = 0;
278  virtual void implEndJob() = 0;
279  virtual void implBeginStream(StreamID) = 0;
280  virtual void implEndStream(StreamID) = 0;
281 
283 
285 
286  private:
287  template <typename T>
288  bool runModule(typename T::MyPrincipal const&,
289  EventSetupImpl const& c,
291  ParentContext const& parentContext,
292  typename T::Context const* context);
293 
294  virtual void itemsToGet(BranchType, std::vector<ProductResolverIndexAndSkipBit>&) const = 0;
295  virtual void itemsMayGet(BranchType, std::vector<ProductResolverIndexAndSkipBit>&) const = 0;
296 
297  virtual std::vector<ProductResolverIndexAndSkipBit> const& itemsToGetFrom(BranchType) const = 0;
298 
299  virtual std::vector<ProductResolverIndex> const& itemsShouldPutInEvent() const = 0;
300 
301  virtual void preActionBeforeRunEventAsync(WaitingTask* iTask,
302  ModuleCallingContext const& moduleCallingContext,
303  Principal const& iPrincipal) const = 0;
304 
305  virtual void implRespondToOpenInputFile(FileBlock const& fb) = 0;
306  virtual void implRespondToCloseInputFile(FileBlock const& fb) = 0;
307 
309 
310  virtual TaskQueueAdaptor serializeRunModule() = 0;
311 
312  static void exceptionContext(cms::Exception& ex, ModuleCallingContext const* mcc);
313 
314  /*This base class is used to hide the differences between the ID used
315  for Event, LuminosityBlock and Run. Using the base class allows us
316  to only convert the ID to string form if it is actually needed in
317  the call to shouldRethrowException.
318  */
320  public:
321  virtual std::string value() const = 0;
323  };
324 
325  template <typename T>
327  public:
328  TransitionIDValue(T const& iP) : p_(iP) {}
329  std::string value() const override {
330  std::ostringstream iost;
331  iost << p_.id();
332  return iost.str();
333  }
334 
335  private:
336  T const& p_;
337  };
338 
339  bool shouldRethrowException(std::exception_ptr iPtr,
340  ParentContext const& parentContext,
341  bool isEvent,
342  TransitionIDValueBase const& iID) const;
343 
344  template <bool IS_EVENT>
345  bool setPassed() {
346  if (IS_EVENT) {
347  timesPassed_.fetch_add(1, std::memory_order_relaxed);
348  }
349  state_ = Pass;
350  return true;
351  }
352 
353  template <bool IS_EVENT>
354  bool setFailed() {
355  if (IS_EVENT) {
356  timesFailed_.fetch_add(1, std::memory_order_relaxed);
357  }
358  state_ = Fail;
359  return false;
360  }
361 
362  template <bool IS_EVENT>
363  std::exception_ptr setException(std::exception_ptr iException) {
364  if (IS_EVENT) {
365  timesExcept_.fetch_add(1, std::memory_order_relaxed);
366  }
367  cached_exception_ = iException; // propagate_const<T> has no reset() function
368  state_ = Exception;
369  return cached_exception_;
370  }
371 
372  void prefetchAsync(WaitingTask*, ServiceToken const&, ParentContext const& parentContext, Principal const&);
373 
375  actReg_->postModuleEventPrefetchingSignal_.emit(*moduleCallingContext_.getStreamContext(), moduleCallingContext_);
376  }
377 
378  virtual bool hasAcquire() const = 0;
379 
380  template <typename T>
381  std::exception_ptr runModuleAfterAsyncPrefetch(std::exception_ptr const* iEPtr,
382  typename T::MyPrincipal const& ep,
383  EventSetupImpl const& es,
384  StreamID streamID,
385  ParentContext const& parentContext,
386  typename T::Context const* context);
387 
388  void runAcquire(EventPrincipal const& ep,
389  EventSetupImpl const& es,
390  ParentContext const& parentContext,
392 
393  void runAcquireAfterAsyncPrefetch(std::exception_ptr const* iEPtr,
394  EventPrincipal const& ep,
395  EventSetupImpl const& es,
396  ParentContext const& parentContext,
398 
399  std::exception_ptr handleExternalWorkException(std::exception_ptr const* iEPtr, ParentContext const& parentContext);
400 
401  template <typename T>
402  class RunModuleTask : public WaitingTask {
403  public:
405  typename T::MyPrincipal const& ep,
406  EventSetupImpl const& es,
407  ServiceToken const& token,
408  StreamID streamID,
409  ParentContext const& parentContext,
410  typename T::Context const* context)
411  : m_worker(worker),
412  m_principal(ep),
413  m_es(es),
414  m_streamID(streamID),
415  m_parentContext(parentContext),
416  m_context(context),
418 
422  EnableQueueGuard(EnableQueueGuard const&) = delete;
423  EnableQueueGuard& operator=(EnableQueueGuard const&) = delete;
425  EnableQueueGuard(EnableQueueGuard&& iGuard) : queue_{iGuard.queue_} { iGuard.queue_ = nullptr; }
427  if (queue_) {
428  queue_->resume();
429  }
430  }
431  };
432 
433  tbb::task* execute() override {
434  //Need to make the services available early so other services can see them
436 
437  //incase the emit causes an exception, we need a memory location
438  // to hold the exception_ptr
439  std::exception_ptr temp_excptr;
440  auto excptr = exceptionPtr();
441  if constexpr (T::isEvent_) {
442  if (!m_worker->hasAcquire()) {
443  // Caught exception is passed to Worker::runModuleAfterAsyncPrefetch(), which propagates it via WaitingTaskList
444  CMS_SA_ALLOW try {
445  //pre was called in prefetchAsync
447  } catch (...) {
448  temp_excptr = std::current_exception();
449  if (not excptr) {
450  excptr = &temp_excptr;
451  }
452  }
453  }
454  }
455 
456  if (not excptr) {
457  if (auto queue = m_worker->serializeRunModule()) {
458  auto const& principal = m_principal;
459  auto& es = m_es;
460  auto f = [worker = m_worker,
461  &principal,
462  &es,
463  streamID = m_streamID,
464  parentContext = m_parentContext,
465  sContext = m_context,
466  serviceToken = m_serviceToken]() {
467  //Need to make the services available
468  ServiceRegistry::Operate operateRunModule(serviceToken);
469 
470  //If needed, we pause the queue in begin transition and resume it
471  // at the end transition. This guarantees that the module
472  // only processes one transition at a time
474  std::exception_ptr* ptr = nullptr;
475  worker->template runModuleAfterAsyncPrefetch<T>(ptr, principal, es, streamID, parentContext, sContext);
476  };
477  //keep another global transition from running if necessary
479  if (gQueue) {
480  gQueue->push([queue, gQueue, f]() mutable {
481  gQueue->pause();
482  queue.push(std::move(f));
483  });
484  } else {
485  queue.push(std::move(f));
486  }
487  return nullptr;
488  }
489  }
490 
492  return nullptr;
493  }
494 
495  private:
497  typename T::MyPrincipal const& m_principal;
501  typename T::Context const* m_context;
503  };
504 
505  // AcquireTask is only used for the Event case, but we define
506  // it as a template so all cases will compile.
507  // DUMMY exists to work around the C++ Standard prohibition on
508  // fully specializing templates nested in other classes.
509  template <typename T, typename DUMMY = void>
510  class AcquireTask : public WaitingTask {
511  public:
513  typename T::MyPrincipal const& ep,
514  EventSetupImpl const& es,
515  ServiceToken const& token,
516  ParentContext const& parentContext,
517  WaitingTaskWithArenaHolder holder) {}
518  tbb::task* execute() override { return nullptr; }
519  };
520 
521  template <typename DUMMY>
523  public:
525  EventPrincipal const& ep,
526  EventSetupImpl const& es,
527  ServiceToken const& token,
528  ParentContext const& parentContext,
530  : m_worker(worker),
531  m_principal(ep),
532  m_es(es),
533  m_parentContext(parentContext),
534  m_holder(std::move(holder)),
535  m_serviceToken(token) {}
536 
537  tbb::task* execute() override {
538  //Need to make the services available early so other services can see them
539  ServiceRegistry::Operate guard(m_serviceToken);
540 
541  //incase the emit causes an exception, we need a memory location
542  // to hold the exception_ptr
543  std::exception_ptr temp_excptr;
544  auto excptr = exceptionPtr();
545  // Caught exception is passed to Worker::runModuleAfterAsyncPrefetch(), which propagates it via WaitingTaskWithArenaHolder
546  CMS_SA_ALLOW try {
547  //pre was called in prefetchAsync
548  m_worker->emitPostModuleEventPrefetchingSignal();
549  } catch (...) {
550  temp_excptr = std::current_exception();
551  if (not excptr) {
552  excptr = &temp_excptr;
553  }
554  }
555 
556  if (not excptr) {
557  if (auto queue = m_worker->serializeRunModule()) {
558  auto const& principal = m_principal;
559  auto& es = m_es;
560  queue.push([worker = m_worker,
561  &principal,
562  &es,
563  parentContext = m_parentContext,
564  serviceToken = m_serviceToken,
565  holder = m_holder]() {
566  //Need to make the services available
567  ServiceRegistry::Operate operateRunAcquire(serviceToken);
568 
569  std::exception_ptr* ptr = nullptr;
570  worker->runAcquireAfterAsyncPrefetch(ptr, principal, es, parentContext, holder);
571  });
572  return nullptr;
573  }
574  }
575 
576  m_worker->runAcquireAfterAsyncPrefetch(excptr, m_principal, m_es, m_parentContext, std::move(m_holder));
577  return nullptr;
578  }
579 
580  private:
587  };
588 
589  // This class does nothing unless there is an exception originating
590  // in an "External Worker". In that case, it handles converting the
591  // exception to a CMS exception and adding context to the exception.
593  public:
594  HandleExternalWorkExceptionTask(Worker* worker, WaitingTask* runModuleTask, ParentContext const& parentContext);
595 
596  tbb::task* execute() override;
597 
598  private:
602  };
603 
604  std::atomic<int> timesRun_;
605  std::atomic<int> timesVisited_;
606  std::atomic<int> timesPassed_;
607  std::atomic<int> timesFailed_;
608  std::atomic<int> timesExcept_;
609  std::atomic<State> state_;
611  std::atomic<int> numberOfPathsLeftToRun_;
612 
614 
615  ExceptionToActionTable const* actions_; // memory assumed to be managed elsewhere
616  CMS_THREAD_GUARD(state_) std::exception_ptr cached_exception_; // if state is 'exception'
617 
618  std::shared_ptr<ActivityRegistry> actReg_; // We do not use propagate_const because the registry itself is mutable.
619 
621 
623  std::atomic<bool> workStarted_;
625  };
626 
627  namespace {
628  template <typename T>
629  class ModuleSignalSentry {
630  public:
631  ModuleSignalSentry(ActivityRegistry* a,
632  typename T::Context const* context,
633  ModuleCallingContext const* moduleCallingContext)
634  : a_(a), context_(context), moduleCallingContext_(moduleCallingContext) {
635  if (a_)
636  T::preModuleSignal(a_, context, moduleCallingContext_);
637  }
638 
639  ~ModuleSignalSentry() {
640  if (a_)
641  T::postModuleSignal(a_, context_, moduleCallingContext_);
642  }
643 
644  private:
645  ActivityRegistry* a_; // We do not use propagate_const because the registry itself is mutable.
646  typename T::Context const* context_;
647  ModuleCallingContext const* moduleCallingContext_;
648  };
649 
650  } // namespace
651 
652  namespace workerhelper {
653  template <>
655  public:
657  static bool call(Worker* iWorker,
658  StreamID,
659  EventPrincipal const& ep,
660  EventSetupImpl const& es,
661  ActivityRegistry* /* actReg */,
662  ModuleCallingContext const* mcc,
663  Arg::Context const* /* context*/) {
664  //Signal sentry is handled by the module
665  return iWorker->implDo(ep, es, mcc);
666  }
667  static bool wantsTransition(Worker const* iWorker) { return true; }
668  static bool needToRunSelection(Worker const* iWorker) { return iWorker->implNeedToRunSelection(); }
669 
670  static SerialTaskQueue* pauseGlobalQueue(Worker*) { return nullptr; }
671  static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; }
672  };
673 
674  template <>
676  public:
678  static bool call(Worker* iWorker,
679  StreamID,
680  RunPrincipal const& ep,
681  EventSetupImpl const& es,
682  ActivityRegistry* actReg,
683  ModuleCallingContext const* mcc,
684  Arg::Context const* context) {
685  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
686  return iWorker->implDoBegin(ep, es, mcc);
687  }
688  static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsGlobalRuns(); }
689  static bool needToRunSelection(Worker const* iWorker) { return false; }
690  static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return iWorker->globalRunsQueue(); }
691  static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; }
692  };
693  template <>
695  public:
697  static bool call(Worker* iWorker,
698  StreamID id,
699  RunPrincipal const& ep,
700  EventSetupImpl const& es,
701  ActivityRegistry* actReg,
702  ModuleCallingContext const* mcc,
703  Arg::Context const* context) {
704  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
705  return iWorker->implDoStreamBegin(id, ep, es, mcc);
706  }
707  static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsStreamRuns(); }
708  static bool needToRunSelection(Worker const* iWorker) { return false; }
709  static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; }
710  static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; }
711  };
712  template <>
714  public:
716  static bool call(Worker* iWorker,
717  StreamID,
718  RunPrincipal const& ep,
719  EventSetupImpl const& es,
720  ActivityRegistry* actReg,
721  ModuleCallingContext const* mcc,
722  Arg::Context const* context) {
723  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
724  return iWorker->implDoEnd(ep, es, mcc);
725  }
726  static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsGlobalRuns(); }
727  static bool needToRunSelection(Worker const* iWorker) { return false; }
728  static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; }
729  static SerialTaskQueue* enableGlobalQueue(Worker* iWorker) { return iWorker->globalRunsQueue(); }
730  };
731  template <>
733  public:
735  static bool call(Worker* iWorker,
736  StreamID id,
737  RunPrincipal const& ep,
738  EventSetupImpl const& es,
739  ActivityRegistry* actReg,
740  ModuleCallingContext const* mcc,
741  Arg::Context const* context) {
742  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
743  return iWorker->implDoStreamEnd(id, ep, es, mcc);
744  }
745  static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsStreamRuns(); }
746  static bool needToRunSelection(Worker const* iWorker) { return false; }
747  static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; }
748  static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; }
749  };
750 
751  template <>
753  public:
755  static bool call(Worker* iWorker,
756  StreamID,
758  EventSetupImpl const& es,
759  ActivityRegistry* actReg,
760  ModuleCallingContext const* mcc,
761  Arg::Context const* context) {
762  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
763  return iWorker->implDoBegin(ep, es, mcc);
764  }
765  static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsGlobalLuminosityBlocks(); }
766  static bool needToRunSelection(Worker const* iWorker) { return false; }
767  static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return iWorker->globalLuminosityBlocksQueue(); }
768  static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; }
769  };
770  template <>
772  public:
774  static bool call(Worker* iWorker,
775  StreamID id,
777  EventSetupImpl const& es,
778  ActivityRegistry* actReg,
779  ModuleCallingContext const* mcc,
780  Arg::Context const* context) {
781  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
782  return iWorker->implDoStreamBegin(id, ep, es, mcc);
783  }
784  static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsStreamLuminosityBlocks(); }
785  static bool needToRunSelection(Worker const* iWorker) { return false; }
786  static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; }
787  static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; }
788  };
789 
790  template <>
792  public:
794  static bool call(Worker* iWorker,
795  StreamID,
797  EventSetupImpl const& es,
798  ActivityRegistry* actReg,
799  ModuleCallingContext const* mcc,
800  Arg::Context const* context) {
801  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
802  return iWorker->implDoEnd(ep, es, mcc);
803  }
804  static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsGlobalLuminosityBlocks(); }
805  static bool needToRunSelection(Worker const* iWorker) { return false; }
806  static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; }
807  static SerialTaskQueue* enableGlobalQueue(Worker* iWorker) { return iWorker->globalLuminosityBlocksQueue(); }
808  };
809  template <>
811  public:
813  static bool call(Worker* iWorker,
814  StreamID id,
816  EventSetupImpl const& es,
817  ActivityRegistry* actReg,
818  ModuleCallingContext const* mcc,
819  Arg::Context const* context) {
820  ModuleSignalSentry<Arg> cpp(actReg, context, mcc);
821  return iWorker->implDoStreamEnd(id, ep, es, mcc);
822  }
823  static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsStreamLuminosityBlocks(); }
824  static bool needToRunSelection(Worker const* iWorker) { return false; }
825  static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; }
826  static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; }
827  };
828  } // namespace workerhelper
829 
830  template <typename T>
832  typename T::MyPrincipal const& ep,
833  EventSetupImpl const& es,
834  ServiceToken const& token,
835  StreamID streamID,
836  ParentContext const& parentContext,
837  typename T::Context const* context) {
839  return;
840  }
841 
842  //Need to check workStarted_ before adding to waitingTasks_
843  bool expected = false;
844  bool workStarted = workStarted_.compare_exchange_strong(expected, true);
845 
847  if constexpr (T::isEvent_) {
848  timesVisited_.fetch_add(1, std::memory_order_relaxed);
849  }
850 
851  if (workStarted) {
853 
854  //if have TriggerResults based selection we want to reject the event before doing prefetching
856  //We need to run the selection in a different task so that
857  // we can prefetch the data needed for the selection
858  auto runTask =
859  new (tbb::task::allocate_root()) RunModuleTask<T>(this, ep, es, token, streamID, parentContext, context);
860 
861  //make sure the task is either run or destroyed
862  struct DestroyTask {
863  DestroyTask(edm::WaitingTask* iTask) : m_task(iTask) {}
864 
865  ~DestroyTask() {
866  auto p = m_task.load();
867  if (p) {
868  tbb::task::destroy(*p);
869  }
870  }
871 
873  auto t = m_task.load();
874  m_task.store(nullptr);
875  return t;
876  }
877 
878  std::atomic<edm::WaitingTask*> m_task;
879  };
880 
881  auto ownRunTask = std::make_shared<DestroyTask>(runTask);
882  auto selectionTask =
883  make_waiting_task(tbb::task::allocate_root(),
884  [ownRunTask, parentContext, &ep, token, this](std::exception_ptr const*) mutable {
886  prefetchAsync(ownRunTask->release(), token, parentContext, ep);
887  });
888  prePrefetchSelectionAsync(selectionTask, token, streamID, &ep);
889  } else {
890  WaitingTask* moduleTask =
891  new (tbb::task::allocate_root()) RunModuleTask<T>(this, ep, es, token, streamID, parentContext, context);
892  if constexpr (T::isEvent_) {
893  if (hasAcquire()) {
894  WaitingTaskWithArenaHolder runTaskHolder(
895  new (tbb::task::allocate_root()) HandleExternalWorkExceptionTask(this, moduleTask, parentContext));
896  moduleTask = new (tbb::task::allocate_root())
897  AcquireTask<T>(this, ep, es, token, parentContext, std::move(runTaskHolder));
898  }
899  }
900  prefetchAsync(moduleTask, token, parentContext, ep);
901  }
902  }
903  }
904 
905  template <typename T>
906  std::exception_ptr Worker::runModuleAfterAsyncPrefetch(std::exception_ptr const* iEPtr,
907  typename T::MyPrincipal const& ep,
908  EventSetupImpl const& es,
909  StreamID streamID,
910  ParentContext const& parentContext,
911  typename T::Context const* context) {
912  std::exception_ptr exceptionPtr;
913  if (iEPtr) {
914  assert(*iEPtr);
916  if (shouldRethrowException(*iEPtr, parentContext, T::isEvent_, idValue)) {
917  exceptionPtr = *iEPtr;
918  setException<T::isEvent_>(exceptionPtr);
919  } else {
920  setPassed<T::isEvent_>();
921  }
923  } else {
924  // Caught exception is propagated via WaitingTaskList
925  CMS_SA_ALLOW try { runModule<T>(ep, es, streamID, parentContext, context); } catch (...) {
926  exceptionPtr = std::current_exception();
927  }
928  }
929  waitingTasks_.doneWaiting(exceptionPtr);
930  return exceptionPtr;
931  }
932 
933  template <typename T>
935  typename T::MyPrincipal const& principal,
936  EventSetupImpl const& es,
937  ServiceToken const& serviceToken,
938  StreamID streamID,
939  ParentContext const& parentContext,
940  typename T::Context const* context) {
942  return;
943  }
944 
945  //Need to check workStarted_ before adding to waitingTasks_
946  bool expected = false;
947  auto workStarted = workStarted_.compare_exchange_strong(expected, true);
948 
950  if (workStarted) {
951  auto toDo = [this, &principal, &es, streamID, parentContext, context, serviceToken]() {
952  std::exception_ptr exceptionPtr;
953  // Caught exception is propagated via WaitingTaskList
954  CMS_SA_ALLOW try {
955  //Need to make the services available
956  ServiceRegistry::Operate guard(serviceToken);
957 
958  this->runModule<T>(principal, es, streamID, parentContext, context);
959  } catch (...) {
960  exceptionPtr = std::current_exception();
961  }
962  this->waitingTasks_.doneWaiting(exceptionPtr);
963  };
964  if (auto queue = this->serializeRunModule()) {
965  queue.push(toDo);
966  } else {
967  auto taskToDo = make_functor_task(tbb::task::allocate_root(), toDo);
968  tbb::task::spawn(*taskToDo);
969  }
970  }
971  }
972 
973  template <typename T>
974  bool Worker::doWork(typename T::MyPrincipal const& ep,
975  EventSetupImpl const& es,
976  StreamID streamID,
977  ParentContext const& parentContext,
978  typename T::Context const* context) {
979  if constexpr (T::isEvent_) {
980  timesVisited_.fetch_add(1, std::memory_order_relaxed);
981  }
982  bool rc = false;
983 
984  switch (state_) {
985  case Ready:
986  break;
987  case Pass:
988  return true;
989  case Fail:
990  return false;
991  case Exception: {
992  std::rethrow_exception(cached_exception_);
993  }
994  }
995 
996  bool expected = false;
997  if (not workStarted_.compare_exchange_strong(expected, true)) {
998  //another thread beat us here
999  auto waitTask = edm::make_empty_waiting_task();
1000  waitTask->increment_ref_count();
1001 
1002  waitingTasks_.add(waitTask.get());
1003 
1004  waitTask->wait_for_all();
1005 
1006  switch (state_) {
1007  case Ready:
1008  assert(false);
1009  case Pass:
1010  return true;
1011  case Fail:
1012  return false;
1013  case Exception: {
1014  std::rethrow_exception(cached_exception_);
1015  }
1016  }
1017  }
1018 
1019  //Need the context to be set until after any exception is resolved
1021 
1022  auto resetContext = [](ModuleCallingContext* iContext) {
1023  iContext->setContext(ModuleCallingContext::State::kInvalid, ParentContext(), nullptr);
1024  };
1025  std::unique_ptr<ModuleCallingContext, decltype(resetContext)> prefetchSentry(&moduleCallingContext_, resetContext);
1026 
1027  if constexpr (T::isEvent_) {
1028  //if have TriggerResults based selection we want to reject the event before doing prefetching
1030  auto waitTask = edm::make_empty_waiting_task();
1031  waitTask->set_ref_count(2);
1032  prePrefetchSelectionAsync(waitTask.get(), ServiceRegistry::instance().presentToken(), streamID, &ep);
1033  waitTask->decrement_ref_count();
1034  waitTask->wait_for_all();
1035 
1036  if (state() != Ready) {
1037  //The selection must have rejected this event
1038  return true;
1039  }
1040  }
1041  auto waitTask = edm::make_empty_waiting_task();
1042  {
1043  //Make sure signal is sent once the prefetching is done
1044  // [the 'pre' signal was sent in prefetchAsync]
1045  //The purpose of this block is to send the signal after wait_for_all
1046  auto sentryFunc = [this](void*) { emitPostModuleEventPrefetchingSignal(); };
1047  std::unique_ptr<ActivityRegistry, decltype(sentryFunc)> signalSentry(actReg_.get(), sentryFunc);
1048 
1049  //set count to 2 since wait_for_all requires value to not go to 0
1050  waitTask->set_ref_count(2);
1051 
1052  prefetchAsync(waitTask.get(), ServiceRegistry::instance().presentToken(), parentContext, ep);
1053  waitTask->decrement_ref_count();
1054  waitTask->wait_for_all();
1055  }
1056  if (waitTask->exceptionPtr() != nullptr) {
1058  if (shouldRethrowException(*waitTask->exceptionPtr(), parentContext, T::isEvent_, idValue)) {
1059  setException<T::isEvent_>(*waitTask->exceptionPtr());
1061  std::rethrow_exception(cached_exception_);
1062  } else {
1063  setPassed<T::isEvent_>();
1064  waitingTasks_.doneWaiting(nullptr);
1065  return true;
1066  }
1067  }
1068  }
1069 
1070  //successful prefetch so no reset necessary
1071  prefetchSentry.release();
1072  if (auto queue = serializeRunModule()) {
1073  auto serviceToken = ServiceRegistry::instance().presentToken();
1074  queue.pushAndWait([&]() {
1075  //Need to make the services available
1076  ServiceRegistry::Operate guard(serviceToken);
1077  // This try-catch is primarily for paranoia: runModule() deals internally with exceptions, except for those coming from Service signal actions, which are not supposed to throw exceptions
1078  CMS_SA_ALLOW try { rc = runModule<T>(ep, es, streamID, parentContext, context); } catch (...) {
1079  }
1080  });
1081  } else {
1082  // This try-catch is primarily for paranoia: runModule() deals internally with exceptions, except for those coming from Service signal actions, which are not supposed to throw exceptions
1083  CMS_SA_ALLOW try { rc = runModule<T>(ep, es, streamID, parentContext, context); } catch (...) {
1084  }
1085  }
1086  if (state_ == Exception) {
1088  std::rethrow_exception(cached_exception_);
1089  }
1090 
1091  waitingTasks_.doneWaiting(nullptr);
1092  return rc;
1093  }
1094 
1095  template <typename T>
1096  bool Worker::runModule(typename T::MyPrincipal const& ep,
1097  EventSetupImpl const& es,
1098  StreamID streamID,
1099  ParentContext const& parentContext,
1100  typename T::Context const* context) {
1101  //unscheduled producers should advance this
1102  //if (T::isEvent_) {
1103  // ++timesVisited_;
1104  //}
1105  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
1106  if constexpr (T::isEvent_) {
1107  timesRun_.fetch_add(1, std::memory_order_relaxed);
1108  }
1109 
1110  bool rc = true;
1111  try {
1112  convertException::wrap([&]() {
1113  rc = workerhelper::CallImpl<T>::call(this, streamID, ep, es, actReg_.get(), &moduleCallingContext_, context);
1114 
1115  if (rc) {
1116  setPassed<T::isEvent_>();
1117  } else {
1118  setFailed<T::isEvent_>();
1119  }
1120  });
1121  } catch (cms::Exception& ex) {
1124  if (shouldRethrowException(std::current_exception(), parentContext, T::isEvent_, idValue)) {
1126  setException<T::isEvent_>(std::current_exception());
1127  std::rethrow_exception(cached_exception_);
1128  } else {
1129  rc = setPassed<T::isEvent_>();
1130  }
1131  }
1132 
1133  return rc;
1134  }
1135 
1136  template <typename T>
1137  std::exception_ptr Worker::runModuleDirectly(typename T::MyPrincipal const& ep,
1138  EventSetupImpl const& es,
1139  StreamID streamID,
1140  ParentContext const& parentContext,
1141  typename T::Context const* context) {
1142  timesVisited_.fetch_add(1, std::memory_order_relaxed);
1143  std::exception_ptr const* prefetchingException = nullptr; // null because there was no prefetching to do
1144  return runModuleAfterAsyncPrefetch<T>(prefetchingException, ep, es, streamID, parentContext, context);
1145  }
1146 } // namespace edm
1147 #endif
edm::Worker::RunModuleTask::EnableQueueGuard::operator=
EnableQueueGuard & operator=(EnableQueueGuard const &)=delete
edm::Worker::RunModuleTask
Definition: Worker.h:402
edm::Worker::consumesInfo
virtual std::vector< ConsumesInfo > consumesInfo() const =0
edm::Worker::HandleExternalWorkExceptionTask::execute
tbb::task * execute() override
Definition: Worker.cc:441
edm::StreamID
Definition: StreamID.h:30
edm::Worker::TaskQueueAdaptor::push
void push(F &&iF)
Definition: Worker.h:98
edm::Worker::itemsToGetForSelection
virtual void itemsToGetForSelection(std::vector< ProductResolverIndexAndSkipBit > &) const =0
ModuleCallingContext.h
edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd >
Definition: OccurrenceTraits.h:336
edm::Worker::HandleExternalWorkExceptionTask::HandleExternalWorkExceptionTask
HandleExternalWorkExceptionTask(Worker *worker, WaitingTask *runModuleTask, ParentContext const &parentContext)
Definition: Worker.cc:436
electrons_cff.bool
bool
Definition: electrons_cff.py:372
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::Arg
OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > Arg
Definition: Worker.h:715
ServiceRegistry.h
edm::Worker::prefetchAsync
void prefetchAsync(WaitingTask *, ServiceToken const &, ParentContext const &parentContext, Principal const &)
Definition: Worker.cc:199
edm::Worker::itemsMayGet
virtual void itemsMayGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const =0
MessageLogger.h
edm::eventsetup::ESRecordsToProxyIndices
Definition: ESRecordsToProxyIndices.h:35
edm::ModuleCallingContext::State::kPrefetching
edm::Worker::RunModuleTask::m_es
EventSetupImpl const & m_es
Definition: Worker.h:498
edm::Worker::AcquireTask::execute
tbb::task * execute() override
Definition: Worker.h:518
edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::Arg
OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > Arg
Definition: Worker.h:656
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::enableGlobalQueue
static SerialTaskQueue * enableGlobalQueue(Worker *)
Definition: Worker.h:691
edm::Worker::actReg_
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:618
edm::Worker::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
BranchType.h
edm::Worker::implEndJob
virtual void implEndJob()=0
edm::Worker::implDoEnd
virtual bool implDoEnd(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *mcc)=0
edm::Worker::convertCurrentProcessAlias
virtual void convertCurrentProcessAlias(std::string const &processName)=0
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > >::Arg
OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > Arg
Definition: Worker.h:812
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
edm::Worker::TransitionIDValue
Definition: Worker.h:326
edm::ModuleContextSentry
Definition: ModuleContextSentry.h:11
propagate_const.h
edm::EventSetupImpl
Definition: EventSetupImpl.h:44
edm::Worker::runAcquire
void runAcquire(EventPrincipal const &ep, EventSetupImpl const &es, ParentContext const &parentContext, WaitingTaskWithArenaHolder &holder)
Definition: Worker.cc:378
edm::Worker::prePrefetchSelectionAsync
void prePrefetchSelectionAsync(WaitingTask *task, ServiceToken const &, StreamID stream, void const *)
Definition: Worker.h:138
edm::Worker::HandleExternalWorkExceptionTask::m_worker
Worker * m_worker
Definition: Worker.h:599
PlaceInPathContext.h
edm::Worker::TaskQueueAdaptor::pushAndWait
void pushAndWait(F &&iF)
Definition: Worker.h:106
edm::OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin >
Definition: OccurrenceTraits.h:65
edm::Worker::timesPassed_
std::atomic< int > timesPassed_
Definition: Worker.h:606
modules
Definition: ZHLTMatchFilter.cc:17
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > >::call
static bool call(Worker *iWorker, StreamID id, RunPrincipal const &ep, EventSetupImpl const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:697
edm::Worker::Fail
Definition: Worker.h:85
edm::Worker::TaskQueueAdaptor::limited_
LimitedTaskQueue * limited_
Definition: Worker.h:89
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Worker::beginJob
void beginJob()
Definition: Worker.cc:285
edm::Worker::preActionBeforeRunEventAsync
virtual void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &moduleCallingContext, Principal const &iPrincipal) const =0
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::SerialTaskQueue::resume
bool resume()
Resumes processing if the queue was paused.
Definition: SerialTaskQueue.cc:35
edm::Worker::timesVisited_
std::atomic< int > timesVisited_
Definition: Worker.h:605
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
edm::Worker::Exception
Definition: Worker.h:85
edm::WaitingTaskList::add
void add(WaitingTask *)
Adds task to the waiting list.
Definition: WaitingTaskList.cc:89
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > >::pauseGlobalQueue
static SerialTaskQueue * pauseGlobalQueue(Worker *iWorker)
Definition: Worker.h:786
edm::Worker::wantsGlobalLuminosityBlocks
virtual bool wantsGlobalLuminosityBlocks() const =0
edm::Worker::RunModuleTask::m_serviceToken
ServiceToken m_serviceToken
Definition: Worker.h:502
edm::Worker::resetModuleDescription
void resetModuleDescription(ModuleDescription const *)
Definition: Worker.cc:277
ProductResolverIndex.h
edm::Worker::postDoEvent
void postDoEvent(EventPrincipal const &)
Definition: Worker.cc:372
edm::Worker::actions_
ExceptionToActionTable const * actions_
Definition: Worker.h:615
FunctorTask.h
edm::Worker::implBeginJob
virtual void implBeginJob()=0
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::pauseGlobalQueue
static SerialTaskQueue * pauseGlobalQueue(Worker *iWorker)
Definition: Worker.h:690
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
edm::make_functor_task
FunctorTask< F > * make_functor_task(ALLOC &&iAlloc, F f)
Definition: FunctorTask.h:47
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > >::Arg
OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > Arg
Definition: Worker.h:773
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > >::pauseGlobalQueue
static SerialTaskQueue * pauseGlobalQueue(Worker *iWorker)
Definition: Worker.h:747
edm::Worker::Worker
Worker(ModuleDescription const &iMD, ExceptionToActionTable const *iActions)
Definition: Worker.cc:83
cms::cuda::assert
assert(be >=bs)
edm::Worker::respondToOpenInputFile
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:173
edm::Worker::setException
std::exception_ptr setException(std::exception_ptr iException)
Definition: Worker.h:363
edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin >
Definition: OccurrenceTraits.h:258
edm::Worker::RunModuleTask::EnableQueueGuard
Definition: Worker.h:419
edm::Worker::itemsToGet
virtual void itemsToGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const =0
edm::Principal
Definition: Principal.h:57
edm::Worker::numberOfPathsLeftToRun_
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:611
edm::Worker::registerThinnedAssociations
void registerThinnedAssociations(ProductRegistry const &registry, ThinnedAssociationsHelper &helper)
Definition: Worker.h:176
edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >::m_serviceToken
ServiceToken m_serviceToken
Definition: Worker.h:586
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::Worker::RunModuleTask::execute
tbb::task * execute() override
Definition: Worker.h:433
edm::Worker::timesVisited
int timesVisited() const
Definition: Worker.h:228
edm::Worker::kProducer
Definition: Worker.h:86
edm::Worker::State
State
Definition: Worker.h:85
edm::Worker::runModule
bool runModule(typename T::MyPrincipal const &, EventSetupImpl const &c, StreamID stream, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:1096
edm::Worker::RunModuleTask::EnableQueueGuard::~EnableQueueGuard
~EnableQueueGuard()
Definition: Worker.h:426
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::pauseGlobalQueue
static SerialTaskQueue * pauseGlobalQueue(Worker *iWorker)
Definition: Worker.h:728
edm::ModuleCallingContext::State::kInvalid
edm::ProductResolverIndexHelper
Definition: ProductResolverIndexHelper.h:89
edm::ModuleCallingContext::moduleDescription
ModuleDescription const * moduleDescription() const
Definition: ModuleCallingContext.h:50
edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >::m_parentContext
const ParentContext m_parentContext
Definition: Worker.h:584
edm::Worker::timesExcept
int timesExcept() const
Definition: Worker.h:231
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > >::Arg
OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > Arg
Definition: Worker.h:696
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::needToRunSelection
static bool needToRunSelection(Worker const *iWorker)
Definition: Worker.h:689
edm::Worker::wantsStreamLuminosityBlocks
virtual bool wantsStreamLuminosityBlocks() const =0
edm::BranchActionGlobalBegin
Definition: BranchActionType.h:12
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::needToRunSelection
static bool needToRunSelection(Worker const *iWorker)
Definition: Worker.h:727
edm::Worker::implEndStream
virtual void implEndStream(StreamID)=0
edm::Worker::workStarted_
std::atomic< bool > workStarted_
Definition: Worker.h:623
edm::Worker::itemsShouldPutInEvent
virtual std::vector< ProductResolverIndex > const & itemsShouldPutInEvent() const =0
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::Arg
OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > Arg
Definition: Worker.h:754
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > >::enableGlobalQueue
static SerialTaskQueue * enableGlobalQueue(Worker *)
Definition: Worker.h:710
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > >::pauseGlobalQueue
static SerialTaskQueue * pauseGlobalQueue(Worker *iWorker)
Definition: Worker.h:825
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::pauseGlobalQueue
static SerialTaskQueue * pauseGlobalQueue(Worker *iWorker)
Definition: Worker.h:767
edm::Worker::reset
void reset()
Definition: Worker.h:180
edm::Worker::operator=
Worker & operator=(Worker const &)=delete
edm::Exception
Definition: EDMException.h:77
edm::WaitingTaskList::reset
void reset()
Resets access to the resource so that added tasks will wait.
Definition: WaitingTaskList.cc:51
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
edm::OccurrenceTraits< RunPrincipal, BranchActionStreamBegin >
Definition: OccurrenceTraits.h:104
edm::WaitingTaskList
Definition: WaitingTaskList.h:101
edm::ProductRegistry
Definition: ProductRegistry.h:34
edm::Worker::implRespondToCloseInputFile
virtual void implRespondToCloseInputFile(FileBlock const &fb)=0
ModuleDescription.h
ActivityRegistry.h
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > >::enableGlobalQueue
static SerialTaskQueue * enableGlobalQueue(Worker *)
Definition: Worker.h:826
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::wantsTransition
static bool wantsTransition(Worker const *iWorker)
Definition: Worker.h:804
edm::FileBlock
Definition: FileBlock.h:20
edm::Worker::TransitionIDValue::TransitionIDValue
TransitionIDValue(T const &iP)
Definition: Worker.h:328
edm::Worker::AcquireTask
Definition: Worker.h:510
edm::ServiceToken
Definition: ServiceToken.h:40
edm::WaitingTaskWithArenaHolder
Definition: WaitingTaskWithArenaHolder.h:31
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::call
static bool call(Worker *iWorker, StreamID, LuminosityBlockPrincipal const &ep, EventSetupImpl const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:755
edm::Worker::shouldRethrowException
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent, TransitionIDValueBase const &iID) const
Definition: Worker.cc:156
edm::propagate_const
Definition: propagate_const.h:32
edm::Worker::implDoPrePrefetchSelection
virtual bool implDoPrePrefetchSelection(StreamID id, EventPrincipal const &ep, ModuleCallingContext const *mcc)=0
edm::Worker::kFilter
Definition: Worker.h:86
edm::SerialTaskQueueChain::pushAndWait
void pushAndWait(T &&iAction)
synchronously pushes functor iAction into queue
Definition: SerialTaskQueueChain.h:97
edm::LimitedTaskQueue
Definition: LimitedTaskQueue.h:39
edm::WaitingTask::exceptionPtr
std::exception_ptr const * exceptionPtr() const
Returns exception thrown by dependent task.
Definition: WaitingTask.h:51
edm::EventPrincipal
Definition: EventPrincipal.h:46
edm::Worker::earlyDeleteHelper_
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:620
edm::OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd >
Definition: OccurrenceTraits.h:180
edm::Worker::setActivityRegistry
void setActivityRegistry(std::shared_ptr< ActivityRegistry > areg)
Definition: Worker.cc:102
edm::StreamContext
Definition: StreamContext.h:31
edm::Worker::timesRun_
std::atomic< int > timesRun_
Definition: Worker.h:604
edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::needToRunSelection
static bool needToRunSelection(Worker const *iWorker)
Definition: Worker.h:668
edm::SerialTaskQueueChain::push
void push(T &&iAction)
asynchronously pushes functor iAction into queue
Definition: SerialTaskQueueChain.h:86
edm::Worker::callWhenDoneAsync
void callWhenDoneAsync(WaitingTask *task)
Definition: Worker.h:167
edm::Worker::resolvePutIndicies
virtual void resolvePutIndicies(BranchType iBranchType, std::unordered_multimap< std::string, std::tuple< TypeID const *, const char *, edm::ProductResolverIndex >> const &iIndicies)=0
edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::wantsTransition
static bool wantsTransition(Worker const *iWorker)
Definition: Worker.h:667
edm::Worker::kAnalyzer
Definition: Worker.h:86
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::call
static bool call(Worker *iWorker, StreamID, RunPrincipal const &ep, EventSetupImpl const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:716
edm::convertException::wrap
auto wrap(F iFunc) -> decltype(iFunc())
Definition: ConvertException.h:19
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::wantsTransition
static bool wantsTransition(Worker const *iWorker)
Definition: Worker.h:726
edm::Worker::modulesWhoseProductsAreConsumed
virtual void modulesWhoseProductsAreConsumed(std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc) const =0
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
edm::Worker::state_
std::atomic< State > state_
Definition: Worker.h:609
edm::Worker::runModuleAfterAsyncPrefetch
std::exception_ptr runModuleAfterAsyncPrefetch(std::exception_ptr const *iEPtr, typename T::MyPrincipal const &ep, EventSetupImpl const &es, StreamID streamID, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:906
edm::ActivityRegistry
Definition: ActivityRegistry.h:132
edm::LimitedTaskQueue::pushAndWait
void pushAndWait(T &&iAction)
synchronously pushes functor iAction into queue
Definition: LimitedTaskQueue.h:140
ProductResolverIndexAndSkipBit.h
edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >::m_es
EventSetupImpl const & m_es
Definition: Worker.h:583
edm::Worker::HandleExternalWorkExceptionTask
Definition: Worker.h:592
edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >::m_principal
EventPrincipal const & m_principal
Definition: Worker.h:582
edm::Worker::endJob
void endJob()
Definition: Worker.cc:300
edm::OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >
Definition: OccurrenceTraits.h:34
edm::WaitingTaskList::doneWaiting
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
Definition: WaitingTaskList.cc:169
edm::Worker::descPtr
ModuleDescription const * descPtr() const
Definition: Worker.h:191
edm::Worker::HandleExternalWorkExceptionTask::m_parentContext
const ParentContext m_parentContext
Definition: Worker.h:601
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > >::Arg
OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > Arg
Definition: Worker.h:734
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > >::needToRunSelection
static bool needToRunSelection(Worker const *iWorker)
Definition: Worker.h:708
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > >::needToRunSelection
static bool needToRunSelection(Worker const *iWorker)
Definition: Worker.h:785
edm::OccurrenceTraits
Definition: OccurrenceTraits.h:31
edm::Worker::RunModuleTask::m_worker
Worker * m_worker
Definition: Worker.h:496
ConvertException.h
edm::Worker::Pass
Definition: Worker.h:85
edm::OccurrenceTraits< RunPrincipal, BranchActionStreamEnd >
Definition: OccurrenceTraits.h:142
OrderedSet.t
t
Definition: OrderedSet.py:90
LimitedTaskQueue.h
edm::Worker
Definition: Worker.h:83
edm::make_waiting_task
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:87
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::call
static bool call(Worker *iWorker, StreamID, LuminosityBlockPrincipal const &ep, EventSetupImpl const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:794
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > >::call
static bool call(Worker *iWorker, StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:774
edm::Worker::timesExcept_
std::atomic< int > timesExcept_
Definition: Worker.h:608
createBeamHaloJobs.queue
queue
Definition: createBeamHaloJobs.py:343
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::needToRunSelection
static bool needToRunSelection(Worker const *iWorker)
Definition: Worker.h:766
edm::ParentContext
Definition: ParentContext.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Worker::RunModuleTask::m_parentContext
const ParentContext m_parentContext
Definition: Worker.h:500
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::needToRunSelection
static bool needToRunSelection(Worker const *iWorker)
Definition: Worker.h:805
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::wantsTransition
static bool wantsTransition(Worker const *iWorker)
Definition: Worker.h:688
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:35
edm::GlobalContext
Definition: GlobalContext.h:29
edm::Worker::serializeRunModule
virtual TaskQueueAdaptor serializeRunModule()=0
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > >::wantsTransition
static bool wantsTransition(Worker const *iWorker)
Definition: Worker.h:823
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > >::call
static bool call(Worker *iWorker, StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:813
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::enableGlobalQueue
static SerialTaskQueue * enableGlobalQueue(Worker *iWorker)
Definition: Worker.h:807
edm::Worker::waitingTasks_
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:622
edm::workerhelper::CallImpl
Definition: Worker.h:77
a
double a
Definition: hdecay.h:119
edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin >
Definition: OccurrenceTraits.h:219
fetchall_from_DQM_v2.release
release
Definition: fetchall_from_DQM_v2.py:92
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::Arg
OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > Arg
Definition: Worker.h:793
WaitingTaskWithArenaHolder.h
edm::Worker::implRegisterThinnedAssociations
virtual void implRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)=0
edm::ServiceRegistry::presentToken
ServiceToken presentToken() const
Definition: ServiceRegistry.cc:63
edm::ModuleCallingContext::getStreamContext
StreamContext const * getStreamContext() const
Definition: ModuleCallingContext.cc:32
ExceptionMessages.h
edm::Worker::timesRun
int timesRun() const
Definition: Worker.h:227
edm::Worker::doWorkAsync
void doWorkAsync(WaitingTask *task, typename T::MyPrincipal const &, EventSetupImpl const &c, ServiceToken const &token, StreamID stream, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:831
edm::BranchActionStreamBegin
Definition: BranchActionType.h:13
thread_safety_macros.h
edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::pauseGlobalQueue
static SerialTaskQueue * pauseGlobalQueue(Worker *)
Definition: Worker.h:670
edm::Worker::RunModuleTask::EnableQueueGuard::queue_
SerialTaskQueue * queue_
Definition: Worker.h:420
edm::Worker::RunModuleTask::RunModuleTask
RunModuleTask(Worker *worker, typename T::MyPrincipal const &ep, EventSetupImpl const &es, ServiceToken const &token, StreamID streamID, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:404
ESRecordsToProxyIndices
helper
Definition: helper.py:1
edm::Worker::HandleExternalWorkExceptionTask::m_runModuleTask
WaitingTask * m_runModuleTask
Definition: Worker.h:600
edm::Worker::prePrefetchSelectionAsync
void prePrefetchSelectionAsync(WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *)
Definition: Worker.cc:232
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::wantsTransition
static bool wantsTransition(Worker const *iWorker)
Definition: Worker.h:765
edm::Worker::TransitionIDValueBase::value
virtual std::string value() const =0
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > >::enableGlobalQueue
static SerialTaskQueue * enableGlobalQueue(Worker *)
Definition: Worker.h:748
edm::ModuleCallingContext::setContext
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
Definition: ModuleCallingContext.cc:24
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::Worker::RunModuleTask::m_streamID
StreamID m_streamID
Definition: Worker.h:499
edm::Worker::setEarlyDeleteHelper
void setEarlyDeleteHelper(EarlyDeleteHelper *iHelper)
Definition: Worker.cc:275
edm::Worker::implDoBegin
virtual bool implDoBegin(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *mcc)=0
edm::Worker::ranAcquireWithoutException_
bool ranAcquireWithoutException_
Definition: Worker.h:624
edm::Worker::exceptionContext
static void exceptionContext(cms::Exception &ex, ModuleCallingContext const *mcc)
Definition: Worker.cc:104
edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >::AcquireTask
AcquireTask(Worker *worker, EventPrincipal const &ep, EventSetupImpl const &es, ServiceToken const &token, ParentContext const &parentContext, WaitingTaskWithArenaHolder holder)
Definition: Worker.h:524
edm::Worker::implRespondToOpenInputFile
virtual void implRespondToOpenInputFile(FileBlock const &fb)=0
edm::Worker::numberOfPathsOn_
int numberOfPathsOn_
Definition: Worker.h:610
edm::Worker::~Worker
virtual ~Worker()
Definition: Worker.cc:100
edm::Worker::timesFailed
int timesFailed() const
Definition: Worker.h:230
edm::Worker::TaskQueueAdaptor::TaskQueueAdaptor
TaskQueueAdaptor()=default
edm::Worker::moduleCallingContext_
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:613
InternalContext.h
ExceptionActions.h
edm::Worker::setPassed
bool setPassed()
Definition: Worker.h:345
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::Arg
OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > Arg
Definition: Worker.h:677
edm::Worker::respondToCloseInputFile
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:174
edm::Worker::timesFailed_
std::atomic< int > timesFailed_
Definition: Worker.h:607
edm::Worker::TaskQueueAdaptor
Definition: Worker.h:87
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd > >::needToRunSelection
static bool needToRunSelection(Worker const *iWorker)
Definition: Worker.h:824
edm::ExceptionToActionTable
Definition: ExceptionActions.h:16
edm::Worker::description
ModuleDescription const & description() const
Definition: Worker.h:190
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::Worker::state
State state() const
Definition: Worker.h:232
edm::Worker::cached_exception_
std::exception_ptr cached_exception_
Definition: Worker.h:616
edm::Worker::addedToPath
void addedToPath()
Definition: Worker.h:225
PathContext.h
edm::ServiceRegistry::instance
static ServiceRegistry & instance()
Definition: ServiceRegistry.cc:90
edm::Worker::implDoStreamEnd
virtual bool implDoStreamEnd(StreamID id, RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *mcc)=0
edm::Worker::TransitionIDValueBase
Definition: Worker.h:319
edm::EarlyDeleteHelper
Definition: EarlyDeleteHelper.h:40
edm::Worker::setFailed
bool setFailed()
Definition: Worker.h:354
WaitingTask.h
edm::make_empty_waiting_task
std::unique_ptr< edm::EmptyWaitingTask, waitingtask::TaskDestroyer > make_empty_waiting_task()
Create an EmptyWaitingTask which will properly be destroyed.
Definition: WaitingTaskList.h:96
edm::Worker::moduleType
virtual Types moduleType() const =0
edm::Worker::timesPassed
int timesPassed() const
Definition: Worker.h:229
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin > >::call
static bool call(Worker *iWorker, StreamID, RunPrincipal const &ep, EventSetupImpl const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:678
edm::Worker::RunModuleTask::EnableQueueGuard::EnableQueueGuard
EnableQueueGuard(EnableQueueGuard &&iGuard)
Definition: Worker.h:425
edm::Worker::wantsStreamRuns
virtual bool wantsStreamRuns() const =0
Types
Definition: Types.py:1
edm::Worker::itemsToGetFrom
virtual std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType) const =0
cms::cuda::device::unique_ptr
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Definition: device_unique_ptr.h:33
edm::Worker::AcquireTask::AcquireTask
AcquireTask(Worker *worker, typename T::MyPrincipal const &ep, EventSetupImpl const &es, ServiceToken const &token, ParentContext const &parentContext, WaitingTaskWithArenaHolder holder)
Definition: Worker.h:512
edm::Worker::hasAcquire
virtual bool hasAcquire() const =0
OccurrenceTraits.h
edm::Worker::implDoStreamBegin
virtual bool implDoStreamBegin(StreamID id, RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *mcc)=0
EarlyDeleteHelper
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > >::wantsTransition
static bool wantsTransition(Worker const *iWorker)
Definition: Worker.h:745
ParentContext.h
edm::Worker::clearCounters
void clearCounters()
Definition: Worker.h:217
edm::WaitingTask
Definition: WaitingTask.h:36
WorkerParams.h
edm::Worker::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()=0
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > >::enableGlobalQueue
static SerialTaskQueue * enableGlobalQueue(Worker *)
Definition: Worker.h:787
edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::call
static bool call(Worker *iWorker, StreamID, EventPrincipal const &ep, EventSetupImpl const &es, ActivityRegistry *, ModuleCallingContext const *mcc, Arg::Context const *)
Definition: Worker.h:657
edm::BranchActionGlobalEnd
Definition: BranchActionType.h:15
Frameworkfwd.h
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin > >::enableGlobalQueue
static SerialTaskQueue * enableGlobalQueue(Worker *)
Definition: Worker.h:768
T
long double T
Definition: Basic3DVectorLD.h:48
edm::Worker::updateLookup
virtual void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &)=0
edm::Worker::TaskQueueAdaptor::TaskQueueAdaptor
TaskQueueAdaptor(SerialTaskQueueChain *iChain)
Definition: Worker.h:92
edm::Worker::hasAccumulator
virtual bool hasAccumulator() const =0
edm::Worker::skipOnPath
void skipOnPath(EventPrincipal const &iEvent)
Definition: Worker.cc:363
edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >::m_worker
Worker * m_worker
Definition: Worker.h:581
edm::Worker::activityRegistry
ActivityRegistry * activityRegistry()
Definition: Worker.h:284
edm::Worker::RunModuleTask::EnableQueueGuard::EnableQueueGuard
EnableQueueGuard(SerialTaskQueue *iQueue)
Definition: Worker.h:421
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd > >::enableGlobalQueue
static SerialTaskQueue * enableGlobalQueue(Worker *iWorker)
Definition: Worker.h:729
edm::Worker::TaskQueueAdaptor::serial_
SerialTaskQueueChain * serial_
Definition: Worker.h:88
edm::Worker::doWork
bool doWork(typename T::MyPrincipal const &, EventSetupImpl const &c, StreamID stream, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:974
edm::Worker::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()=0
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::Worker::implDoAcquire
virtual void implDoAcquire(EventPrincipal const &, EventSetupImpl const &c, ModuleCallingContext const *mcc, WaitingTaskWithArenaHolder &holder)=0
edm::Worker::TransitionIDValue::p_
T const & p_
Definition: Worker.h:336
edm::Worker::doWorkNoPrefetchingAsync
void doWorkNoPrefetchingAsync(WaitingTask *task, typename T::MyPrincipal const &, EventSetupImpl const &c, ServiceToken const &token, StreamID stream, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:934
edm::Worker::implDo
virtual bool implDo(EventPrincipal const &, EventSetupImpl const &c, ModuleCallingContext const *mcc)=0
edm::Worker::handleExternalWorkException
std::exception_ptr handleExternalWorkException(std::exception_ptr const *iEPtr, ParentContext const &parentContext)
Definition: Worker.cc:422
edm::Worker::runAcquireAfterAsyncPrefetch
void runAcquireAfterAsyncPrefetch(std::exception_ptr const *iEPtr, EventPrincipal const &ep, EventSetupImpl const &es, ParentContext const &parentContext, WaitingTaskWithArenaHolder holder)
Definition: Worker.cc:395
Exception.h
edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd >
Definition: OccurrenceTraits.h:296
edm::Worker::implBeginStream
virtual void implBeginStream(StreamID)=0
edm::Worker::Ready
Definition: Worker.h:85
DUMMY
#define DUMMY
Definition: DMRtrends.cc:34
edm::Worker::TransitionIDValue::value
std::string value() const override
Definition: Worker.h:329
edm::Worker::RunModuleTask::m_context
T::Context const * m_context
Definition: Worker.h:501
edm::Worker::timesPass
int timesPass() const
Definition: Worker.h:234
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > >::call
static bool call(Worker *iWorker, StreamID id, RunPrincipal const &ep, EventSetupImpl const &es, ActivityRegistry *actReg, ModuleCallingContext const *mcc, Arg::Context const *context)
Definition: Worker.h:735
edm::Worker::emitPostModuleEventPrefetchingSignal
void emitPostModuleEventPrefetchingSignal()
Definition: Worker.h:374
SerialTaskQueueChain.h
edm::workerhelper::CallImpl< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin > >::enableGlobalQueue
static SerialTaskQueue * enableGlobalQueue(Worker *)
Definition: Worker.h:671
WaitingTaskList.h
edm::Worker::runModuleDirectly
std::exception_ptr runModuleDirectly(typename T::MyPrincipal const &ep, EventSetupImpl const &es, StreamID streamID, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:1137
cms::Exception
Definition: Exception.h:70
edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >::execute
tbb::task * execute() override
Definition: Worker.h:537
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >::m_holder
WaitingTaskWithArenaHolder m_holder
Definition: Worker.h:585
edm::Worker::RunModuleTask::m_principal
T::MyPrincipal const & m_principal
Definition: Worker.h:497
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamEnd > >::needToRunSelection
static bool needToRunSelection(Worker const *iWorker)
Definition: Worker.h:746
edm::SerialTaskQueueChain
Definition: SerialTaskQueueChain.h:32
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > >::wantsTransition
static bool wantsTransition(Worker const *iWorker)
Definition: Worker.h:707
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd > >::pauseGlobalQueue
static SerialTaskQueue * pauseGlobalQueue(Worker *iWorker)
Definition: Worker.h:806
ConsumesInfo.h
StreamID.h
edm::ServiceRegistry::Operate
Definition: ServiceRegistry.h:40
edm::Worker::TransitionIDValueBase::~TransitionIDValueBase
virtual ~TransitionIDValueBase()
Definition: Worker.h:322
edm::BranchActionStreamEnd
Definition: BranchActionType.h:14
CMS_THREAD_GUARD
#define CMS_THREAD_GUARD(_var_)
Definition: thread_safety_macros.h:6
edm::Worker::kOutputModule
Definition: Worker.h:86
ModuleContextSentry.h
edm::workerhelper::CallImpl< OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin > >::wantsTransition
static bool wantsTransition(Worker const *iWorker)
Definition: Worker.h:784
edm::workerhelper::CallImpl< OccurrenceTraits< RunPrincipal, BranchActionStreamBegin > >::pauseGlobalQueue
static SerialTaskQueue * pauseGlobalQueue(Worker *iWorker)
Definition: Worker.h:709
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
edm::Worker::beginStream
void beginStream(StreamID id, StreamContext &streamContext)
Definition: Worker.cc:315
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::Worker::implNeedToRunSelection
virtual bool implNeedToRunSelection() const =0
edm::LimitedTaskQueue::push
void push(T &&iAction)
asynchronously pushes functor iAction into queue
Definition: LimitedTaskQueue.h:127
edm::Worker::endStream
void endStream(StreamID id, StreamContext &streamContext)
Definition: Worker.cc:339
edm::Worker::workerType
virtual std::string workerType() const =0
edm::Worker::TaskQueueAdaptor::TaskQueueAdaptor
TaskQueueAdaptor(LimitedTaskQueue *iLimited)
Definition: Worker.h:93
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316