CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
edm::WorkerInPath Class Reference

#include <WorkerInPath.h>

Public Types

enum  FilterAction { Normal = 0, Ignore, Veto }
 

Public Member Functions

bool checkResultsOfRunWorker (bool wasEvent)
 
void clearCounters ()
 
FilterAction filterAction () const
 
WorkergetWorker () const
 
bool runConcurrently () const noexcept
 
template<typename T >
void runWorkerAsync (WaitingTask *iTask, typename T::MyPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID streamID, typename T::Context const *context)
 
void setPathContext (PathContext const *v)
 
void skipWorker (EventPrincipal const &iPrincipal)
 
void skipWorker (LuminosityBlockPrincipal const &)
 
void skipWorker (RunPrincipal const &)
 
int timesExcept () const
 
int timesFailed () const
 
int timesPassed () const
 
int timesVisited () const
 
 WorkerInPath (Worker *, FilterAction theAction, unsigned int placeInPath, bool runConcurrently)
 

Private Attributes

FilterAction filterAction_
 
PlaceInPathContext placeInPathContext_
 
bool runConcurrently_
 
int timesExcept_
 
int timesFailed_
 
int timesPassed_
 
int timesVisited_
 
Workerworker_
 

Detailed Description

Definition at line 25 of file WorkerInPath.h.

Member Enumeration Documentation

◆ FilterAction

Enumerator
Normal 
Ignore 
Veto 

Definition at line 27 of file WorkerInPath.h.

27 { Normal = 0, Ignore, Veto };

Constructor & Destructor Documentation

◆ WorkerInPath()

edm::WorkerInPath::WorkerInPath ( Worker w,
FilterAction  theAction,
unsigned int  placeInPath,
bool  runConcurrently 
)

Definition at line 6 of file WorkerInPath.cc.

7  : timesVisited_(),
8  timesPassed_(),
9  timesFailed_(),
10  timesExcept_(),
11  filterAction_(theFilterAction),
12  worker_(w),
13  placeInPathContext_(placeInPath),
15  w->addedToPath();
16  }

References w.

Member Function Documentation

◆ checkResultsOfRunWorker()

bool edm::WorkerInPath::checkResultsOfRunWorker ( bool  wasEvent)
inline

Definition at line 71 of file WorkerInPath.h.

71  {
72  if (not wasEvent) {
73  return true;
74  }
75  auto state = worker_->state();
76  bool rc = true;
77  switch (state) {
78  case Worker::Fail: {
79  rc = false;
80  break;
81  }
82  case Worker::Pass:
83  break;
84  case Worker::Exception: {
85  ++timesExcept_;
86  return true;
87  }
88 
89  default:
90  assert(false);
91  }
92 
93  if (Ignore == filterAction()) {
94  rc = true;
95  } else if (Veto == filterAction()) {
96  rc = !rc;
97  }
98 
99  if (rc) {
100  ++timesPassed_;
101  } else {
102  ++timesFailed_;
103  }
104  return rc;
105  }

References cms::cuda::assert(), edm::Worker::Exception, edm::Worker::Fail, filterAction(), Ignore, edm::Worker::Pass, edm::Worker::state(), timesExcept_, timesFailed_, timesPassed_, Veto, and worker_.

◆ clearCounters()

void edm::WorkerInPath::clearCounters ( )
inline

◆ filterAction()

FilterAction edm::WorkerInPath::filterAction ( ) const
inline

Definition at line 52 of file WorkerInPath.h.

52 { return filterAction_; }

References filterAction_.

Referenced by checkResultsOfRunWorker().

◆ getWorker()

Worker* edm::WorkerInPath::getWorker ( ) const
inline

Definition at line 53 of file WorkerInPath.h.

53 { return worker_; }

References worker_.

◆ runConcurrently()

bool edm::WorkerInPath::runConcurrently ( ) const
inlinenoexcept

Definition at line 54 of file WorkerInPath.h.

54 { return runConcurrently_; }

References runConcurrently_.

◆ runWorkerAsync()

template<typename T >
void edm::WorkerInPath::runWorkerAsync ( WaitingTask iTask,
typename T::MyPrincipal const &  ep,
EventSetupImpl const &  es,
ServiceToken const &  token,
StreamID  streamID,
typename T::Context const *  context 
)

Definition at line 108 of file WorkerInPath.h.

113  {
114  if constexpr (T::isEvent_) {
115  ++timesVisited_;
116  }
117 
118  if constexpr (T::isEvent_) {
119  ParentContext parentContext(&placeInPathContext_);
120  worker_->doWorkAsync<T>(iTask, ep, es, token, streamID, parentContext, context);
121  } else {
122  ParentContext parentContext(context);
123 
124  // We do not need to run prefetching here because this only handles
125  // stream transitions for runs and lumis. There are no products put
126  // into the runs or lumis in stream transitions, so there can be
127  // no data dependencies which require prefetching. Prefetching is
128  // needed for global transitions, but they are run elsewhere.
129  worker_->doWorkNoPrefetchingAsync<T>(iTask, ep, es, token, streamID, parentContext, context);
130  }
131  }

