CMS 3D CMS Logo

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

#include <Path.h>

Public Types

typedef WorkersInPath::size_type size_type
 
typedef hlt::HLTState State
 
typedef std::shared_ptr< HLTGlobalStatusTrigResPtr
 
typedef std::vector< WorkerInPathWorkersInPath
 

Public Member Functions

int bitPosition () const
 
void clearCounters ()
 
Worker const * getWorker (size_type i) const
 
std::string const & name () const
 
 Path (int bitpos, std::string const &path_name, WorkersInPath const &workers, TrigResPtr trptr, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > reg, StreamContext const *streamContext, std::atomic< bool > *stopProcessEvent, PathContext::PathType pathType)
 
 Path (Path const &)
 
void processOneOccurrenceAsync (WaitingTask *, EventPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID const &, StreamContext const *)
 
template<typename T >
void runAllModulesAsync (WaitingTask *, typename T::MyPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID const &, typename T::Context const *)
 
void setEarlyDeleteHelpers (std::map< const Worker *, EarlyDeleteHelper * > const &)
 
void setPathStatusInserter (PathStatusInserter *pathStatusInserter, Worker *pathStatusInserterWorker)
 
size_type size () const
 
State state () const
 
int timesExcept () const
 
int timesExcept (size_type i) const
 
int timesFailed () const
 
int timesFailed (size_type i) const
 
int timesPassed () const
 
int timesPassed (size_type i) const
 
int timesRun () const
 
int timesVisited (size_type i) const
 

Private Member Functions

void finished (int iModuleIndex, bool iSucceeded, std::exception_ptr, StreamContext const *, EventPrincipal const &iEP, EventSetupImpl const &iES, StreamID const &streamID)
 
void handleEarlyFinish (EventPrincipal const &)
 
void handleEarlyFinish (RunPrincipal const &)
 
void handleEarlyFinish (LuminosityBlockPrincipal const &)
 
bool handleWorkerFailure (cms::Exception &e, int nwrwue, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id)
 
Path const & operator= (Path const &)=delete
 
void recordStatus (int nwrwue, bool isEvent)
 
void runNextWorkerAsync (unsigned int iNextModuleIndex, EventPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID const &, StreamContext const *)
 
void updateCounters (bool succeed, bool isEvent)
 
void workerFinished (std::exception_ptr const *iException, unsigned int iModuleIndex, EventPrincipal const &iEP, EventSetupImpl const &iES, ServiceToken const &iToken, StreamID const &iID, StreamContext const *iContext)
 

Static Private Member Functions

static void exceptionContext (cms::Exception &ex, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id, PathContext const &)
 

Private Attributes

ExceptionToActionTable const * act_table_
 
std::shared_ptr< ActivityRegistryactReg_
 
int bitpos_
 
std::vector< EarlyDeleteHelper * > earlyDeleteHelpers_
 
PathContext pathContext_
 
PathStatusInserterpathStatusInserter_
 
WorkerpathStatusInserterWorker_
 
State state_
 
std::atomic< bool > * stopProcessingEvent_
 
int timesExcept_
 
int timesFailed_
 
int timesPassed_
 
int timesRun_
 
TrigResPtr trptr_
 
WaitingTaskList waitingTasks_
 
WorkersInPath workers_
 

Detailed Description

Definition at line 44 of file Path.h.

Member Typedef Documentation

typedef WorkersInPath::size_type edm::Path::size_type

Definition at line 49 of file Path.h.

Definition at line 46 of file Path.h.

typedef std::shared_ptr<HLTGlobalStatus> edm::Path::TrigResPtr

Definition at line 50 of file Path.h.

typedef std::vector<WorkerInPath> edm::Path::WorkersInPath

Definition at line 48 of file Path.h.

Constructor & Destructor Documentation

edm::Path::Path ( int  bitpos,
std::string const &  path_name,
WorkersInPath const &  workers,
TrigResPtr  trptr,
ExceptionToActionTable const &  actions,
std::shared_ptr< ActivityRegistry reg,
StreamContext const *  streamContext,
std::atomic< bool > *  stopProcessEvent,
PathContext::PathType  pathType 
)

