CMS 3D CMS Logo

Worker.cc
Go to the documentation of this file.
1 
2 /*----------------------------------------------------------------------
3 ----------------------------------------------------------------------*/
4 
17 #include "tbb/global_control.h"
18 
19 namespace edm {
20  namespace {
21  class ModuleBeginJobSignalSentry {
22  public:
23  ModuleBeginJobSignalSentry(ActivityRegistry* a, ModuleDescription const& md) : a_(a), md_(&md) {
24  if (a_)
25  a_->preModuleBeginJobSignal_(*md_);
26  }
27  ~ModuleBeginJobSignalSentry() {
28  if (a_)
29  a_->postModuleBeginJobSignal_(*md_);
30  }
31 
32  private:
33  ActivityRegistry* a_; // We do not use propagate_const because the registry itself is mutable.
34  ModuleDescription const* md_;
35  };
36 
37  class ModuleEndJobSignalSentry {
38  public:
39  ModuleEndJobSignalSentry(ActivityRegistry* a, ModuleDescription const& md) : a_(a), md_(&md) {
40  if (a_)
41  a_->preModuleEndJobSignal_(*md_);
42  }
43  ~ModuleEndJobSignalSentry() {
44  if (a_)
45  a_->postModuleEndJobSignal_(*md_);
46  }
47 
48  private:
49  ActivityRegistry* a_; // We do not use propagate_const because the registry itself is mutable.
50  ModuleDescription const* md_;
51  };
52 
53  class ModuleBeginStreamSignalSentry {
54  public:
55  ModuleBeginStreamSignalSentry(ActivityRegistry* a, StreamContext const& sc, ModuleCallingContext const& mcc)
56  : a_(a), sc_(sc), mcc_(mcc) {
57  if (a_)
58  a_->preModuleBeginStreamSignal_(sc_, mcc_);
59  }
60  ~ModuleBeginStreamSignalSentry() {
61  if (a_)
62  a_->postModuleBeginStreamSignal_(sc_, mcc_);
63  }
64 
65  private:
66  ActivityRegistry* a_; // We do not use propagate_const because the registry itself is mutable.
67  StreamContext const& sc_;
68  ModuleCallingContext const& mcc_;
69  };
70 
71  class ModuleEndStreamSignalSentry {
72  public:
73  ModuleEndStreamSignalSentry(ActivityRegistry* a, StreamContext const& sc, ModuleCallingContext const& mcc)
74  : a_(a), sc_(sc), mcc_(mcc) {
75  if (a_)
76  a_->preModuleEndStreamSignal_(sc_, mcc_);
77  }
78  ~ModuleEndStreamSignalSentry() {
79  if (a_)
80  a_->postModuleEndStreamSignal_(sc_, mcc_);
81  }
82 
83  private:
84  ActivityRegistry* a_; // We do not use propagate_const because the registry itself is mutable.
85  StreamContext const& sc_;
86  ModuleCallingContext const& mcc_;
87  };
88 
89  } // namespace
90 
92  : timesRun_(0),
93  timesVisited_(0),
94  timesPassed_(0),
95  timesFailed_(0),
96  timesExcept_(0),
97  state_(Ready),
98  numberOfPathsOn_(0),
99  numberOfPathsLeftToRun_(0),
100  moduleCallingContext_(&iMD),
101  actions_(iActions),
102  cached_exception_(),
103  actReg_(),
104  earlyDeleteHelper_(nullptr),
105  workStarted_(false),
106  ranAcquireWithoutException_(false) {}
107 
109 
110  void Worker::setActivityRegistry(std::shared_ptr<ActivityRegistry> areg) { actReg_ = areg; }
111 
113  ModuleCallingContext const* imcc = mcc;
114  while ((imcc->type() == ParentContext::Type::kModule) or (imcc->type() == ParentContext::Type::kInternal)) {
115  std::ostringstream iost;
117  iost << "Prefetching for module ";
118  } else {
119  iost << "Calling method for module ";
120  }
121  iost << imcc->moduleDescription()->moduleName() << "/'" << imcc->moduleDescription()->moduleLabel() << "'";
122 
123  if (imcc->type() == ParentContext::Type::kInternal) {
124  iost << " (probably inside some kind of mixing module)";
125  imcc = imcc->internalContext()->moduleCallingContext();
126  } else {
127  imcc = imcc->moduleCallingContext();
128  }
129  ex.addContext(iost.str());
130  }
131  std::ostringstream ost;
133  ost << "Prefetching for module ";
134  } else {
135  ost << "Calling method for module ";
136  }
137  ost << imcc->moduleDescription()->moduleName() << "/'" << imcc->moduleDescription()->moduleLabel() << "'";
138  ex.addContext(ost.str());
139 
140  if (imcc->type() == ParentContext::Type::kPlaceInPath) {
141  ost.str("");
142  ost << "Running path '";
143  ost << imcc->placeInPathContext()->pathContext()->pathName() << "'";
144  ex.addContext(ost.str());
145  auto streamContext = imcc->placeInPathContext()->pathContext()->streamContext();
146  if (streamContext) {
147  ost.str("");
148  edm::exceptionContext(ost, *streamContext);
149  ex.addContext(ost.str());
150  }
151  } else {
152  if (imcc->type() == ParentContext::Type::kStream) {
153  ost.str("");
154  edm::exceptionContext(ost, *(imcc->streamContext()));
155  ex.addContext(ost.str());
156  } else if (imcc->type() == ParentContext::Type::kGlobal) {
157  ost.str("");
158  edm::exceptionContext(ost, *(imcc->globalContext()));
159  ex.addContext(ost.str());
160  }
161  }
162  }
163 
164  bool Worker::shouldRethrowException(std::exception_ptr iPtr, ParentContext const& parentContext, bool isEvent) const {
165  // NOTE: the warning printed as a result of ignoring or failing
166  // a module will only be printed during the full true processing
167  // pass of this module
168 
169  // Get the action corresponding to this exception. However, if processing
170  // something other than an event (e.g. run, lumi) always rethrow.
171  if (not isEvent) {
172  return true;
173  }
174  try {
175  convertException::wrap([&]() { std::rethrow_exception(iPtr); });
176  } catch (cms::Exception& ex) {
178 
180  return true;
181  }
182 
183  ModuleCallingContext tempContext(&description(), ModuleCallingContext::State::kInvalid, parentContext, nullptr);
184 
185  // If we are processing an endpath and the module was scheduled, treat SkipEvent or FailPath
186  // as IgnoreCompletely, so any subsequent OutputModules are still run.
187  // For unscheduled modules only treat FailPath as IgnoreCompletely but still allow SkipEvent to throw
188  ModuleCallingContext const* top_mcc = tempContext.getTopModuleCallingContext();
189  if (top_mcc->type() == ParentContext::Type::kPlaceInPath &&
190  top_mcc->placeInPathContext()->pathContext()->isEndPath()) {
194  }
195  }
197  edm::printCmsExceptionWarning("IgnoreCompletely", ex);
198  return false;
199  }
200  }
201  return true;
202  }
203 
205  ServiceToken const& token,
206  StreamID id,
207  EventPrincipal const* iPrincipal) {
208  successTask->increment_ref_count();
209 
210  auto choiceTask = edm::make_waiting_task(
211  tbb::task::allocate_root(), [id, successTask, iPrincipal, this, token](std::exception_ptr const*) {
213  // There is no reasonable place to rethrow, and implDoPrePrefetchSelection() should not throw in the first place.
214  CMS_SA_ALLOW try {
215  if (not implDoPrePrefetchSelection(id, *iPrincipal, &moduleCallingContext_)) {
216  timesRun_.fetch_add(1, std::memory_order_relaxed);
217  setPassed<true>();
218  waitingTasks_.doneWaiting(nullptr);
219  //TBB requires that destroyed tasks have count 0
220  if (0 == successTask->decrement_ref_count()) {
221  tbb::task::destroy(*successTask);
222  }
223  return;
224  }
225  } catch (...) {
226  }
227  if (0 == successTask->decrement_ref_count()) {
228  tbb::task::spawn(*successTask);
229  }
230  });
231 
232  WaitingTaskHolder choiceHolder{choiceTask};
233 
234  std::vector<ProductResolverIndexAndSkipBit> items;
236 
237  for (auto const& item : items) {
238  ProductResolverIndex productResolverIndex = item.productResolverIndex();
239  bool skipCurrentProcess = item.skipCurrentProcess();
240  if (productResolverIndex != ProductResolverIndexAmbiguous) {
241  iPrincipal->prefetchAsync(choiceTask, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
242  }
243  }
244  choiceHolder.doneWaiting(std::exception_ptr{});
245  }
246 
248  EventSetupImpl const& iImpl,
249  Transition iTrans,
250  ServiceToken const& iToken) {
252  return;
253  }
254  auto const& recs = esRecordsToGetFrom(iTrans);
255  auto const& items = esItemsToGetFrom(iTrans);
256 
257  assert(items.size() == recs.size());
258  if (items.empty()) {
259  return;
260  }
261 
262  //Thread case of 1 thread special. The master thread is doing a wait_for_all on the
263  // default tbb arena. It will not process any tasks on the es arena. We need to add a
264  // task that will synchronously do a wait_for_all in the es arena to be sure prefetching
265  // will work.
266 
267  if UNLIKELY (tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism) == 1) {
268  //We spawn this first so that the other ES tasks are before it in the TBB queue
269  tbb::task_arena edArena(tbb::task_arena::attach{});
270  tbb::task::spawn(
271  *make_functor_task(tbb::task::allocate_root(),
272  [this, task = edm::WaitingTaskHolder(iTask), iTrans, &iImpl, iToken, edArena]() mutable {
273  esTaskArena().execute([this, iTrans, &iImpl, iToken, task = std::move(task), edArena]() {
274  auto waitTask = edm::make_empty_waiting_task();
275  auto const& recs = esRecordsToGetFrom(iTrans);
276  auto const& items = esItemsToGetFrom(iTrans);
277  waitTask->set_ref_count(2);
278  for (size_t i = 0; i != items.size(); ++i) {
279  if (recs[i] != ESRecordIndex{}) {
280  auto rec = iImpl.findImpl(recs[i]);
281  if (rec) {
282  rec->prefetchAsync(waitTask.get(), items[i], &iImpl, iToken);
283  }
284  }
285  }
286  waitTask->decrement_ref_count();
287  waitTask->wait_for_all();
288 
289  auto exPtr = waitTask->exceptionPtr();
290  tbb::task_arena(edArena).execute([task, exPtr]() {
291  auto t = task;
292  if (exPtr) {
293  t.doneWaiting(*exPtr);
294  } else {
295  t.doneWaiting(std::exception_ptr{});
296  }
297  });
298  });
299  }));
300  } else {
301  //We need iTask to run in the default arena since it is not an ES task
302  auto task =
303  make_waiting_task(tbb::task::allocate_root(),
304  [holder = WaitingTaskWithArenaHolder{iTask}](std::exception_ptr const* iExcept) mutable {
305  if (iExcept) {
306  holder.doneWaiting(*iExcept);
307  } else {
308  holder.doneWaiting(std::exception_ptr{});
309  }
310  });
311 
312  WaitingTaskHolder tempH(task);
313  esTaskArena().execute([&]() {
314  for (size_t i = 0; i != items.size(); ++i) {
315  if (recs[i] != ESRecordIndex{}) {
316  auto rec = iImpl.findImpl(recs[i]);
317  if (rec) {
318  rec->prefetchAsync(task, items[i], &iImpl, iToken);
319  }
320  }
321  }
322  });
323  }
324  }
325 
326  void Worker::edPrefetchAsync(WaitingTask* iTask, ServiceToken const& token, Principal const& iPrincipal) const {
327  // Prefetch products the module declares it consumes
328  std::vector<ProductResolverIndexAndSkipBit> const& items = itemsToGetFrom(iPrincipal.branchType());
329 
330  for (auto const& item : items) {
331  ProductResolverIndex productResolverIndex = item.productResolverIndex();
332  bool skipCurrentProcess = item.skipCurrentProcess();
333  if (productResolverIndex != ProductResolverIndexAmbiguous) {
334  iPrincipal.prefetchAsync(iTask, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
335  }
336  }
337  }
338 
340 
347  }
348 
350  try {
351  convertException::wrap([&]() {
352  ModuleBeginJobSignalSentry cpp(actReg_.get(), description());
353  implBeginJob();
354  });
355  } catch (cms::Exception& ex) {
356  state_ = Exception;
357  std::ostringstream ost;
358  ost << "Calling beginJob for module " << description().moduleName() << "/'" << description().moduleLabel() << "'";
359  ex.addContext(ost.str());
360  throw;
361  }
362  }
363 
364  void Worker::endJob() {
365  try {
366  convertException::wrap([&]() {
367  ModuleEndJobSignalSentry cpp(actReg_.get(), description());
368  implEndJob();
369  });
370  } catch (cms::Exception& ex) {
371  state_ = Exception;
372  std::ostringstream ost;
373  ost << "Calling endJob for module " << description().moduleName() << "/'" << description().moduleLabel() << "'";
374  ex.addContext(ost.str());
375  throw;
376  }
377  }
378 
379  void Worker::beginStream(StreamID id, StreamContext& streamContext) {
380  try {
381  convertException::wrap([&]() {
383  streamContext.setEventID(EventID(0, 0, 0));
384  streamContext.setRunIndex(RunIndex::invalidRunIndex());
386  streamContext.setTimestamp(Timestamp());
387  ParentContext parentContext(&streamContext);
388  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
390  ModuleBeginStreamSignalSentry beginSentry(actReg_.get(), streamContext, moduleCallingContext_);
391  implBeginStream(id);
392  });
393  } catch (cms::Exception& ex) {
394  state_ = Exception;
395  std::ostringstream ost;
396  ost << "Calling beginStream for module " << description().moduleName() << "/'" << description().moduleLabel()
397  << "'";
398  ex.addContext(ost.str());
399  throw;
400  }
401  }
402 
403  void Worker::endStream(StreamID id, StreamContext& streamContext) {
404  try {
405  convertException::wrap([&]() {
407  streamContext.setEventID(EventID(0, 0, 0));
408  streamContext.setRunIndex(RunIndex::invalidRunIndex());
410  streamContext.setTimestamp(Timestamp());
411  ParentContext parentContext(&streamContext);
412  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
414  ModuleEndStreamSignalSentry endSentry(actReg_.get(), streamContext, moduleCallingContext_);
415  implEndStream(id);
416  });
417  } catch (cms::Exception& ex) {
418  state_ = Exception;
419  std::ostringstream ost;
420  ost << "Calling endStream for module " << description().moduleName() << "/'" << description().moduleLabel()
421  << "'";
422  ex.addContext(ost.str());
423  throw;
424  }
425  }
426 
428  try {
430  } catch (cms::Exception& ex) {
431  ex.addContext("Calling registerThinnedAssociations() for module " + description().moduleLabel());
432  throw ex;
433  }
434  }
435 
437  if (earlyDeleteHelper_) {
438  earlyDeleteHelper_->pathFinished(iEvent);
439  }
440  if (0 == --numberOfPathsLeftToRun_) {
442  }
443  }
444 
446  if (earlyDeleteHelper_) {
447  earlyDeleteHelper_->moduleRan(iEvent);
448  }
449  }
450 
452  ParentContext const& parentContext,
453  WaitingTaskWithArenaHolder& holder) {
454  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
455  try {
456  convertException::wrap([&]() { this->implDoAcquire(info, &moduleCallingContext_, holder); });
457  } catch (cms::Exception& ex) {
459  if (shouldRethrowException(std::current_exception(), parentContext, true)) {
460  timesRun_.fetch_add(1, std::memory_order_relaxed);
461  throw;
462  }
463  }
464  }
465 
466  void Worker::runAcquireAfterAsyncPrefetch(std::exception_ptr const* iEPtr,
467  EventTransitionInfo const& eventTransitionInfo,
468  ParentContext const& parentContext,
471  std::exception_ptr exceptionPtr;
472  if (iEPtr) {
473  assert(*iEPtr);
474  if (shouldRethrowException(*iEPtr, parentContext, true)) {
475  exceptionPtr = *iEPtr;
476  }
478  } else {
479  // Caught exception is propagated via WaitingTaskWithArenaHolder
480  CMS_SA_ALLOW try {
481  runAcquire(eventTransitionInfo, parentContext, holder);
483  } catch (...) {
484  exceptionPtr = std::current_exception();
485  }
486  }
487  // It is important this is after runAcquire completely finishes
488  holder.doneWaiting(exceptionPtr);
489  }
490 
491  std::exception_ptr Worker::handleExternalWorkException(std::exception_ptr const* iEPtr,
492  ParentContext const& parentContext) {
494  try {
495  convertException::wrap([iEPtr]() { std::rethrow_exception(*iEPtr); });
496  } catch (cms::Exception& ex) {
497  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
499  return std::current_exception();
500  }
501  }
502  return *iEPtr;
503  }
504 
506  WaitingTask* runModuleTask,
507  ParentContext const& parentContext)
508  : m_worker(worker), m_runModuleTask(runModuleTask), m_parentContext(parentContext) {}
509 
511  auto excptr = exceptionPtr();
512  if (excptr) {
513  // increment the ref count so the holder will not spawn it
514  m_runModuleTask->set_ref_count(1);
515  WaitingTaskHolder holder(m_runModuleTask);
516  holder.doneWaiting(m_worker->handleExternalWorkException(excptr, m_parentContext));
517  }
518  m_runModuleTask->set_ref_count(0);
519  // Depend on TBB Scheduler Bypass to run the next task
520  return m_runModuleTask;
521  }
522 } // namespace edm
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::Worker::HandleExternalWorkExceptionTask::execute
tbb::task * execute() override
Definition: Worker.cc:510
edm::ModuleCallingContext::state
State state() const
Definition: ModuleCallingContext.h:51
edm::StreamID
Definition: StreamID.h:30
edm::ModuleDescription::moduleLabel
std::string const & moduleLabel() const
Definition: ModuleDescription.h:43
edm::Worker::itemsToGetForSelection
virtual void itemsToGetForSelection(std::vector< ProductResolverIndexAndSkipBit > &) const =0
edm::EventSetupImpl::findImpl
eventsetup::EventSetupRecordImpl const * findImpl(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetupImpl.cc:59
edm::Worker::implDoPrePrefetchSelection
virtual bool implDoPrePrefetchSelection(StreamID, EventPrincipal const &, ModuleCallingContext const *)=0
edm::Worker::HandleExternalWorkExceptionTask::HandleExternalWorkExceptionTask
HandleExternalWorkExceptionTask(Worker *worker, WaitingTask *runModuleTask, ParentContext const &parentContext)
Definition: Worker.cc:505
edm::InternalContext::moduleCallingContext
ModuleCallingContext const * moduleCallingContext() const
Definition: InternalContext.h:28
edm::exceptionContext
void exceptionContext(std::ostream &, GlobalContext const &)
Definition: GlobalContext.cc:71
edm::ProductResolverIndex
unsigned int ProductResolverIndex
Definition: ProductResolverIndex.h:8
mps_fire.i
i
Definition: mps_fire.py:428
edm::Worker::esPrefetchAsync
void esPrefetchAsync(WaitingTask *, EventSetupImpl const &, Transition, ServiceToken const &)
Definition: Worker.cc:247
edm::ModuleCallingContext::State::kPrefetching
funct::false
false
Definition: Factorize.h:29
cms::Exception::addContext
void addContext(std::string const &context)
Definition: Exception.cc:165
edm::PathContext::streamContext
StreamContext const * streamContext() const
Definition: PathContext.h:31
edm::Worker::actReg_
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:563
edm::Worker::implEndJob
virtual void implEndJob()=0
edm::StreamContext::setTransition
void setTransition(Transition v)
Definition: StreamContext.h:65
ActivityRegistry
edm::exception_actions::Rethrow
Definition: ExceptionActions.h:11
edm::ModuleContextSentry
Definition: ModuleContextSentry.h:11
edm::EventSetupImpl
Definition: EventSetupImpl.h:48
WaitingTaskHolder.h
edm::ModuleCallingContext::placeInPathContext
PlaceInPathContext const * placeInPathContext() const
Definition: ModuleCallingContext.h:55
edm::ModuleCallingContext::globalContext
GlobalContext const * globalContext() const
Definition: ModuleCallingContext.h:57
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Worker::beginJob
void beginJob()
Definition: Worker.cc:349
edm::printCmsExceptionWarning
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
Definition: ExceptionMessages.cc:25
edm::Worker::Exception
Definition: Worker.h:90
edm::Worker::resetModuleDescription
void resetModuleDescription(ModuleDescription const *)
Definition: Worker.cc:341
edm::ModuleDescription::moduleName
std::string const & moduleName() const
Definition: ModuleDescription.h:42
edm::Worker::postDoEvent
void postDoEvent(EventPrincipal const &)
Definition: Worker.cc:445
edm::Worker::actions_
ExceptionToActionTable const * actions_
Definition: Worker.h:560
edm::StreamContext::setTimestamp
void setTimestamp(Timestamp const &v)
Definition: StreamContext.h:69
edm::ModuleCallingContext::streamContext
StreamContext const * streamContext() const
Definition: ModuleCallingContext.h:56
edm::Worker::implBeginJob
virtual void implBeginJob()=0
EventSetupImpl.h
edm::make_functor_task
FunctorTask< F > * make_functor_task(ALLOC &&iAlloc, F f)
Definition: FunctorTask.h:47
edm::PlaceInPathContext::pathContext
PathContext const * pathContext() const
Definition: PlaceInPathContext.h:24
edm::ModuleCallingContext::type
Type type() const
Definition: ModuleCallingContext.h:52
edm::StreamContext::setLuminosityBlockIndex
void setLuminosityBlockIndex(LuminosityBlockIndex const &v)
Definition: StreamContext.h:68
edm::ParentContext::Type::kStream
edm::Worker::Worker
Worker(ModuleDescription const &iMD, ExceptionToActionTable const *iActions)
Definition: Worker.cc:91
cms::cuda::assert
assert(be >=bs)
edm::Principal
Definition: Principal.h:57
edm::Worker::numberOfPathsLeftToRun_
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:556
edm::Worker::registerThinnedAssociations
void registerThinnedAssociations(ProductRegistry const &registry, ThinnedAssociationsHelper &helper)
Definition: Worker.cc:427
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
ProcessBlockPrincipal.h
edm::ParentContext::Type::kGlobal
edm::ParentContext::Type::kPlaceInPath
edm::ModuleCallingContext::State::kInvalid
edm::ModuleCallingContext::moduleDescription
ModuleDescription const * moduleDescription() const
Definition: ModuleCallingContext.h:50
edm::esTaskArena
tbb::task_arena & esTaskArena()
Definition: esTaskArenas.cc:8
edm::WaitingTaskHolder::doneWaiting
void doneWaiting(std::exception_ptr iExcept)
Definition: WaitingTaskHolder.h:75
edm::ESRecordIndex
Definition: ESIndices.h:80
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
edm::Worker::implEndStream
virtual void implEndStream(StreamID)=0
edm::ModuleCallingContext::parent
ParentContext const & parent() const
Definition: ModuleCallingContext.h:53
edm::ModuleDescription
Definition: ModuleDescription.h:21
mps_monitormerge.items
list items
Definition: mps_monitormerge.py:29
edm::eventsetup::EventSetupRecordImpl::prefetchAsync
void prefetchAsync(WaitingTask *iTask, ESProxyIndex iProxyIndex, EventSetupImpl const *, ServiceToken const &) const
prefetch the data to setup for subsequent calls to getImplementation
Definition: EventSetupRecordImpl.cc:260
edm::ModuleCallingContext::moduleCallingContext
ModuleCallingContext const * moduleCallingContext() const
Definition: ModuleCallingContext.h:54
edm::ProductRegistry
Definition: ProductRegistry.h:37
edm::ServiceToken
Definition: ServiceToken.h:40
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
edm::WaitingTaskWithArenaHolder
Definition: WaitingTaskWithArenaHolder.h:31
edm::Worker::runAcquireAfterAsyncPrefetch
void runAcquireAfterAsyncPrefetch(std::exception_ptr const *, EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder)
Definition: Worker.cc:466
edm::Worker::edPrefetchAsync
void edPrefetchAsync(WaitingTask *, ServiceToken const &, Principal const &) const
Definition: Worker.cc:326
edm::EventPrincipal
Definition: EventPrincipal.h:46
edm::Worker::earlyDeleteHelper_
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:565
edm::Worker::setActivityRegistry
void setActivityRegistry(std::shared_ptr< ActivityRegistry > areg)
Definition: Worker.cc:110
edm::StreamContext
Definition: StreamContext.h:31
EarlyDeleteHelper.h
edm::Worker::timesRun_
std::atomic< int > timesRun_
Definition: Worker.h:549
edm::ModuleCallingContext::internalContext
InternalContext const * internalContext() const
Definition: ModuleCallingContext.h:58
EventPrincipal.h
edm::convertException::wrap
auto wrap(F iFunc) -> decltype(iFunc())
Definition: ConvertException.h:19
edm::StreamContext::Transition::kBeginStream
edm::ParentContext::Type::kInternal
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
edm::Worker::state_
std::atomic< State > state_
Definition: Worker.h:554
edm::Principal::branchType
BranchType const & branchType() const
Definition: Principal.h:181
edm::exception_actions::FailPath
Definition: ExceptionActions.h:11
edm::Worker::endJob
void endJob()
Definition: Worker.cc:364
edm::WaitingTaskList::doneWaiting
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
Definition: WaitingTaskList.cc:170
edm::Principal::prefetchAsync
void prefetchAsync(WaitingTask *waitTask, ProductResolverIndex index, bool skipCurrentProcess, ServiceToken const &token, ModuleCallingContext const *mcc) const
Definition: Principal.cc:626
edm::exception_actions::SkipEvent
Definition: ExceptionActions.h:11
edm::ParentContext::Type::kModule
edm::Worker
Definition: Worker.h:88
edm::make_waiting_task
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:87
edm::ParentContext
Definition: ParentContext.h:27
edm::PathContext::isEndPath
bool isEndPath() const
Definition: PathContext.h:35
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::Worker::runAcquire
void runAcquire(EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder &)
Definition: Worker.cc:451
edm::Worker::implDoAcquire
virtual void implDoAcquire(EventTransitionInfo const &, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)=0
edm::Worker::waitingTasks_
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:567
edm::Transition
Transition
Definition: Transition.h:12
a
double a
Definition: hdecay.h:119
edm::LuminosityBlockIndex::invalidLuminosityBlockIndex
static LuminosityBlockIndex invalidLuminosityBlockIndex()
Definition: LuminosityBlockIndex.cc:9
WaitingTaskWithArenaHolder.h
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:30
edm::ModuleCallingContext::previousModuleOnThread
ModuleCallingContext const * previousModuleOnThread() const
Definition: ModuleCallingContext.h:75
Ready
Definition: hltDiff.cc:243
edm::Worker::implRegisterThinnedAssociations
virtual void implRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)=0
edm::ModuleCallingContext::setState
void setState(State state)
Definition: ModuleCallingContext.h:48
RunPrincipal.h
helper
Definition: helper.py:1
edm::Worker::prePrefetchSelectionAsync
void prePrefetchSelectionAsync(WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *)
Definition: Worker.cc:204
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::setEarlyDeleteHelper
void setEarlyDeleteHelper(EarlyDeleteHelper *iHelper)
Definition: Worker.cc:339
edm::Worker::ranAcquireWithoutException_
bool ranAcquireWithoutException_
Definition: Worker.h:569
edm::Worker::exceptionContext
static void exceptionContext(cms::Exception &ex, ModuleCallingContext const *mcc)
Definition: Worker.cc:112
edm::Worker::~Worker
virtual ~Worker()
Definition: Worker.cc:108
writedatasetfile.action
action
Definition: writedatasetfile.py:8
edm::StreamContext::setEventID
void setEventID(EventID const &v)
Definition: StreamContext.h:66
edm::Worker::moduleCallingContext_
ModuleCallingContext moduleCallingContext_
Definition: Worker.h:558
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::ExceptionToActionTable
Definition: ExceptionActions.h:16
edm::Worker::description
ModuleDescription const & description() const
Definition: Worker.h:188
edm::Worker::cached_exception_
std::exception_ptr cached_exception_
Definition: Worker.h:561
edm::EarlyDeleteHelper
Definition: EarlyDeleteHelper.h:40
edm::RunIndex::invalidRunIndex
static RunIndex invalidRunIndex()
Definition: RunIndex.cc:9
edm::ModuleCallingContext::getTopModuleCallingContext
ModuleCallingContext const * getTopModuleCallingContext() const
Definition: ModuleCallingContext.cc:52
edm::PathContext::pathName
std::string const & pathName() const
Definition: PathContext.h:30
LuminosityBlockPrincipal.h
edm::Worker::esRecordsToGetFrom
virtual std::vector< ESRecordIndex > const & esRecordsToGetFrom(Transition) const =0
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::ProductResolverIndexAmbiguous
Definition: ProductResolverIndex.h:18
edm::Worker::itemsToGetFrom
virtual std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType) const =0
edm::WaitingTask
Definition: WaitingTask.h:36
eostools.move
def move(src, dest)
Definition: eostools.py:511
esTaskArenas.h
edm::StreamContext::setRunIndex
void setRunIndex(RunIndex const &v)
Definition: StreamContext.h:67
edm::Worker::skipOnPath
void skipOnPath(EventPrincipal const &iEvent)
Definition: Worker.cc:436
Worker.h
edm::Worker::esItemsToGetFrom
virtual std::vector< ESProxyIndex > const & esItemsToGetFrom(Transition) const =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::handleExternalWorkException
std::exception_ptr handleExternalWorkException(std::exception_ptr const *iEPtr, ParentContext const &parentContext)
Definition: Worker.cc:491
edm::ExceptionToActionTable::find
exception_actions::ActionCodes find(const std::string &category) const
Definition: ExceptionActions.cc:85
edm::Worker::implBeginStream
virtual void implBeginStream(StreamID)=0
cms::Exception
Definition: Exception.h:70
StreamContext.h
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::EventID
Definition: EventID.h:31
edm::exception_actions::IgnoreCompletely
Definition: ExceptionActions.h:11
cms::Exception::category
std::string const & category() const
Definition: Exception.cc:143
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::ServiceRegistry::Operate
Definition: ServiceRegistry.h:40
edm::Worker::beginStream
void beginStream(StreamID id, StreamContext &streamContext)
Definition: Worker.cc:379
edm::Worker::endStream
void endStream(StreamID id, StreamContext &streamContext)
Definition: Worker.cc:403
edm::StreamContext::Transition::kEndStream
edm::exception_actions::ActionCodes
ActionCodes
Definition: ExceptionActions.h:11
edm::Worker::shouldRethrowException
bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const &parentContext, bool isEvent) const
Definition: Worker.cc:164
edm::Transition::NumberOfEventSetupTransitions
edm::ModuleCallingContext::State::kRunning
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:318
edm::WaitingTaskWithArenaHolder::doneWaiting
void doneWaiting(std::exception_ptr iExcept)
Definition: WaitingTaskWithArenaHolder.cc:62
edm::Timestamp
Definition: Timestamp.h:30