References edm::Worker::doWorkAsync(), edm::Worker::doWorkNoPrefetchingAsync(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, placeInPathContext_, timesVisited_, unpackBuffers-CaloStage2::token, and worker_.

◆ setPathContext()

void edm::WorkerInPath::setPathContext ( PathContext const *  v)
inline

◆ skipWorker() [1/3]

void edm::WorkerInPath::skipWorker ( EventPrincipal const &  iPrincipal)
inline

Definition at line 41 of file WorkerInPath.h.

41 { worker_->skipOnPath(iPrincipal); }

References edm::Worker::skipOnPath(), and worker_.

◆ skipWorker() [2/3]

void edm::WorkerInPath::skipWorker ( LuminosityBlockPrincipal const &  )
inline

Definition at line 43 of file WorkerInPath.h.

43 {}

◆ skipWorker() [3/3]

void edm::WorkerInPath::skipWorker ( RunPrincipal const &  )
inline

Definition at line 42 of file WorkerInPath.h.

42 {}

◆ timesExcept()

int edm::WorkerInPath::timesExcept ( ) const
inline

Definition at line 50 of file WorkerInPath.h.

50 { return timesExcept_; }

References timesExcept_.

◆ timesFailed()

int edm::WorkerInPath::timesFailed ( ) const
inline

Definition at line 49 of file WorkerInPath.h.

49 { return timesFailed_; }

References timesFailed_.

◆ timesPassed()

int edm::WorkerInPath::timesPassed ( ) const
inline

Definition at line 48 of file WorkerInPath.h.

48 { return timesPassed_; }

References timesPassed_.

◆ timesVisited()

int edm::WorkerInPath::timesVisited ( ) const
inline

Definition at line 47 of file WorkerInPath.h.

47 { return timesVisited_; }

References timesVisited_.

Member Data Documentation

◆ filterAction_

FilterAction edm::WorkerInPath::filterAction_
private

Definition at line 64 of file WorkerInPath.h.

Referenced by filterAction().

◆ placeInPathContext_

PlaceInPathContext edm::WorkerInPath::placeInPathContext_
private

Definition at line 67 of file WorkerInPath.h.

Referenced by runWorkerAsync(), and setPathContext().

◆ runConcurrently_

bool edm::WorkerInPath::runConcurrently_
private

Definition at line 68 of file WorkerInPath.h.

Referenced by runConcurrently().

◆ timesExcept_

int edm::WorkerInPath::timesExcept_
private

Definition at line 62 of file WorkerInPath.h.

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

◆ timesFailed_

int edm::WorkerInPath::timesFailed_
private

Definition at line 61 of file WorkerInPath.h.

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

◆ timesPassed_

int edm::WorkerInPath::timesPassed_
private

Definition at line 60 of file WorkerInPath.h.

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

◆ timesVisited_

int edm::WorkerInPath::timesVisited_
private

Definition at line 59 of file WorkerInPath.h.

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

◆ worker_

Worker* edm::WorkerInPath::worker_
private

Definition at line 65 of file WorkerInPath.h.

Referenced by checkResultsOfRunWorker(), getWorker(), runWorkerAsync(), and skipWorker().

edm::WorkerInPath::timesExcept_
int timesExcept_
Definition: WorkerInPath.h:62
edm::Worker::Fail
Definition: Worker.h:85
edm::Worker::Exception
Definition: Worker.h:85
edm::WorkerInPath::filterAction_
FilterAction filterAction_
Definition: WorkerInPath.h:64
cms::cuda::assert
assert(be >=bs)
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::WorkerInPath::runConcurrently
bool runConcurrently() const noexcept
Definition: WorkerInPath.h:54
edm::WorkerInPath::runConcurrently_
bool runConcurrently_
Definition: WorkerInPath.h:68
edm::WorkerInPath::timesPassed_
int timesPassed_
Definition: WorkerInPath.h:60
edm::WorkerInPath::placeInPathContext_
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:67
w
const double w
Definition: UKUtility.cc:23
edm::WorkerInPath::Ignore
Definition: WorkerInPath.h:27
edm::Worker::Pass
Definition: Worker.h:85
edm::WorkerInPath::Normal
Definition: WorkerInPath.h:27
edm::PlaceInPathContext::setPathContext
void setPathContext(PathContext const *v)
Definition: PlaceInPathContext.h:26
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::WorkerInPath::filterAction
FilterAction filterAction() const
Definition: WorkerInPath.h:52
edm::Worker::state
State state() const
Definition: Worker.h:232
edm::WorkerInPath::worker_
Worker * worker_
Definition: WorkerInPath.h:65
T
long double T
Definition: Basic3DVectorLD.h:48
edm::Worker::skipOnPath
void skipOnPath(EventPrincipal const &iEvent)
Definition: Worker.cc:363
edm::WorkerInPath::Veto
Definition: WorkerInPath.h:27
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::WorkerInPath::timesFailed_
int timesFailed_
Definition: WorkerInPath.h:61
edm::WorkerInPath::timesVisited_
int timesVisited_
Definition: WorkerInPath.h:59
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316