Definition at line 15 of file Path.cc.

References pathContext_, and workers_.

24  : timesRun_(),
25  timesPassed_(),
26  timesFailed_(),
27  timesExcept_(),
29  bitpos_(bitpos),
30  trptr_(trptr),
31  actReg_(areg),
34  pathContext_(path_name, streamContext, bitpos, pathType),
35  stopProcessingEvent_(stopProcessingEvent),
36  pathStatusInserter_(nullptr),
37  pathStatusInserterWorker_(nullptr) {
38  for (auto& workerInPath : workers_) {
39  workerInPath.setPathContext(&pathContext_);
40  }
41  }
not [yet] run
Definition: HLTenums.h:18
roAction_t actions[nactions]
Definition: GenABIO.cc:181
int timesFailed_
Definition: Path.h:109
int timesExcept_
Definition: Path.h:110
PathContext pathContext_
Definition: Path.h:122
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:116
TrigResPtr trptr_
Definition: Path.h:115
int bitpos_
Definition: Path.h:114
WorkersInPath workers_
Definition: Path.h:119
ExceptionToActionTable const * act_table_
Definition: Path.h:117
State state_
Definition: Path.h:112
int timesPassed_
Definition: Path.h:108
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:124
int timesRun_
Definition: Path.h:107
Worker * pathStatusInserterWorker_
Definition: Path.h:127
PathStatusInserter * pathStatusInserter_
Definition: Path.h:126
edm::Path::Path ( Path const &  r)

Definition at line 43 of file Path.cc.

References pathContext_, and workers_.

44  : timesRun_(r.timesRun_),
45  timesPassed_(r.timesPassed_),
46  timesFailed_(r.timesFailed_),
47  timesExcept_(r.timesExcept_),
48  state_(r.state_),
49  bitpos_(r.bitpos_),
50  trptr_(r.trptr_),
51  actReg_(r.actReg_),
52  act_table_(r.act_table_),
53  workers_(r.workers_),
54  earlyDeleteHelpers_(r.earlyDeleteHelpers_),
55  pathContext_(r.pathContext_),
56  stopProcessingEvent_(r.stopProcessingEvent_),
57  pathStatusInserter_(r.pathStatusInserter_),
58  pathStatusInserterWorker_(r.pathStatusInserterWorker_) {
59  for (auto& workerInPath : workers_) {
60  workerInPath.setPathContext(&pathContext_);
61  }
62  }
std::vector< EarlyDeleteHelper * > earlyDeleteHelpers_
Definition: Path.h:120
int timesFailed_
Definition: Path.h:109
int timesExcept_
Definition: Path.h:110
PathContext pathContext_
Definition: Path.h:122
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:116
TrigResPtr trptr_
Definition: Path.h:115
int bitpos_
Definition: Path.h:114
WorkersInPath workers_
Definition: Path.h:119
ExceptionToActionTable const * act_table_
Definition: Path.h:117
State state_
Definition: Path.h:112
int timesPassed_
Definition: Path.h:108
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:124
int timesRun_
Definition: Path.h:107
Worker * pathStatusInserterWorker_
Definition: Path.h:127
PathStatusInserter * pathStatusInserter_
Definition: Path.h:126

Member Function Documentation

int edm::Path::bitPosition ( ) const
inline

Definition at line 79 of file Path.h.

References bitpos_.

Referenced by edm::fillPathSummary().

79 { return bitpos_; }
int bitpos_
Definition: Path.h:114
void edm::Path::clearCounters ( )

Definition at line 164 of file Path.cc.

References edm::WorkerInPath::clearCounters(), edm::for_all(), timesExcept_, timesFailed_, timesPassed_, timesRun_, and workers_.

Referenced by edm::StreamSchedule::clearCounters(), and name().

