CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 (WaitingTaskHolder, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, typename T::Context const *)
 
void setPathContext (PathContext const *v)
 
void skipWorker (EventPrincipal const &iPrincipal)
 
void skipWorker (RunPrincipal const &)
 
void skipWorker (LuminosityBlockPrincipal 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

Enumerator
Normal 
Ignore 
Veto 

Definition at line 27 of file WorkerInPath.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file WorkerInPath.cc.

References edm::Worker::addedToPath().

7  : timesVisited_(),
8  timesPassed_(),
9  timesFailed_(),
10  timesExcept_(),
11  filterAction_(theFilterAction),
12  worker_(w),
13  placeInPathContext_(placeInPath),
15  w->addedToPath();
16  }
const double w
Definition: UKUtility.cc:23
FilterAction filterAction_
Definition: WorkerInPath.h:63
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:66
bool runConcurrently() const noexcept
Definition: WorkerInPath.h:53

Member Function Documentation

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

Definition at line 70 of file WorkerInPath.h.

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

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

Definition at line 51 of file WorkerInPath.h.

References filterAction_.

Referenced by checkResultsOfRunWorker().

51 { return filterAction_; }
FilterAction filterAction_
Definition: WorkerInPath.h:63
Worker* edm::WorkerInPath::getWorker ( ) const
inline

Definition at line 52 of file WorkerInPath.h.

References worker_.

52 { return worker_; }
bool edm::WorkerInPath::runConcurrently ( ) const
inlinenoexcept

Definition at line 53 of file WorkerInPath.h.

References runConcurrently_.

53 { return runConcurrently_; }
template<typename T >
void edm::WorkerInPath::runWorkerAsync ( WaitingTaskHolder  iTask,
typename T::TransitionInfoType const &  info,
ServiceToken const &  token,
StreamID  streamID,
typename T::Context const *  context 
)

Definition at line 107 of file WorkerInPath.h.

References visDQMUpload::context, edm::Worker::doWorkAsync(), edm::Worker::doWorkNoPrefetchingAsync(), info(), placeInPathContext_, timesVisited_, unpackBuffers-CaloStage2::token, and worker_.

111  {
112  if constexpr (T::isEvent_) {
113  ++timesVisited_;
114  }
115 
116  if constexpr (T::isEvent_) {
117  ParentContext parentContext(&placeInPathContext_);
118  worker_->doWorkAsync<T>(iTask, info, token, streamID, parentContext, context);
119  } else {
120  ParentContext parentContext(context);
121 
122  // We do not need to run prefetching here because this only handles
123  // stream transitions for runs and lumis. There are no products put
124  // into the runs or lumis in stream transitions, so there can be
125  // no data dependencies which require prefetching. Prefetching is
126  // needed for global transitions, but they are run elsewhere.
127  worker_->doWorkNoPrefetchingAsync<T>(iTask, info, token, streamID, parentContext, context);
128  }
129  }
static const TGPicture * info(bool iBackgroundIsBlack)
void doWorkAsync(WaitingTaskHolder, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *)
Definition: Worker.h:931
void doWorkNoPrefetchingAsync(WaitingTaskHolder, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *)
Definition: Worker.h:1047
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:66
long double T
void edm::WorkerInPath::setPathContext ( PathContext const *  v)
inline

Definition at line 55 of file WorkerInPath.h.

References placeInPathContext_, and edm::PlaceInPathContext::setPathContext().

void setPathContext(PathContext const *v)
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:66
void edm::WorkerInPath::skipWorker ( EventPrincipal const &  iPrincipal)
inline

Definition at line 40 of file WorkerInPath.h.

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

40 { worker_->skipOnPath(iPrincipal); }
void skipOnPath(EventPrincipal const &iEvent)
Definition: Worker.cc:385
void edm::WorkerInPath::skipWorker ( RunPrincipal const &  )
inline

Definition at line 41 of file WorkerInPath.h.

41 {}
void edm::WorkerInPath::skipWorker ( LuminosityBlockPrincipal const &  )
inline

Definition at line 42 of file WorkerInPath.h.

42 {}
int edm::WorkerInPath::timesExcept ( ) const
inline

Definition at line 49 of file WorkerInPath.h.

References timesExcept_.

49 { return timesExcept_; }
int edm::WorkerInPath::timesFailed ( ) const
inline

Definition at line 48 of file WorkerInPath.h.

References timesFailed_.

48 { return timesFailed_; }
int edm::WorkerInPath::timesPassed ( ) const
inline

Definition at line 47 of file WorkerInPath.h.

References timesPassed_.

47 { return timesPassed_; }
int edm::WorkerInPath::timesVisited ( ) const
inline

Definition at line 46 of file WorkerInPath.h.

References timesVisited_.

46 { return timesVisited_; }

Member Data Documentation

FilterAction edm::WorkerInPath::filterAction_
private

Definition at line 63 of file WorkerInPath.h.

Referenced by filterAction().

PlaceInPathContext edm::WorkerInPath::placeInPathContext_
private

Definition at line 66 of file WorkerInPath.h.

Referenced by runWorkerAsync(), and setPathContext().

bool edm::WorkerInPath::runConcurrently_
private

Definition at line 67 of file WorkerInPath.h.

Referenced by runConcurrently().

int edm::WorkerInPath::timesExcept_
private

Definition at line 61 of file WorkerInPath.h.

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

int edm::WorkerInPath::timesFailed_
private

Definition at line 60 of file WorkerInPath.h.

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

int edm::WorkerInPath::timesPassed_
private

Definition at line 59 of file WorkerInPath.h.

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

int edm::WorkerInPath::timesVisited_
private

Definition at line 58 of file WorkerInPath.h.

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

Worker* edm::WorkerInPath::worker_
private

Definition at line 64 of file WorkerInPath.h.

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