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 &)
 
template<typename T >
void processOneOccurrence (typename T::MyPrincipal const &, EventSetup const &, StreamID const &, typename T::Context const *)
 
void processOneOccurrenceAsync (WaitingTask *, EventPrincipal const &, EventSetup const &, StreamID const &, StreamContext const *)
 
template<typename T >
void runAllModulesAsync (WaitingTask *, typename T::MyPrincipal const &, EventSetup const &, StreamID const &, typename T::Context const *)
 
void setEarlyDeleteHelpers (std::map< const Worker *, EarlyDeleteHelper * > const &)
 
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 *)
 
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 &, EventSetup const &, StreamID const &, StreamContext const *)
 
void updateCounters (bool succeed, bool isEvent)
 
void workerFinished (std::exception_ptr const *iException, unsigned int iModuleIndex, EventPrincipal const &iEP, EventSetup const &iES, 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_
 
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 42 of file Path.h.

Member Typedef Documentation

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

Definition at line 47 of file Path.h.

Definition at line 44 of file Path.h.

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

Definition at line 48 of file Path.h.

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

Definition at line 46 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 12 of file Path.cc.

References pathContext_, and workers_.

19  :
20  timesRun_(),
21  timesPassed_(),
22  timesFailed_(),
23  timesExcept_(),
25  bitpos_(bitpos),
26  trptr_(trptr),
27  actReg_(areg),
29  workers_(workers),
30  pathContext_(path_name, streamContext, bitpos, pathType),
31  stopProcessingEvent_(stopProcessingEvent){
32 
33  for (auto& workerInPath : workers_) {
34  workerInPath.setPathContext(&pathContext_);
35  }
36  }
not [yet] run
Definition: HLTenums.h:18
roAction_t actions[nactions]
Definition: GenABIO.cc:187
int timesFailed_
Definition: Path.h:103
int timesExcept_
Definition: Path.h:104
PathContext pathContext_
Definition: Path.h:116
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:110
TrigResPtr trptr_
Definition: Path.h:109
int bitpos_
Definition: Path.h:108
WorkersInPath workers_
Definition: Path.h:113
ExceptionToActionTable const * act_table_
Definition: Path.h:111
State state_
Definition: Path.h:106
int timesPassed_
Definition: Path.h:102
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:118
int timesRun_
Definition: Path.h:101
edm::Path::Path ( Path const &  r)

Definition at line 38 of file Path.cc.

References pathContext_, and workers_.

38  :
39  timesRun_(r.timesRun_),
40  timesPassed_(r.timesPassed_),
41  timesFailed_(r.timesFailed_),
42  timesExcept_(r.timesExcept_),
43  state_(r.state_),
44  bitpos_(r.bitpos_),
45  trptr_(r.trptr_),
46  actReg_(r.actReg_),
47  act_table_(r.act_table_),
48  workers_(r.workers_),
49  earlyDeleteHelpers_(r.earlyDeleteHelpers_),
50  pathContext_(r.pathContext_),
51  stopProcessingEvent_(r.stopProcessingEvent_){
52 
53  for (auto& workerInPath : workers_) {
54  workerInPath.setPathContext(&pathContext_);
55  }
56  }
std::vector< EarlyDeleteHelper * > earlyDeleteHelpers_
Definition: Path.h:114
int timesFailed_
Definition: Path.h:103
int timesExcept_
Definition: Path.h:104
PathContext pathContext_
Definition: Path.h:116
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:110
TrigResPtr trptr_
Definition: Path.h:109
int bitpos_
Definition: Path.h:108
WorkersInPath workers_
Definition: Path.h:113
ExceptionToActionTable const * act_table_
Definition: Path.h:111
State state_
Definition: Path.h:106
int timesPassed_
Definition: Path.h:102
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:118
int timesRun_
Definition: Path.h:101

Member Function Documentation

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

Definition at line 74 of file Path.h.

References bitpos_.

Referenced by edm::fillPathSummary().

74 { return bitpos_; }
int bitpos_
Definition: Path.h:108
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:103
int timesExcept_
Definition: Path.h:104
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
WorkersInPath workers_
Definition: Path.h:113
int timesPassed_
Definition: Path.h:102
int timesRun_
Definition: Path.h:101
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 111 of file Path.cc.

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

Referenced by handleWorkerFailure().

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

Definition at line 268 of file Path.cc.

References actReg_, edm::WaitingTaskList::doneWaiting(), pathContext_, recordStatus(), state_, mps_update::status, updateCounters(), and waitingTasks_.

Referenced by processOneOccurrenceAsync(), and workerFinished().

268  {
269 
270  if(not iException) {
271  updateCounters(iSucceeded, true);
272  recordStatus(iModuleIndex, true);
273  }
274  try {
275  HLTPathStatus status(state_, iModuleIndex);
276  actReg_->postPathEventSignal_(*iContext, pathContext_, status);
277  } catch(...) {
278  if(not iException) {
279  iException = std::current_exception();
280  }
281  }
282  waitingTasks_.doneWaiting(iException);
283  }
void recordStatus(int nwrwue, bool isEvent)
Definition: Path.cc:146
PathContext pathContext_
Definition: Path.h:116
WaitingTaskList waitingTasks_
Definition: Path.h:117
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:110
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:153
State state_
Definition: Path.h:106
Worker const* edm::Path::getWorker ( size_type  i) const
inline

Definition at line 91 of file Path.h.

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

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

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

Definition at line 188 of file Path.cc.

References earlyDeleteHelpers_.

Referenced by processOneOccurrence(), and workerFinished().

188  {
189  for(auto helper: earlyDeleteHelpers_) {
190  helper->pathFinished(iEvent);
191  }
192  }
Definition: helper.py:1
std::vector< EarlyDeleteHelper * > earlyDeleteHelpers_
Definition: Path.h:114
int iEvent
Definition: GenABIO.cc:230
void edm::Path::handleEarlyFinish ( RunPrincipal const &  )
inlineprivate

Definition at line 145 of file Path.h.

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

Definition at line 146 of file Path.h.

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

146 {}
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 60 of file Path.cc.

References act_table_, mps_alisetup::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 processOneOccurrence(), and workerFinished().

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

template<typename T >
void edm::Path::processOneOccurrence ( typename T::MyPrincipal const &  ep,
EventSetup const &  es,
StreamID const &  streamID,
typename T::Context const *  context 
)

Definition at line 194 of file Path.h.

References actReg_, end, handleEarlyFinish(), handleWorkerFailure(), mps_fire::i, edm::make_sentry(), pathContext_, edm::hlt::Ready, recordStatus(), state_, timesRun_, updateCounters(), workers_, and edm::convertException::wrap().

195  {
196 
197  int nwrwue = -1;
198  PathSignalSentry<T> signaler(actReg_.get(), nwrwue, state_, &pathContext_);
199 
200  if (T::isEvent_) {
201  ++timesRun_;
202  }
203  state_ = hlt::Ready;
204 
205  // nwrue = numWorkersRunWithoutUnhandledException
206  bool should_continue = true;
207  WorkersInPath::iterator i = workers_.begin(), end = workers_.end();
208 
209  auto earlyFinishSentry = make_sentry(this,[&i,end, &ep](Path*){
210  for(auto j=i; j!= end;++j) {
211  j->skipWorker(ep);
212  }
213  });
214  for (;
215  i != end && should_continue;
216  ++i) {
217  ++nwrwue;
218  try {
219  convertException::wrap([&]() {
220  should_continue = i->runWorker<T>(ep, es, streamID, context);
221  });
222  }
223  catch(cms::Exception& ex) {
224  // handleWorkerFailure may throw a new exception.
225  std::ostringstream ost;
226  ost << ep.id();
227  should_continue = handleWorkerFailure(ex, nwrwue, T::isEvent_, T::begin_, T::branchType_,
228  i->getWorker()->description(), ost.str());
229  //If we didn't rethrow, then we effectively skipped
230  i->skipWorker(ep);
231  }
232  }
233  if (not should_continue) {
234  handleEarlyFinish(ep);
235  }
236  updateCounters(should_continue, T::isEvent_);
237  recordStatus(nwrwue, T::isEvent_);
238  }
std::unique_ptr< T, F > make_sentry(T *iObject, F iFunc)
NOTE: if iObject is null, then iFunc will not be called.
Definition: make_sentry.h:29
void recordStatus(int nwrwue, bool isEvent)
Definition: Path.cc:146
void handleEarlyFinish(EventPrincipal const &)
Definition: Path.cc:188
not [yet] run
Definition: HLTenums.h:18
PathContext pathContext_
Definition: Path.h:116
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:110
#define end
Definition: vmac.h:37
WorkersInPath workers_
Definition: Path.h:113
void updateCounters(bool succeed, bool isEvent)
Definition: Path.cc:153
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: Path.cc:12
bool handleWorkerFailure(cms::Exception &e, int nwrwue, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id)
Definition: Path.cc:60
State state_
Definition: Path.h:106
auto wrap(F iFunc) -> decltype(iFunc())
long double T
int timesRun_
Definition: Path.h:101
void edm::Path::processOneOccurrenceAsync ( WaitingTask iTask,
EventPrincipal const &  iEP,
EventSetup const &  iES,
StreamID const &  iStreamID,
StreamContext const *  iStreamContext 
)

Definition at line 195 of file Path.cc.

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

199  {
201  ++timesRun_;
202  waitingTasks_.add(iTask);
203  if(actReg_) {
204  actReg_->prePathEventSignal_(*iStreamContext, pathContext_);
205  }
206  state_ = hlt::Ready;
207 
208  if(workers_.empty()) {
209  finished(-1, true, std::exception_ptr(), iStreamContext);
210  return;
211  }
212 
213  runNextWorkerAsync(0,iEP,iES,iStreamID, iStreamContext);
214  }
not [yet] run
Definition: HLTenums.h:18
void add(WaitingTask *)
Adds task to the waiting list.
void runNextWorkerAsync(unsigned int iNextModuleIndex, EventPrincipal const &, EventSetup const &, StreamID const &, StreamContext const *)
Definition: Path.cc:286
PathContext pathContext_
Definition: Path.h:116
WaitingTaskList waitingTasks_
Definition: Path.h:117
void reset()
Resets access to the resource so that added tasks will wait.
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:110
WorkersInPath workers_
Definition: Path.h:113
State state_
Definition: Path.h:106
void finished(int iModuleIndex, bool iSucceeded, std::exception_ptr, StreamContext const *)
Definition: Path.cc:268
int timesRun_
Definition: Path.h:101
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(), handleWorkerFailure(), and processOneOccurrence().

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

Definition at line 183 of file Path.h.

References AlCaHLTBitMon_ParallelJobs::p, and workers_.

187  {
188  for(auto& worker: workers_) {
189  worker.runWorkerAsync<T>(task,p,es,streamID,context);
190  }
191  }
WorkersInPath workers_
Definition: Path.h:113
long double T
void edm::Path::runNextWorkerAsync ( unsigned int  iNextModuleIndex,
EventPrincipal const &  iEP,
EventSetup const &  iES,
StreamID const &  iID,
StreamContext const *  iContext 
)
private

Definition at line 286 of file Path.cc.

References edm::ServiceRegistry::instance(), edm::make_waiting_task(), edm::ServiceRegistry::presentToken(), workerFinished(), and workers_.

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

288  {
289 
290  //need to make sure Service system is activated on the reading thread
291  auto token = ServiceRegistry::instance().presentToken();
292 
293  auto nextTask = make_waiting_task( tbb::task::allocate_root(),
294  [this, iNextModuleIndex, &iEP,&iES, iID, iContext, token](std::exception_ptr const* iException)
295  {
296  ServiceRegistry::Operate guard(token);
297  this->workerFinished(iException, iNextModuleIndex, iEP,iES,iID,iContext);
298  });
299 
300  workers_[iNextModuleIndex].runWorkerAsync<
301  OccurrenceTraits<EventPrincipal, BranchActionStreamBegin>>(nextTask,
302  iEP,
303  iES,
304  iID,
305  iContext);
306  }
ServiceToken presentToken() const
void workerFinished(std::exception_ptr const *iException, unsigned int iModuleIndex, EventPrincipal const &iEP, EventSetup const &iES, StreamID const &iID, StreamContext const *iContext)
Definition: Path.cc:217
static ServiceRegistry & instance()
WorkersInPath workers_
Definition: Path.h:113
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:90
void edm::Path::setEarlyDeleteHelpers ( std::map< const Worker *, EarlyDeleteHelper * > const &  iWorkerToDeleter)

Definition at line 171 of file Path.cc.

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

Referenced by getWorker().

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

Definition at line 86 of file Path.h.

References workers_.

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

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

Definition at line 84 of file Path.h.

References state_.

Referenced by handleEarlyFinish().

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

Definition at line 82 of file Path.h.

References timesExcept_.

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

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

Definition at line 90 of file Path.h.

References workers_.

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

Definition at line 81 of file Path.h.

References timesFailed_.

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

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

Definition at line 89 of file Path.h.

References workers_.

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

Definition at line 80 of file Path.h.

References timesPassed_.

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

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

Definition at line 88 of file Path.h.

References workers_.

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

Definition at line 79 of file Path.h.

References timesRun_.

Referenced by edm::fillPathSummary().

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

Definition at line 87 of file Path.h.

References workers_.

Referenced by edm::fillModuleInPathSummary().

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

Definition at line 153 of file Path.cc.

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

Referenced by finished(), and processOneOccurrence().

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

Definition at line 217 of file Path.cc.

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

Referenced by handleEarlyFinish(), and runNextWorkerAsync().

220  {
221 
222  //This call also allows the WorkerInPath to update statistics
223  // so should be done even if an exception happened
224  auto& worker = workers_[iModuleIndex];
225  bool shouldContinue = worker.checkResultsOfRunWorker(true);
226  std::exception_ptr finalException;
227  if(iException) {
228  std::unique_ptr<cms::Exception> pEx;
229  try {
230  std::rethrow_exception(*iException);
231  } catch(cms::Exception& oldEx) {
232  pEx = std::unique_ptr<cms::Exception>(oldEx.clone());
233  }
234  try {
235  std::ostringstream ost;
236  ost << iEP.id();
237  shouldContinue = handleWorkerFailure(*pEx, iModuleIndex, /*isEvent*/ true, /*isBegin*/ true, InEvent,
238  worker.getWorker()->description(), ost.str());
239  //If we didn't rethrow, then we effectively skipped
240  worker.skipWorker(iEP);
241  finalException = std::exception_ptr();
242  } catch(...) {
243  shouldContinue = false;
244  finalException = std::current_exception();
245  }
246  }
248  shouldContinue = false;
249  }
250  auto const nextIndex = iModuleIndex +1;
251  if (shouldContinue and nextIndex < workers_.size()) {
252  runNextWorkerAsync(nextIndex, iEP, iES, iID, iContext);
253  return;
254  }
255 
256  if (not shouldContinue) {
257  //we are leaving the path early
258  for(auto it = workers_.begin()+nextIndex, itEnd=workers_.end();
259  it != itEnd; ++it) {
260  it->skipWorker(iEP);
261  }
262  handleEarlyFinish(iEP);
263  }
264  finished(iModuleIndex, shouldContinue, finalException, iContext);
265  }
void handleEarlyFinish(EventPrincipal const &)
Definition: Path.cc:188
void runNextWorkerAsync(unsigned int iNextModuleIndex, EventPrincipal const &, EventSetup const &, StreamID const &, StreamContext const *)
Definition: Path.cc:286
WorkersInPath workers_
Definition: Path.h:113
bool handleWorkerFailure(cms::Exception &e, int nwrwue, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id)
Definition: Path.cc:60
void finished(int iModuleIndex, bool iSucceeded, std::exception_ptr, StreamContext const *)
Definition: Path.cc:268
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:118
virtual Exception * clone() const
Definition: Exception.cc:259

Member Data Documentation

ExceptionToActionTable const* edm::Path::act_table_
private

Definition at line 111 of file Path.h.

Referenced by handleWorkerFailure().

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

Definition at line 110 of file Path.h.

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

int edm::Path::bitpos_
private

Definition at line 108 of file Path.h.

Referenced by bitPosition(), and recordStatus().

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

Definition at line 114 of file Path.h.

Referenced by handleEarlyFinish(), and setEarlyDeleteHelpers().

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

Definition at line 118 of file Path.h.

Referenced by handleWorkerFailure(), and workerFinished().

int edm::Path::timesExcept_
private

Definition at line 104 of file Path.h.

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

int edm::Path::timesFailed_
private

Definition at line 103 of file Path.h.

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

int edm::Path::timesPassed_
private

Definition at line 102 of file Path.h.

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

int edm::Path::timesRun_
private

Definition at line 101 of file Path.h.

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

TrigResPtr edm::Path::trptr_
private

Definition at line 109 of file Path.h.

Referenced by recordStatus().

WaitingTaskList edm::Path::waitingTasks_
private

Definition at line 117 of file Path.h.

Referenced by finished(), and processOneOccurrenceAsync().

WorkersInPath edm::Path::workers_
private