164  {
165  using std::placeholders::_1;
167  for_all(workers_, std::bind(&WorkerInPath::clearCounters, _1));
168  }
int timesFailed_
Definition: Path.h:109
int timesExcept_
Definition: Path.h:110
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
WorkersInPath workers_
Definition: Path.h:119
int timesPassed_
Definition: Path.h:108
int timesRun_
Definition: Path.h:107
void edm::Path::exceptionContext ( cms::Exception ex,
bool  isEvent,
bool  begin,
BranchType  branchType,
ModuleDescription const &  desc,
std::string const &  id,
PathContext const &  pathContext 
)
staticprivate

Definition at line 116 of file Path.cc.

References cms::Exception::addContext(), triggerObjects_cff::id, edm::InLumi, edm::InRun, and edm::PathContext::pathName().

Referenced by handleWorkerFailure().

122  {
123  std::ostringstream ost;
124  ost << "Running path '" << pathContext.pathName() << "'";
125  ex.addContext(ost.str());
126  ost.str("");
127  ost << "Processing ";
128  //For the event case, the Worker has already
129  // added the necessary module context to the exception
130  if (begin && branchType == InRun) {
131  ost << "stream begin Run";
132  } else if (begin && branchType == InLumi) {
133  ost << "stream begin LuminosityBlock ";
134  } else if (!begin && branchType == InLumi) {
135  ost << "stream end LuminosityBlock ";
136  } else if (!begin && branchType == InRun) {
137  ost << "stream end Run ";
138  } else if (isEvent) {
139  // It should be impossible to get here ...
140  ost << "Event ";
141  }
142  ost << id;
143  ex.addContext(ost.str());
144  }
void addContext(std::string const &context)
Definition: Exception.cc:165
#define begin
Definition: vmac.h:32
def branchType(schema, name)
Definition: revisionDML.py:114
void edm::Path::finished ( int  iModuleIndex,
bool  iSucceeded,
std::exception_ptr  iException,
StreamContext const *  iContext,
EventPrincipal const &  iEP,
EventSetupImpl const &  iES,
StreamID const &  streamID 
)
private

Definition at line 284 of file Path.cc.

References actReg_, edm::WaitingTaskList::doneWaiting(), pathContext_, pathStatusInserter_, pathStatusInserterWorker_, recordStatus(), edm::Worker::runModuleDirectly(), edm::PathStatusInserter::setPathStatus(), state_, mps_update::status, updateCounters(), and waitingTasks_.

Referenced by processOneOccurrenceAsync(), and workerFinished().

