CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< HLTGlobalStatus
TrigResPtr
 
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 *)
 
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
int timesFailed_
Definition: Path.h:96
int timesExcept_
Definition: Path.h:97
PathContext pathContext_
Definition: Path.h:109
actions
Definition: Schedule.cc:384
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:103
TrigResPtr trptr_
Definition: Path.h:102
int bitpos_
Definition: Path.h:101
areg
Definition: Schedule.cc:384
WorkersInPath workers_
Definition: Path.h:106
ExceptionToActionTable const * act_table_
Definition: Path.h:104
State state_
Definition: Path.h:99
int timesPassed_
Definition: Path.h:95
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:111
int timesRun_
Definition: Path.h:94
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:107
int timesFailed_
Definition: Path.h:96
int timesExcept_
Definition: Path.h:97
PathContext pathContext_
Definition: Path.h:109
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:103
TrigResPtr trptr_
Definition: Path.h:102
int bitpos_
Definition: Path.h:101
WorkersInPath workers_
Definition: Path.h:106
ExceptionToActionTable const * act_table_
Definition: Path.h:104
State state_
Definition: Path.h:99
int timesPassed_
Definition: Path.h:95
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:111
int timesRun_
Definition: Path.h:94

Member Function Documentation

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

Definition at line 67 of file Path.h.

References bitpos_.

Referenced by edm::fillPathSummary().

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

Definition at line 168 of file Path.cc.

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

Referenced by edm::StreamSchedule::clearCounters().

168  {
169  using std::placeholders::_1;
171  for_all(workers_, std::bind(&WorkerInPath::clearCounters, _1));
172  }
int timesFailed_
Definition: Path.h:96
int timesExcept_
Definition: Path.h:97
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
WorkersInPath workers_
Definition: Path.h:106
int timesPassed_
Definition: Path.h:95
int timesRun_
Definition: Path.h:94
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 110 of file Path.cc.

References cms::Exception::addContext(), edm::InLumi, edm::InRun, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), and edm::PathContext::pathName().

Referenced by handleWorkerFailure().

116  {
117  std::ostringstream ost;
118  if (not isEvent) {
119  //For the event case, the Worker has already
120  // added the necessary module context to the exception
121  if (begin && branchType == InRun) {
122  ost << "Calling beginRun";
123  }
124  else if (begin && branchType == InLumi) {
125  ost << "Calling beginLuminosityBlock";
126  }
127  else if (!begin && branchType == InLumi) {
128  ost << "Calling endLuminosityBlock";
129  }
130  else if (!begin && branchType == InRun) {
131  ost << "Calling endRun";
132  }
133  else {
134  // It should be impossible to get here ...
135  ost << "Calling unknown function";
136  }
137  ost << " for module " << desc.moduleName() << "/'" << desc.moduleLabel() << "'";
138  ex.addContext(ost.str());
139  ost.str("");
140  }
141  ost << "Running path '" << pathContext.pathName() << "'";
142  ex.addContext(ost.str());
143  ost.str("");
144  ost << "Processing ";
145  ost << id;
146  ex.addContext(ost.str());
147  }
void addContext(std::string const &context)
Definition: Exception.cc:227
#define begin
Definition: vmac.h:30
void edm::Path::finished ( int  iModuleIndex,
bool  iSucceeded,
std::exception_ptr  iException,
StreamContext const *  iContext 
)
private

Definition at line 272 of file Path.cc.

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

Referenced by processOneOccurrenceAsync(), and workerFinished().

272  {
273 
274  if(not iException) {
275  updateCounters(iSucceeded, true);
276  recordStatus(iModuleIndex, true);
277  }
278  try {
279  HLTPathStatus status(state_, iModuleIndex);
280  actReg_->postPathEventSignal_(*iContext, pathContext_, status);
281  } catch(...) {
282  if(not iException) {
283  iException = std::current_exception();
284  }
285  }
286  waitingTasks_.doneWaiting(iException);
287  }
void recordStatus(int nwrwue, bool isEvent)
Definition: Path.cc:150
PathContext pathContext_
Definition: Path.h:109
WaitingTaskList waitingTasks_
Definition: Path.h:110
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:103
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:157
State state_
Definition: Path.h:99
tuple status
Definition: mps_update.py:57
Worker const* edm::Path::getWorker ( size_type  i) const
inline

Definition at line 84 of file Path.h.

References workers_.

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

84 { return workers_.at(i).getWorker(); }
int i
Definition: DBlmapReader.cc:9
WorkersInPath workers_
Definition: Path.h:106
void edm::Path::handleEarlyFinish ( EventPrincipal const &  iEvent)
private

Definition at line 192 of file Path.cc.

References earlyDeleteHelpers_.

Referenced by processOneOccurrence(), and workerFinished().

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

Definition at line 138 of file Path.h.

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

Definition at line 139 of file Path.h.

