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

unsigned int bitPosition () const noexcept
 
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 *) noexcept
 
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 27 of file WorkerInPath.h.

Member Enumeration Documentation

◆ FilterAction

Enumerator
Normal 
Ignore 
Veto 

Definition at line 29 of file WorkerInPath.h.

Constructor & Destructor Documentation

◆ WorkerInPath()

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

Definition at line 6 of file WorkerInPath.cc.

References w().

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

Member Function Documentation

◆ bitPosition()

unsigned int edm::WorkerInPath::bitPosition ( ) const
inlinenoexcept

Definition at line 56 of file WorkerInPath.h.

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

56 { return placeInPathContext_.placeInPath(); }
unsigned int placeInPath() const
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:69

◆ checkResultsOfRunWorker()

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

Definition at line 73 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_.

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

◆ clearCounters()

void edm::WorkerInPath::clearCounters ( )
inline

◆ filterAction()

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

Definition at line 53 of file WorkerInPath.h.

References filterAction_.

Referenced by checkResultsOfRunWorker().

53 { return filterAction_; }
FilterAction filterAction_
Definition: WorkerInPath.h:66

◆ getWorker()

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

Definition at line 54 of file WorkerInPath.h.

References worker_.

54 { return worker_; }

◆ runConcurrently()

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

Definition at line 55 of file WorkerInPath.h.

References runConcurrently_.

55 { return runConcurrently_; }

◆ runWorkerAsync()

template<typename T >
void edm::WorkerInPath::runWorkerAsync ( WaitingTaskHolder  iTask,
typename T::TransitionInfoType const &  info,
ServiceToken const &  token,
StreamID  streamID,
typename T::Context const *  context 
)
noexcept

Definition at line 110 of file WorkerInPath.h.

References visDQMUpload::context, info(), eostools::move(), and unpackBuffers-CaloStage2::token.

114  {
115  static_assert(T::isEvent_);
116 
117  ++timesVisited_;
118  ParentContext parentContext(&placeInPathContext_);
119  worker_->doWorkAsync<T>(std::move(iTask), info, token, streamID, parentContext, context);
120  }
static const TGPicture * info(bool iBackgroundIsBlack)
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:69
void doWorkAsync(WaitingTaskHolder, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *) noexcept
Definition: Worker.h:1078
long double T
def move(src, dest)
Definition: eostools.py:511

◆ setPathContext()

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

◆ skipWorker() [1/3]

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

Definition at line 42 of file WorkerInPath.h.

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

42 { worker_->skipOnPath(iPrincipal); }
void skipOnPath(EventPrincipal const &iEvent)
Definition: Worker.cc:381

◆ skipWorker() [2/3]

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

Definition at line 43 of file WorkerInPath.h.

43 {}

◆ skipWorker() [3/3]

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

Definition at line 44 of file WorkerInPath.h.

44 {}

◆ timesExcept()

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

Definition at line 51 of file WorkerInPath.h.

References timesExcept_.

51 { return timesExcept_; }

◆ timesFailed()

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

Definition at line 50 of file WorkerInPath.h.

References timesFailed_.

50 { return timesFailed_; }

◆ timesPassed()

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

Definition at line 49 of file WorkerInPath.h.

References timesPassed_.

49 { return timesPassed_; }

◆ timesVisited()

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

Definition at line 48 of file WorkerInPath.h.

References timesVisited_.

48 { return timesVisited_; }

Member Data Documentation

◆ filterAction_

FilterAction edm::WorkerInPath::filterAction_
private

Definition at line 66 of file WorkerInPath.h.

Referenced by filterAction().

◆ placeInPathContext_

PlaceInPathContext edm::WorkerInPath::placeInPathContext_
private

Definition at line 69 of file WorkerInPath.h.

Referenced by bitPosition(), and setPathContext().

◆ runConcurrently_

bool edm::WorkerInPath::runConcurrently_
private

Definition at line 70 of file WorkerInPath.h.

Referenced by runConcurrently().

◆ timesExcept_

int edm::WorkerInPath::timesExcept_
private

Definition at line 64 of file WorkerInPath.h.

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

◆ timesFailed_

int edm::WorkerInPath::timesFailed_
private

Definition at line 63 of file WorkerInPath.h.

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

◆ timesPassed_

int edm::WorkerInPath::timesPassed_
private

Definition at line 62 of file WorkerInPath.h.

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

◆ timesVisited_

int edm::WorkerInPath::timesVisited_
private

Definition at line 61 of file WorkerInPath.h.

Referenced by clearCounters(), and timesVisited().

◆ worker_

Worker* edm::WorkerInPath::worker_
private

Definition at line 67 of file WorkerInPath.h.

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