290  {
291  if (not iException) {
292  updateCounters(iSucceeded, true);
293  recordStatus(iModuleIndex, true);
294  }
295  try {
296  HLTPathStatus status(state_, iModuleIndex);
297 
298  if (pathStatusInserter_) { // pathStatusInserter is null for EndPaths
300  }
301  std::exception_ptr jException =
302  pathStatusInserterWorker_->runModuleDirectly<OccurrenceTraits<EventPrincipal, BranchActionStreamBegin>>(
303  iEP, iES, streamID, ParentContext(iContext), iContext);
304  if (jException && not iException) {
305  iException = jException;
306  }
307  actReg_->postPathEventSignal_(*iContext, pathContext_, status);
308  } catch (...) {
309  if (not iException) {
310  iException = std::current_exception();
311  }
312  }
313  waitingTasks_.doneWaiting(iException);
314  }
void recordStatus(int nwrwue, bool isEvent)
Definition: Path.cc:146
std::exception_ptr runModuleDirectly(typename T::MyPrincipal const &ep, EventSetupImpl const &es, StreamID streamID, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:1126
void setPathStatus(StreamID const &, HLTPathStatus const &)
PathContext pathContext_
Definition: Path.h:122
WaitingTaskList waitingTasks_
Definition: Path.h:123
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:116
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
void updateCounters(bool succeed, bool isEvent)
Definition: Path.cc:152
State state_
Definition: Path.h:112
Worker * pathStatusInserterWorker_
Definition: Path.h:127
PathStatusInserter * pathStatusInserter_
Definition: Path.h:126
Worker const* edm::Path::getWorker ( size_type  i) const
inline

Definition at line 96 of file Path.h.

References operator=(), setEarlyDeleteHelpers(), setPathStatusInserter(), and workers_.

Referenced by edm::fillModuleInPathSummary(), and setEarlyDeleteHelpers().

96 { return workers_.at(i).getWorker(); }
WorkersInPath workers_
Definition: Path.h:119
void edm::Path::handleEarlyFinish ( EventPrincipal const &  iEvent)
private

Definition at line 191 of file Path.cc.

References earlyDeleteHelpers_.

Referenced by workerFinished().

191  {
192  for (auto helper : earlyDeleteHelpers_) {
193  helper->pathFinished(iEvent);
194  }
195  }
Definition: helper.py:1
std::vector< EarlyDeleteHelper * > earlyDeleteHelpers_
Definition: Path.h:120
int iEvent
Definition: GenABIO.cc:224
void edm::Path::handleEarlyFinish ( RunPrincipal const &  )
inlineprivate

Definition at line 157 of file Path.h.

157 {}
void edm::Path::handleEarlyFinish ( LuminosityBlockPrincipal const &  )
inlineprivate

Definition at line 158 of file Path.h.

References a, pathContext_, runNextWorkerAsync(), state(), state_, mps_update::status, and workerFinished().

158 {}
bool edm::Path::handleWorkerFailure ( cms::Exception e,
int  nwrwue,
bool  isEvent,
bool  begin,
BranchType  branchType,
ModuleDescription const &  desc,
std::string const &  id 
)
private

Definition at line 64 of file Path.cc.

References act_table_, writedatasetfile::action, cms::Exception::addAdditionalInfo(), cms::Exception::category(), edm::Exception::codeToString(), cms::Exception::context(), edm::hlt::Exception, exceptionContext(), edm::exception_actions::FailPath, edm::ExceptionToActionTable::find(), pathContext_, edm::printCmsExceptionWarning(), edm::errors::ProductNotFound, cms::Exception::raise(), recordStatus(), edm::exception_actions::Rethrow, edm::exception_actions::SkipEvent, state_, stopProcessingEvent_, AlCaHLTBitMon_QueryRunRegistry::string, and timesExcept_.

Referenced by workerFinished().

70  {
71  if (e.context().empty()) {
72  exceptionContext(e, isEvent, begin, branchType, desc, id, pathContext_);
73  }
74  bool should_continue = true;
75 
76  // there is no support as of yet for specific paths having
77  // different exception behavior
78 
79  // If not processing an event, always rethrow.
81  switch (action) {
83  should_continue = false;
84  edm::printCmsExceptionWarning("FailPath", e);
85  break;
86  }
88  //Need the other Paths to stop as soon as possible
90  *stopProcessingEvent_ = true;
91  }
92  }
93  default: {
94  if (isEvent)
95  ++timesExcept_;
97  recordStatus(nwrwue, isEvent);
98  if (action == exception_actions::Rethrow) {
100  if (e.category() == pNF) {
101  std::ostringstream ost;
102  ost << "If you wish to continue processing events after a " << pNF << " exception,\n"
103  << "add \"SkipEvent = cms.untracked.vstring('ProductNotFound')\" to the \"options\" PSet in the "
104  "configuration.\n";
105  e.addAdditionalInfo(ost.str());
106  }
107  }
108  //throw will copy which will slice the object
109  e.raise();
110  }
111  }
112 
113  return should_continue;
114  }
void recordStatus(int nwrwue, bool isEvent)
Definition: Path.cc:146
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:51
void raise()
Definition: Exception.h:98
std::string const & category() const
Definition: Exception.cc:143
exception_actions::ActionCodes find(const std::string &category) const
int timesExcept_
Definition: Path.h:110
PathContext pathContext_
Definition: Path.h:122
std::list< std::string > const & context() const
Definition: Exception.cc:147
void addAdditionalInfo(std::string const &info)
Definition: Exception.cc:169
static void exceptionContext(cms::Exception &ex, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id, PathContext const &)
Definition: Path.cc:116
ExceptionToActionTable const * act_table_
Definition: Path.h:117
State state_
Definition: Path.h:112
#define begin
Definition: vmac.h:32
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:124
def branchType(schema, name)
Definition: revisionDML.py:114
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
std::string const& edm::Path::name ( void  ) const
inline
Path const& edm::Path::operator= ( Path const &  )
privatedelete