139 {}
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_fire::action, cms::Exception::addAdditionalInfo(), cms::Exception::category(), edm::Exception::codeToString(), alignCSCRings::e, edm::hlt::Exception, exceptionContext(), edm::exception_actions::FailPath, edm::ExceptionToActionTable::find(), pathContext_, edm::printCmsExceptionWarning(), edm::errors::ProductNotFound, recordStatus(), edm::exception_actions::Rethrow, edm::exception_actions::SkipEvent, state_, stopProcessingEvent_, AlCaHLTBitMon_QueryRunRegistry::string, and timesExcept_.

Referenced by processOneOccurrence(), and workerFinished().

66  {
67 
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 e;
103  }
104  }
105 
106  return should_continue;
107  }
void recordStatus(int nwrwue, bool isEvent)
Definition: Path.cc:150
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:50
std::string const & category() const
Definition: Exception.cc:183
exception_actions::ActionCodes find(const std::string &category) const
int timesExcept_
Definition: Path.h:97
PathContext pathContext_
Definition: Path.h:109
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:110
string action
Definition: mps_fire.py:28
ExceptionToActionTable const * act_table_
Definition: Path.h:104
State state_
Definition: Path.h:99
#define begin
Definition: vmac.h:30
std::atomic< bool > * stopProcessingEvent_
Definition: Path.h:111
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
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 176 of file Path.h.

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

177  {
178 
179  int nwrwue = -1;
180  PathSignalSentry<T> signaler(actReg_.get(), nwrwue, state_, &pathContext_);
181 
182  if (T::isEvent_) {
183  ++timesRun_;
184  }
185  state_ = hlt::Ready;
186 
187  // nwrue = numWorkersRunWithoutUnhandledException
188  bool should_continue = true;
189  WorkersInPath::iterator i = workers_.begin(), end = workers_.end();
190 
191  auto earlyFinishSentry = make_sentry(this,[&i,end, &ep](Path*){
192  for(auto j=i; j!= end;++j) {
193  j->skipWorker(ep);
194  }
195  });
196  for (;
197  i != end && should_continue;
198  ++i) {
199  ++nwrwue;
200  try {
201  convertException::wrap([&]() {
202  should_continue = i->runWorker<T>(ep, es, streamID, context);
203  });
204  }
205  catch(cms::Exception& ex) {
206  // handleWorkerFailure may throw a new exception.
207  std::ostringstream ost;
208  ost << ep.id();
209  should_continue = handleWorkerFailure(ex, nwrwue, T::isEvent_, T::begin_, T::branchType_,
210  i->getWorker()->description(), ost.str());
211  //If we didn't rethrow, then we effectively skipped
212  i->skipWorker(ep);
213  }
214  }
215  if (not should_continue) {
216  handleEarlyFinish(ep);
217  }
218  updateCounters(should_continue, T::isEvent_);
219  recordStatus(nwrwue, T::isEvent_);
220  }
int i
Definition: DBlmapReader.cc:9
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:150
void handleEarlyFinish(EventPrincipal const &)
Definition: Path.cc:192
not [yet] run
Definition: HLTenums.h:18
PathContext pathContext_
Definition: Path.h:109
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:103
int j
Definition: DBlmapReader.cc:9
#define end
Definition: vmac.h:37
WorkersInPath workers_
Definition: Path.h:106
void updateCounters(bool succeed, bool isEvent)
Definition: Path.cc:157
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:99
auto wrap(F iFunc) -> decltype(iFunc())
long double T
int timesRun_
Definition: Path.h:94
void edm::Path::processOneOccurrenceAsync ( WaitingTask iTask,
EventPrincipal const &  iEP,
EventSetup const &  iES,
StreamID const &  iStreamID,
StreamContext const *  iStreamContext 
)

Definition at line 199 of file Path.cc.

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

203  {
205  ++timesRun_;
206  waitingTasks_.add(iTask);
207  if(actReg_) {
208  actReg_->prePathEventSignal_(*iStreamContext, pathContext_);
209  }
210  state_ = hlt::Ready;
211 
212  if(workers_.empty()) {
213  finished(-1, true, std::exception_ptr(), iStreamContext);
214  return;
215  }
216 
217  runNextWorkerAsync(0,iEP,iES,iStreamID, iStreamContext);
218  }
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:290
PathContext pathContext_
Definition: Path.h:109
WaitingTaskList waitingTasks_
Definition: Path.h:110
void reset()
Resets access to the resource so that added tasks will wait.
std::shared_ptr< ActivityRegistry > actReg_
Definition: Path.h:103
WorkersInPath workers_
Definition: Path.h:106
State state_
Definition: Path.h:99
void finished(int iModuleIndex, bool iSucceeded, std::exception_ptr, StreamContext const *)
Definition: Path.cc:272
int timesRun_
Definition: Path.h:94
void edm::Path::recordStatus ( int  nwrwue,
bool  isEvent 
)
private

Definition at line 150 of file Path.cc.

References bitpos_, state_, and trptr_.

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

