CMS 3D CMS Logo

Worker.cc
Go to the documentation of this file.
1 
2 /*----------------------------------------------------------------------
3 ----------------------------------------------------------------------*/
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  WaitingTask* successTask,
206  ServiceToken const& token,
207  StreamID id,
208  EventPrincipal const* iPrincipal) {
209  successTask->increment_ref_count();
210 
211  ServiceWeakToken weakToken = token;
212  auto choiceTask =
213  edm::make_waiting_task([id, successTask, iPrincipal, this, weakToken, &group](std::exception_ptr const*) {
214  ServiceRegistry::Operate guard(weakToken.lock());
215  // There is no reasonable place to rethrow, and implDoPrePrefetchSelection() should not throw in the first place.
216  CMS_SA_ALLOW try {
217  if (not implDoPrePrefetchSelection(id, *iPrincipal, &moduleCallingContext_)) {
218  timesRun_.fetch_add(1, std::memory_order_relaxed);
219  setPassed<true>();
220  waitingTasks_.doneWaiting(nullptr);
221  //TBB requires that destroyed tasks have count 0
222  if (0 == successTask->decrement_ref_count()) {
223  TaskSentry s(successTask);
224  }
225  return;
226  }
227  } catch (...) {
228  }
229  if (0 == successTask->decrement_ref_count()) {
230  group.run([successTask]() {
231  TaskSentry s(successTask);
232  successTask->execute();
233  });
234  }
235  });
236 
237  WaitingTaskHolder choiceHolder{group, choiceTask};
238 
239  std::vector<ProductResolverIndexAndSkipBit> items;
241 
242  for (auto const& item : items) {
243  ProductResolverIndex productResolverIndex = item.productResolverIndex();
244  bool skipCurrentProcess = item.skipCurrentProcess();
245  if (productResolverIndex != ProductResolverIndexAmbiguous) {
246  iPrincipal->prefetchAsync(
247  choiceHolder, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
248  }
249  }
250  choiceHolder.doneWaiting(std::exception_ptr{});
251  }
252 
254  EventSetupImpl const& iImpl,
255  Transition iTrans,
256  ServiceToken const& iToken) {
258  return;
259  }
260  auto const& recs = esRecordsToGetFrom(iTrans);
261  auto const& items = esItemsToGetFrom(iTrans);
262 
263  assert(items.size() == recs.size());
264  if (items.empty()) {
265  return;
266  }
267 
268  //Thread case of 1 thread special. The master thread is doing a wait_for_all on the
269  // default tbb arena. It will not process any tasks on the es arena. We need to add a
270  // task that will synchronously do a wait_for_all in the es arena to be sure prefetching
271  // will work.
272 
273  if UNLIKELY (tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism) == 1) {
274  auto taskGroup = iTask.group();
275  ServiceWeakToken weakToken = iToken;
276  taskGroup->run([this, task = std::move(iTask), iTrans, &iImpl, weakToken]() {
277  std::exception_ptr exceptPtr{};
278  iImpl.taskArena()->execute([this, iTrans, &iImpl, weakToken, &exceptPtr]() {
279  exceptPtr = syncWait([&](WaitingTaskHolder&& iHolder) {
280  auto const& recs = esRecordsToGetFrom(iTrans);
281  auto const& items = esItemsToGetFrom(iTrans);
282  auto hWaitTask = std::move(iHolder);
283  auto token = weakToken.lock();
284  for (size_t i = 0; i != items.size(); ++i) {
285  if (recs[i] != ESRecordIndex{}) {
286  auto rec = iImpl.findImpl(recs[i]);
287  if (rec) {
288  rec->prefetchAsync(hWaitTask, items[i], &iImpl, token, ESParentContext(&moduleCallingContext_));
289  }
290  }
291  }
292  }); //syncWait
293  }); //esTaskArena().execute
294  //note use of a copy gets around declaring the lambda as mutable
295  auto tempTask = task;
296  tempTask.doneWaiting(exceptPtr);
297  }); //group.run
298  } else {
299  auto group = iTask.group();
300  //We need iTask to run in the default arena since it is not an ES task
301  auto task = make_waiting_task(
302  [holder = WaitingTaskWithArenaHolder(std::move(iTask))](std::exception_ptr const* iExcept) mutable {
303  if (iExcept) {
304  holder.doneWaiting(*iExcept);
305  } else {
306  holder.doneWaiting(std::exception_ptr{});
307  }
308  });
309 
310  WaitingTaskHolder tempH(*group, task);
311  iImpl.taskArena()->execute([&]() {
312  for (size_t i = 0; i != items.size(); ++i) {
313  if (recs[i] != ESRecordIndex{}) {
314  auto rec = iImpl.findImpl(recs[i]);
315  if (rec) {
316  rec->prefetchAsync(tempH, items[i], &iImpl, iToken, ESParentContext(&moduleCallingContext_));
317  }
318  }
319  }
320  });
321  }
322  }
323 
324  void Worker::edPrefetchAsync(WaitingTaskHolder iTask, ServiceToken const& token, Principal const& iPrincipal) const {
325  // Prefetch products the module declares it consumes
326  std::vector<ProductResolverIndexAndSkipBit> const& items = itemsToGetFrom(iPrincipal.branchType());
327 
328  for (auto const& item : items) {
329  ProductResolverIndex productResolverIndex = item.productResolverIndex();
330  bool skipCurrentProcess = item.skipCurrentProcess();
331  if (productResolverIndex != ProductResolverIndexAmbiguous) {
332  iPrincipal.prefetchAsync(iTask, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
333  }
334  }
335  }
336 
338 
345  }
346 
348  try {
349  convertException::wrap([&]() {
350  ModuleBeginJobSignalSentry cpp(actReg_.get(), *description());
351  implBeginJob();
352  });
353  } catch (cms::Exception& ex) {
354  state_ = Exception;
355  std::ostringstream ost;
356  ost << "Calling beginJob for module " << description()->moduleName() << "/'" << description()->moduleLabel()
357  << "'";
358  ex.addContext(ost.str());
359  throw;
360  }
361  }
362 
363  void Worker::endJob() {
364  try {
365  convertException::wrap([&]() {
367  assert(desc != nullptr);
368  ModuleEndJobSignalSentry cpp(actReg_.get(), *desc);
369  implEndJob();
370  });
371  } catch (cms::Exception& ex) {
372  state_ = Exception;
373  std::ostringstream ost;
374  ost << "Calling endJob for module " << description()->moduleName() << "/'" << description()->moduleLabel() << "'";
375  ex.addContext(ost.str());
376  throw;
377  }
378  }
379 
380  void Worker::beginStream(StreamID id, StreamContext& streamContext) {
381  try {
382  convertException::wrap([&]() {
384  streamContext.setEventID(EventID(0, 0, 0));
385  streamContext.setRunIndex(RunIndex::invalidRunIndex());
387  streamContext.setTimestamp(Timestamp());
388  ParentContext parentContext(&streamContext);
389  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
391  ModuleBeginStreamSignalSentry beginSentry(actReg_.get(), streamContext, moduleCallingContext_);
392  implBeginStream(id);
393  });
394  } catch (cms::Exception& ex) {
395  state_ = Exception;
396  std::ostringstream ost;
397  ost << "Calling beginStream for module " << description()->moduleName() << "/'" << description()->moduleLabel()
398  << "'";
399  ex.addContext(ost.str());
400  throw;
401  }
402  }
403 
404  void Worker::endStream(StreamID id, StreamContext& streamContext) {
405  try {
406  convertException::wrap([&]() {
408  streamContext.setEventID(EventID(0, 0, 0));
409  streamContext.setRunIndex(RunIndex::invalidRunIndex());
411  streamContext.setTimestamp(Timestamp());
412  ParentContext parentContext(&streamContext);
413  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
415  ModuleEndStreamSignalSentry endSentry(actReg_.get(), streamContext, moduleCallingContext_);
416  implEndStream(id);
417  });
418  } catch (cms::Exception& ex) {
419  state_ = Exception;
420  std::ostringstream ost;
421  ost << "Calling endStream for module " << description()->moduleName() << "/'" << description()->moduleLabel()
422  << "'";
423  ex.addContext(ost.str());
424  throw;
425  }
426  }
427 
429  try {
431  } catch (cms::Exception& ex) {
432  ex.addContext("Calling registerThinnedAssociations() for module " + description()->moduleLabel());
433  throw ex;
434  }
435  }
436 
438  if (earlyDeleteHelper_) {
439  earlyDeleteHelper_->pathFinished(iEvent);
440  }
441  if (0 == --numberOfPathsLeftToRun_) {
443  }
444  }
445 
447  if (earlyDeleteHelper_) {
448  earlyDeleteHelper_->moduleRan(iEvent);
449  }
450  }
451 
453  ParentContext const& parentContext,
454  WaitingTaskWithArenaHolder& holder) {
455  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
456  try {
457  convertException::wrap([&]() { this->implDoAcquire(info, &moduleCallingContext_, holder); });
458  } catch (cms::Exception& ex) {
460  if (shouldRethrowException(std::current_exception(), parentContext, true)) {
461  timesRun_.fetch_add(1, std::memory_order_relaxed);
462  throw;
463  }
464  }
465  }
466 
467  void Worker::runAcquireAfterAsyncPrefetch(std::exception_ptr const* iEPtr,
468  EventTransitionInfo const& eventTransitionInfo,
469  ParentContext const& parentContext,
472  std::exception_ptr exceptionPtr;
473  if (iEPtr) {
474  assert(*iEPtr);
475  if (shouldRethrowException(*iEPtr, parentContext, true)) {
476  exceptionPtr = *iEPtr;
477  }
479  } else {
480  // Caught exception is propagated via WaitingTaskWithArenaHolder
481  CMS_SA_ALLOW try {
482  runAcquire(eventTransitionInfo, parentContext, holder);
484  } catch (...) {
485  exceptionPtr = std::current_exception();
486  }
487  }
488  // It is important this is after runAcquire completely finishes
489  holder.doneWaiting(exceptionPtr);
490  }
491 
492  std::exception_ptr Worker::handleExternalWorkException(std::exception_ptr const* iEPtr,
493  ParentContext const& parentContext) {
495  try {
496  convertException::wrap([iEPtr]() { std::rethrow_exception(*iEPtr); });
497  } catch (cms::Exception& ex) {
498  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
500  return std::current_exception();
501  }
502  }
503  return *iEPtr;
504  }
505 
507  tbb::task_group* group,
508  WaitingTask* runModuleTask,
509  ParentContext const& parentContext)
510  : m_worker(worker), m_runModuleTask(runModuleTask), m_group(group), m_parentContext(parentContext) {}
511 
513  auto excptr = exceptionPtr();
514  WaitingTaskHolder holder(*m_group, m_runModuleTask);
515  if (excptr) {
516  holder.doneWaiting(m_worker->handleExternalWorkException(excptr, m_parentContext));
517  }
518  }
519 } // namespace edm
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
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:60
edm::Worker::implDoPrePrefetchSelection
virtual bool implDoPrePrefetchSelection(StreamID, EventPrincipal const &, ModuleCallingContext const *)=0
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::ModuleCallingContext::State::kPrefetching
funct::false
false
Definition: Factorize.h:29
cms::Exception::addContext
void addContext(std::string const &context)
Definition: Exception.cc:165
edm::ServiceWeakToken
Definition: ServiceToken.h:86
edm::PathContext::streamContext
StreamContext const * streamContext() const
Definition: PathContext.h:31
edm::Worker::actReg_
std::shared_ptr< ActivityRegistry > actReg_
Definition: Worker.h:583
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:49
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:347
edm::printCmsExceptionWarning
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
Definition: ExceptionMessages.cc:25
edm::Worker::Exception
Definition: Worker.h:93
edm::Worker::resetModuleDescription
void resetModuleDescription(ModuleDescription const *)
Definition: Worker.cc:339
edm::ModuleDescription::moduleName
std::string const & moduleName() const
Definition: ModuleDescription.h:42
edm::Worker::postDoEvent
void postDoEvent(EventPrincipal const &)
Definition: Worker.cc:446
edm::Worker::actions_
ExceptionToActionTable const * actions_
Definition: Worker.h:580
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::HandleExternalWorkExceptionTask::execute
void execute() final
Definition: Worker.cc:512
edm::Worker::implBeginJob
virtual void implBeginJob()=0
EventSetupImpl.h
edm::PlaceInPathContext::pathContext
PathContext const * pathContext() const
Definition: PlaceInPathContext.h:24
edm::ModuleCallingContext::type
Type type() const
Definition: ModuleCallingContext.h:52
edm::Worker::HandleExternalWorkExceptionTask::HandleExternalWorkExceptionTask
HandleExternalWorkExceptionTask(Worker *worker, tbb::task_group *group, WaitingTask *runModuleTask, ParentContext const &parentContext)
Definition: Worker.cc:506
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:56
edm::Worker::numberOfPathsLeftToRun_
std::atomic< int > numberOfPathsLeftToRun_
Definition: Worker.h:576
edm::Worker::registerThinnedAssociations
void registerThinnedAssociations(ProductRegistry const &registry, ThinnedAssociationsHelper &helper)
Definition: Worker.cc:428
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::WaitingTaskHolder::doneWaiting
void doneWaiting(std::exception_ptr iExcept)
Definition: WaitingTaskHolder.h:93
edm::TaskSentry
Definition: TaskBase.h:50
edm::ESRecordIndex
Definition: ESIndices.h:80
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::eventsetup::EventSetupRecordImpl::prefetchAsync
void prefetchAsync(WaitingTaskHolder iTask, ESProxyIndex iProxyIndex, EventSetupImpl const *, ServiceToken const &, ESParentContext) const
prefetch the data to setup for subsequent calls to getImplementation
Definition: EventSetupRecordImpl.cc:265
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::ModuleCallingContext::moduleCallingContext
ModuleCallingContext const * moduleCallingContext() const
Definition: ModuleCallingContext.h:54
edm::ProductRegistry
Definition: ProductRegistry.h:37
edm::Worker::description
ModuleDescription const * description() const
Definition: Worker.h:188
edm::ServiceToken
Definition: ServiceToken.h:42
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
edm::WaitingTaskWithArenaHolder
Definition: WaitingTaskWithArenaHolder.h:34
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::Worker::runAcquireAfterAsyncPrefetch
void runAcquireAfterAsyncPrefetch(std::exception_ptr const *, EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder)
Definition: Worker.cc:467
edm::EventPrincipal
Definition: EventPrincipal.h:48
edm::Worker::earlyDeleteHelper_
edm::propagate_const< EarlyDeleteHelper * > earlyDeleteHelper_
Definition: Worker.h:585
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:569
edm::ModuleCallingContext::internalContext
InternalContext const * internalContext() const
Definition: ModuleCallingContext.h:58
EventPrincipal.h
edm::TaskBase::execute
virtual void execute()=0
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:253
edm::Worker::state_
std::atomic< State > state_
Definition: Worker.h:574
edm::Principal::branchType
BranchType const & branchType() const
Definition: Principal.h:181
edm::EventSetupImpl::taskArena
tbb::task_arena * taskArena() const
Definition: EventSetupImpl.h:74
edm::exception_actions::FailPath
Definition: ExceptionActions.h:11
edm::Worker::endJob
void endJob()
Definition: Worker.cc:363
edm::WaitingTaskList::doneWaiting
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
Definition: WaitingTaskList.cc:212
edm::exception_actions::SkipEvent
Definition: ExceptionActions.h:11
edm::ParentContext::Type::kModule
edm::Worker
Definition: Worker.h:91
edm::ParentContext
Definition: ParentContext.h:27
edm::PathContext::isEndPath
bool isEndPath() const
Definition: PathContext.h:35
include_first_syncWait.h
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::Worker::runAcquire
void runAcquire(EventTransitionInfo const &, ParentContext const &, WaitingTaskWithArenaHolder &)
Definition: Worker.cc:452
edm::Worker::implDoAcquire
virtual void implDoAcquire(EventTransitionInfo const &, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)=0
edm::Worker::waitingTasks_
edm::WaitingTaskList waitingTasks_
Definition: Worker.h:587
edm::Transition
Transition
Definition: Transition.h:12
a
double a
Definition: hdecay.h:119
edm::make_waiting_task
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
ESParentContext.h
edm::LuminosityBlockIndex::invalidLuminosityBlockIndex
static LuminosityBlockIndex invalidLuminosityBlockIndex()
Definition: LuminosityBlockIndex.cc:9
WaitingTaskWithArenaHolder.h
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::ModuleCallingContext::previousModuleOnThread
ModuleCallingContext const * previousModuleOnThread() const
Definition: ModuleCallingContext.h:75
Ready
Definition: hltDiff.cc:242
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::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:337
edm::Worker::ranAcquireWithoutException_
bool ranAcquireWithoutException_
Definition: Worker.h:589
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:578
edm::ServiceWeakToken::lock
ServiceToken lock() const
Definition: ServiceToken.h:101
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::ESParentContext
Definition: ESParentContext.h:21
edm::TaskBase::increment_ref_count
void increment_ref_count()
Definition: TaskBase.h:41
edm::ExceptionToActionTable
Definition: ExceptionActions.h:16
edm::Worker::esPrefetchAsync
void esPrefetchAsync(WaitingTaskHolder, EventSetupImpl const &, Transition, ServiceToken const &)
Definition: Worker.cc:253
edm::Worker::cached_exception_
std::exception_ptr cached_exception_
Definition: Worker.h:581
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::ProductResolverIndexAmbiguous
Definition: ProductResolverIndex.h:18
edm::TaskBase::decrement_ref_count
unsigned int decrement_ref_count()
Definition: TaskBase.h:42
edm::Worker::itemsToGetFrom
virtual std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType) const =0
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::WaitingTask
Definition: WaitingTask.h:36
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::StreamContext::setRunIndex
void setRunIndex(RunIndex const &v)
Definition: StreamContext.h:67
edm::Worker::skipOnPath
void skipOnPath(EventPrincipal const &iEvent)
Definition: Worker.cc:437
Worker.h
edm::Worker::edPrefetchAsync
void edPrefetchAsync(WaitingTaskHolder, ServiceToken const &, Principal const &) const
Definition: Worker.cc:324
edm::Worker::esItemsToGetFrom
virtual std::vector< ESProxyIndex > const & esItemsToGetFrom(Transition) const =0
edm::Worker::prePrefetchSelectionAsync
void prePrefetchSelectionAsync(tbb::task_group &, WaitingTask *task, ServiceToken const &, StreamID stream, EventPrincipal const *)
Definition: Worker.cc:204
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:492
edm::ExceptionToActionTable::find
exception_actions::ActionCodes find(const std::string &category) const
Definition: ExceptionActions.cc:85
edm::Worker::implBeginStream
virtual void implBeginStream(StreamID)=0
edm::syncWait
std::exception_ptr syncWait(F &&iFunc)
Definition: include_first_syncWait.h:17
cms::Exception
Definition: Exception.h:70
edm::Principal::prefetchAsync
void prefetchAsync(WaitingTaskHolder waitTask, ProductResolverIndex index, bool skipCurrentProcess, ServiceToken const &token, ModuleCallingContext const *mcc) const
Definition: Principal.cc:639
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
edm::ServiceRegistry::Operate
Definition: ServiceRegistry.h:40
edm::Worker::beginStream
void beginStream(StreamID id, StreamContext &streamContext)
Definition: Worker.cc:380
edm::WaitingTaskHolder::group
tbb::task_group * group() const noexcept
Definition: WaitingTaskHolder.h:77
edm::Worker::endStream
void endStream(StreamID id, StreamContext &streamContext)
Definition: Worker.cc:404
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
watchdog.group
group
Definition: watchdog.py:82
edm::Transition::NumberOfEventSetupTransitions
edm::ModuleCallingContext::State::kRunning
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316
edm::WaitingTaskWithArenaHolder::doneWaiting
void doneWaiting(std::exception_ptr iExcept)
Definition: WaitingTaskWithArenaHolder.cc:69
edm::Timestamp
Definition: Timestamp.h:30