Referenced by getWorker().

void edm::Path::processOneOccurrenceAsync ( WaitingTask iTask,
EventPrincipal const &  iEP,
EventSetupImpl const &  iES,
ServiceToken const &  iToken,
StreamID const &  iStreamID,
StreamContext const *  iStreamContext 
)

Definition at line 197 of file Path.cc.

References actReg_, edm::WaitingTaskList::add(), finished(), pathContext_, edm::hlt::Ready, edm::WaitingTaskList::reset(), runNextWorkerAsync(), state_, timesRun_, waitingTasks_, and workers_.

202  {
204  ++timesRun_;
205  waitingTasks_.add(iTask);
206  if (actReg_) {
207  ServiceRegistry::Operate guard(iToken);
208  actReg_->prePathEventSignal_(*iStreamContext, pathContext_);
209  }
210  state_ = hlt::Ready;
211 
212  if (workers_.empty()) {
213  ServiceRegistry::Operate guard(iToken);
214  finished(-1, true, std::exception_ptr(), iStreamContext, iEP, iES, iStreamID);
215  return;
216  }
217 
218  runNextWorkerAsync(0, iEP, iES, iToken, iStreamID, iStreamContext);
219  }
not [yet] run
Definition: HLTenums.h:18
void add(WaitingTask *)
Adds task to the waiting list.
PathContext pathContext_
Definition: Path.h:122
WaitingTaskList waitingTasks_
Definition: Path.h:123
void reset()
Resets access to the resource so that added tasks will wait.
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:116
WorkersInPath workers_
Definition: Path.h:119
State state_
Definition: Path.h:112
void finished(int iModuleIndex, bool iSucceeded, std::exception_ptr, StreamContext const *, EventPrincipal const &iEP, EventSetupImpl const &iES, StreamID const &streamID)
Definition: Path.cc:284
void runNextWorkerAsync(unsigned int iNextModuleIndex, EventPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID const &, StreamContext const *)
Definition: Path.cc:316
int timesRun_
Definition: Path.h:107
void edm::Path::recordStatus ( int  nwrwue,
bool  isEvent 
)
private

Definition at line 146 of file Path.cc.

References bitpos_, state_, and trptr_.

Referenced by finished(), and handleWorkerFailure().

146  {
147  if (isEvent && trptr_) {
148  (*trptr_)[bitpos_] = HLTPathStatus(state_, nwrwue);
149  }
150  }
TrigResPtr trptr_
Definition: Path.h:115
int bitpos_
Definition: Path.h:114
State state_
Definition: Path.h:112
template<typename T >
void edm::Path::runAllModulesAsync ( WaitingTask task,
typename T::MyPrincipal const &  p,
EventSetupImpl const &  es,
ServiceToken const &  token,
StreamID const &  streamID,
typename T::Context const *  context 
)

Definition at line 203 of file Path.h.

References AlCaHLTBitMon_ParallelJobs::p, TrackValidation_cff::task, and workers_.

208  {
209  for (auto& worker : workers_) {
210  worker.runWorkerAsync<T>(task, p, es, token, streamID, context);
211  }
212  }
WorkersInPath workers_
Definition: Path.h:119
long double T
void edm::Path::runNextWorkerAsync ( unsigned int  iNextModuleIndex,
EventPrincipal const &  iEP,
EventSetupImpl const &  iES,
ServiceToken const &  iToken,
StreamID const &  iID,
StreamContext const *  iContext 
)
private