150  {
151  if(isEvent && trptr_) {
152  (*trptr_)[bitpos_]=HLTPathStatus(state_, nwrwue);
153  }
154  }
TrigResPtr trptr_
Definition: Path.h:102
int bitpos_
Definition: Path.h:101
State state_
Definition: Path.h:99
void edm::Path::runNextWorkerAsync ( unsigned int  iNextModuleIndex,
EventPrincipal const &  iEP,
EventSetup const &  iES,
StreamID const &  iID,
StreamContext const *  iContext 
)
private

Definition at line 290 of file Path.cc.

References edm::ServiceRegistry::instance(), edm::make_waiting_task(), edm::ServiceRegistry::presentToken(), unpackBuffers-CaloStage2::token, workerFinished(), and workers_.

Referenced by processOneOccurrenceAsync(), and workerFinished().

292  {
293 
294  //need to make sure Service system is activated on the reading thread
296 
297  auto nextTask = make_waiting_task( tbb::task::allocate_root(),
298  [this, iNextModuleIndex, &iEP,&iES, iID, iContext, token](std::exception_ptr const* iException)
299  {
301  this->workerFinished(iException, iNextModuleIndex, iEP,iES,iID,iContext);
302  });
303 
304  workers_[iNextModuleIndex].runWorkerAsync<
305  OccurrenceTraits<EventPrincipal, BranchActionStreamBegin>>(nextTask,
306  iEP,
307  iES,
308  iID,
309  iContext);
310  }
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:221
static ServiceRegistry & instance()
WorkersInPath workers_
Definition: Path.h:106
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 175 of file Path.cc.

References earlyDeleteHelpers_, newFWLiteAna::found, getWorker(), cmsHarvester::index, size(), and groupFilesInBlocks::temp.

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

Definition at line 79 of file Path.h.

References workers_.

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

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

Definition at line 77 of file Path.h.

References state_.

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

Definition at line 75 of file Path.h.

References timesExcept_.

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

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

Definition at line 83 of file Path.h.

References workers_.

83 { return workers_.at(i).timesExcept() ; }
int i
Definition: DBlmapReader.cc:9
WorkersInPath workers_
Definition: Path.h:106
int edm::Path::timesFailed ( ) const
inline

Definition at line 74 of file Path.h.

References timesFailed_.

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

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

Definition at line 82 of file Path.h.

References workers_.

82 { return workers_.at(i).timesFailed() ; }
int i
Definition: DBlmapReader.cc:9
WorkersInPath workers_
Definition: Path.h:106
int edm::Path::timesPassed ( ) const
inline

Definition at line 73 of file Path.h.

References timesPassed_.

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

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

Definition at line 81 of file Path.h.

References workers_.

81 { return workers_.at(i).timesPassed() ; }
int i
Definition: DBlmapReader.cc:9
WorkersInPath workers_
Definition: Path.h:106
int edm::Path::timesRun ( ) const
inline

Definition at line 72 of file Path.h.

References timesRun_.

Referenced by edm::fillPathSummary().

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

Definition at line 80 of file Path.h.

References workers_.

Referenced by edm::fillModuleInPathSummary().

80 { return workers_.at(i).timesVisited(); }
int i
Definition: DBlmapReader.cc:9
WorkersInPath workers_
Definition: Path.h:106
void edm::Path::updateCounters ( bool  succeed,
bool  isEvent 
)
private

Definition at line 157 of file Path.cc.

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

Referenced by finished(), and processOneOccurrence().

157  {
158  if (success) {
159  if (isEvent) ++timesPassed_;
160  state_ = hlt::Pass;
161  } else {
162  if(isEvent) ++timesFailed_;
163  state_ = hlt::Fail;
164  }
165  }
int timesFailed_
Definition: Path.h:96
reject
Definition: HLTenums.h:20
accept
Definition: HLTenums.h:19
State state_
Definition: Path.h:99
int timesPassed_
Definition: Path.h:95
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 221 of file Path.cc.

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

Referenced by runNextWorkerAsync().

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

Member Data Documentation

ExceptionToActionTable const* edm::Path::act_table_
private

Definition at line 104 of file Path.h.

Referenced by handleWorkerFailure().

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

Definition at line 103 of file Path.h.

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

int edm::Path::bitpos_
private

Definition at line 101 of file Path.h.

Referenced by bitPosition(), and recordStatus().

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

Definition at line 107 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 111 of file Path.h.

Referenced by handleWorkerFailure(), and workerFinished().

int edm::Path::timesExcept_
private

Definition at line 97 of file Path.h.

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

int edm::Path::timesFailed_
private

Definition at line 96 of file Path.h.

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

int edm::Path::timesPassed_
private

Definition at line 95 of file Path.h.

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

int edm::Path::timesRun_
private

Definition at line 94 of file Path.h.

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

TrigResPtr edm::Path::trptr_
private

Definition at line 102 of file Path.h.

Referenced by recordStatus().

WaitingTaskList edm::Path::waitingTasks_
private

Definition at line 110 of file Path.h.

Referenced by finished(), and processOneOccurrenceAsync().

WorkersInPath edm::Path::workers_
private