Definition at line 316 of file Path.cc.

References edm::make_waiting_task(), workerFinished(), and workers_.

Referenced by handleEarlyFinish(), processOneOccurrenceAsync(), and workerFinished().

321  {
322  auto nextTask = make_waiting_task(
323  tbb::task::allocate_root(),
324  [this, iNextModuleIndex, &iEP, &iES, iID, iContext, token = iToken](std::exception_ptr const* iException) {
325  this->workerFinished(iException, iNextModuleIndex, iEP, iES, token, iID, iContext);
326  });
327 
328  workers_[iNextModuleIndex].runWorkerAsync<OccurrenceTraits<EventPrincipal, BranchActionStreamBegin>>(
329  nextTask, iEP, iES, iToken, iID, iContext);
330  }
WorkersInPath workers_
Definition: Path.h:119
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:87
void workerFinished(std::exception_ptr const *iException, unsigned int iModuleIndex, EventPrincipal const &iEP, EventSetupImpl const &iES, ServiceToken const &iToken, StreamID const &iID, StreamContext const *iContext)
Definition: Path.cc:221
void edm::Path::setEarlyDeleteHelpers ( std::map< const Worker *, EarlyDeleteHelper * > const &  iWorkerToDeleter)

Definition at line 170 of file Path.cc.

References earlyDeleteHelpers_, runEdmFileComparison::found, getWorker(), size(), and groupFilesInBlocks::temp.

Referenced by getWorker().

170  {
171  //we use a temp so we can overset the size but then when moving to earlyDeleteHelpers we only
172  // have to use the space necessary
173  std::vector<EarlyDeleteHelper*> temp;
174  temp.reserve(iWorkerToDeleter.size());
175  for (unsigned int index = 0; index != size(); ++index) {
176  auto found = iWorkerToDeleter.find(getWorker(index));
177  if (found != iWorkerToDeleter.end()) {
178  temp.push_back(found->second);
179  found->second->addedToPath();
180  }
181  }
182  std::vector<EarlyDeleteHelper*> tempCorrectSize(temp.begin(), temp.end());
183  earlyDeleteHelpers_.swap(tempCorrectSize);
184  }
std::vector< EarlyDeleteHelper * > earlyDeleteHelpers_
Definition: Path.h:120
size_type size() const
Definition: Path.h:91
Worker const * getWorker(size_type i) const
Definition: Path.h:96
void edm::Path::setPathStatusInserter ( PathStatusInserter pathStatusInserter,
Worker pathStatusInserterWorker 
)

Definition at line 186 of file Path.cc.

References pathStatusInserter_, and pathStatusInserterWorker_.

Referenced by getWorker().

186  {
187  pathStatusInserter_ = pathStatusInserter;
188  pathStatusInserterWorker_ = pathStatusInserterWorker;
189  }
Worker * pathStatusInserterWorker_
Definition: Path.h:127
PathStatusInserter * pathStatusInserter_
Definition: Path.h:126
size_type edm::Path::size ( void  ) const
inline

Definition at line 91 of file Path.h.

References workers_.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), edm::fillPathSummary(), and setEarlyDeleteHelpers().

91 { return workers_.size(); }
WorkersInPath workers_
Definition: Path.h:119
State edm::Path::state ( ) const
inline

Definition at line 89 of file Path.h.

References state_.

Referenced by handleEarlyFinish().

89 { return state_; }
State state_
Definition: Path.h:112
int edm::Path::timesExcept ( ) const
inline

Definition at line 87 of file Path.h.

References timesExcept_.

Referenced by edm::fillModuleInPathSummary(), and edm::fillPathSummary().

87 { return timesExcept_; }
int timesExcept_
Definition: Path.h:110
int edm::Path::timesExcept ( size_type  i) const
inline

Definition at line 95 of file Path.h.

References workers_.

95 { return workers_.at(i).timesExcept(); }
WorkersInPath workers_
Definition: Path.h:119
int edm::Path::timesFailed ( ) const
inline

Definition at line 86 of file Path.h.

References timesFailed_.

Referenced by edm::fillModuleInPathSummary(), and edm::fillPathSummary().

86 { return timesFailed_; }
int timesFailed_
Definition: Path.h:109
int edm::Path::timesFailed ( size_type  i) const
inline

Definition at line 94 of file Path.h.

References workers_.

94 { return workers_.at(i).timesFailed(); }
WorkersInPath workers_
Definition: Path.h:119
int edm::Path::timesPassed ( ) const
inline

Definition at line 85 of file Path.h.

References timesPassed_.

Referenced by edm::fillModuleInPathSummary(), and edm::fillPathSummary().

85 { return timesPassed_; }
int timesPassed_
Definition: Path.h:108
int edm::Path::timesPassed ( size_type  i) const
inline

Definition at line 93 of file Path.h.

References workers_.

93 { return workers_.at(i).timesPassed(); }
WorkersInPath workers_
Definition: Path.h:119
int edm::Path::timesRun ( ) const
inline

Definition at line 84 of file Path.h.

References timesRun_.

Referenced by edm::fillPathSummary().

84 { return timesRun_; }
int timesRun_
Definition: Path.h:107
int edm::Path::timesVisited ( size_type  i) const
inline

Definition at line 92 of file Path.h.

References workers_.

Referenced by edm::fillModuleInPathSummary().

92 { return workers_.at(i).timesVisited(); }
WorkersInPath workers_
Definition: Path.h:119
void edm::Path::updateCounters ( bool  succeed,
bool  isEvent 
)
private

Definition at line 152 of file Path.cc.

References edm::hlt::Fail, edm::hlt::Pass, state_, timesFailed_, and timesPassed_.

Referenced by finished().

152  {
153  if (success) {
154  if (isEvent)
155  ++timesPassed_;
156  state_ = hlt::Pass;
157  } else {
158  if (isEvent)
159  ++timesFailed_;
160  state_ = hlt::Fail;
161  }
162  }
int timesFailed_
Definition: Path.h:109
reject
Definition: HLTenums.h:20
accept
Definition: HLTenums.h:19
State state_
Definition: Path.h:112
int timesPassed_
Definition: Path.h:108
void edm::Path::workerFinished ( std::exception_ptr const *  iException,
unsigned int  iModuleIndex,
EventPrincipal const &  iEP,
EventSetupImpl const &  iES,
ServiceToken const &  iToken,
StreamID const &  iID,
StreamContext const *  iContext 
)
private

Definition at line 221 of file Path.cc.

References cms::Exception::clone(), finished(), handleEarlyFinish(), handleWorkerFailure(), edm::EventPrincipal::id(), edm::InEvent, edm::WaitingTaskList::presetTaskAsFailed(), runNextWorkerAsync(), stopProcessingEvent_, waitingTasks_, and workers_.

Referenced by handleEarlyFinish(), and runNextWorkerAsync().

227  {
228  ServiceRegistry::Operate guard(iToken);
229 
230  //This call also allows the WorkerInPath to update statistics
231  // so should be done even if an exception happened
232  auto& worker = workers_[iModuleIndex];
233  bool shouldContinue = worker.checkResultsOfRunWorker(true);
234  std::exception_ptr finalException;
235  if (iException) {
236  std::unique_ptr<cms::Exception> pEx;
237  try {
238  std::rethrow_exception(*iException);
239  } catch (cms::Exception& oldEx) {
240  pEx = std::unique_ptr<cms::Exception>(oldEx.clone());
241  }
242  try {
243  std::ostringstream ost;
244  ost << iEP.id();
245  shouldContinue = handleWorkerFailure(*pEx,
246  iModuleIndex,
247  /*isEvent*/ true,
248  /*isBegin*/ true,
249  InEvent,
250  worker.getWorker()->description(),
251  ost.str());
252  //If we didn't rethrow, then we effectively skipped
253  worker.skipWorker(iEP);
254  finalException = std::exception_ptr();
255  } catch (...) {
256  shouldContinue = false;
257  finalException = std::current_exception();
258  //set the exception early to avoid case where another Path is waiting
259  // on a module in this Path and not running the module will lead to a
260  // different but related exception in the other Path. We want this
261  // Paths exception to be the one that gets reported.
262  waitingTasks_.presetTaskAsFailed(finalException);
263  }
264  }
266  shouldContinue = false;
267  }
268  auto const nextIndex = iModuleIndex + 1;
269  if (shouldContinue and nextIndex < workers_.size()) {
270  runNextWorkerAsync(nextIndex, iEP, iES, iToken, iID, iContext);
271  return;
272  }
273 
274  if (not shouldContinue) {
275  //we are leaving the path early
276  for (auto it = workers_.begin() + nextIndex, itEnd = workers_.end(); it != itEnd; ++it) {
277  it->skipWorker(iEP);
278  }
279  handleEarlyFinish(iEP);
280  }
281  finished(iModuleIndex, shouldContinue, finalException, iContext, iEP, iES, iID);
282  }
void handleEarlyFinish(EventPrincipal const &)
Definition: Path.cc:191
WaitingTaskList waitingTasks_
Definition: Path.h:123
WorkersInPath workers_
Definition: Path.h:119
void presetTaskAsFailed(std::exception_ptr iExcept)
bool handleWorkerFailure(cms::Exception &e, int nwrwue, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id)
Definition: Path.cc:64
void finished(int iModuleIndex, bool iSucceeded, std::exception_ptr, StreamContext const *, EventPrincipal const &iEP, EventSetupImpl const &iES, StreamID const &streamID)
Definition: Path.cc:284
void runNextWorkerAsync(unsigned int iNextModuleIndex, EventPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID const &, StreamContext const *)
Definition: Path.cc:316
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:124
virtual Exception * clone() const
Definition: Exception.cc:181

Member Data Documentation

ExceptionToActionTable const* edm::Path::act_table_
private

Definition at line 117 of file Path.h.

Referenced by handleWorkerFailure().

std::shared_ptr<ActivityRegistry> edm::Path::actReg_
private

Definition at line 116 of file Path.h.

Referenced by finished(), and processOneOccurrenceAsync().

int edm::Path::bitpos_
private

Definition at line 114 of file Path.h.

Referenced by bitPosition(), and recordStatus().

std::vector<EarlyDeleteHelper*> edm::Path::earlyDeleteHelpers_
private

Definition at line 120 of file Path.h.

Referenced by handleEarlyFinish(), and setEarlyDeleteHelpers().

PathContext edm::Path::pathContext_
private
PathStatusInserter* edm::Path::pathStatusInserter_
private

Definition at line 126 of file Path.h.

Referenced by finished(), and setPathStatusInserter().

Worker* edm::Path::pathStatusInserterWorker_
private

Definition at line 127 of file Path.h.

Referenced by finished(), and setPathStatusInserter().

State edm::Path::state_
private
std::atomic<bool>* edm::Path::stopProcessingEvent_
private

Definition at line 124 of file Path.h.

Referenced by handleWorkerFailure(), and workerFinished().

int edm::Path::timesExcept_
private

Definition at line 110 of file Path.h.

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

int edm::Path::timesFailed_
private

Definition at line 109 of file Path.h.

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

int edm::Path::timesPassed_
private

Definition at line 108 of file Path.h.

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

int edm::Path::timesRun_
private

Definition at line 107 of file Path.h.

Referenced by clearCounters(), processOneOccurrenceAsync(), and timesRun().

TrigResPtr edm::Path::trptr_
private

Definition at line 115 of file Path.h.

Referenced by recordStatus().

WaitingTaskList edm::Path::waitingTasks_
private

Definition at line 123 of file Path.h.

Referenced by finished(), processOneOccurrenceAsync(), and workerFinished().

WorkersInPath edm::Path::workers_
private