test
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:383
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:383
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 167 of file Path.cc.

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

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

167  {
168  using std::placeholders::_1;
170  for_all(workers_, std::bind(&WorkerInPath::clearCounters, _1));
171  }
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 (isEvent) {
119  ost << "Calling event method";
120  }
121  else 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  ost << "Running path '" << pathContext.pathName() << "'";
141  ex.addContext(ost.str());
142  ost.str("");
143  ost << "Processing ";
144  ost << id;
145  ex.addContext(ost.str());
146  }
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 271 of file Path.cc.

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

Referenced by processOneOccurrenceAsync(), and workerFinished().

271  {
272 
273  if(not iException) {
274  updateCounters(iSucceeded, true);
275  recordStatus(iModuleIndex, true);
276  }
277  try {
278  HLTPathStatus status(state_, iModuleIndex);
279  actReg_->postPathEventSignal_(*iContext, pathContext_, status);
280  } catch(...) {
281  if(not iException) {
282  iException = std::current_exception();
283  }
284  }
285  waitingTasks_.doneWaiting(iException);
286  }
void recordStatus(int nwrwue, bool isEvent)
Definition: Path.cc:149
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:156
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 191 of file Path.cc.

References earlyDeleteHelpers_.

Referenced by processOneOccurrence(), and workerFinished().

191  {
192  for(auto helper: earlyDeleteHelpers_) {
193  helper->pathFinished(iEvent);
194  }
195  }
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:149
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:149
void handleEarlyFinish(EventPrincipal const &)
Definition: Path.cc:191
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:156
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 198 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  actReg_->prePathEventSignal_(*iStreamContext, pathContext_);
208  }
209  state_ = hlt::Ready;
210 
211  if(workers_.empty()) {
212  finished(-1, true, std::exception_ptr(), iStreamContext);
213  return;
214  }
215 
216  runNextWorkerAsync(0,iEP,iES,iStreamID, iStreamContext);
217  }
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:289
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:271
int timesRun_
Definition: Path.h:94
void edm::Path::recordStatus ( int  nwrwue,
bool  isEvent 
)
private

Definition at line 149 of file Path.cc.

References bitpos_, state_, and trptr_.

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

149  {
150  if(isEvent && trptr_) {
151  (*trptr_)[bitpos_]=HLTPathStatus(state_, nwrwue);
152  }
153  }
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 289 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().

291  {
292 
293  //need to make sure Service system is activated on the reading thread
295 
296  auto nextTask = make_waiting_task( tbb::task::allocate_root(),
297  [this, iNextModuleIndex, &iEP,&iES, iID, iContext, token](std::exception_ptr const* iException)
298  {
300  this->workerFinished(iException, iNextModuleIndex, iEP,iES,iID,iContext);
301  });
302 
303  workers_[iNextModuleIndex].runWorkerAsync<
304  OccurrenceTraits<EventPrincipal, BranchActionStreamBegin>>(nextTask,
305  iEP,
306  iES,
307  iID,
308  iContext);
309  }
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:220
static ServiceRegistry & instance()
WorkersInPath workers_
Definition: Path.h:106
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:88
void edm::Path::setEarlyDeleteHelpers ( std::map< const Worker *, EarlyDeleteHelper * > const &  iWorkerToDeleter)

Definition at line 174 of file Path.cc.

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

174  {
175  //we use a temp so we can overset the size but then when moving to earlyDeleteHelpers we only
176  // have to use the space necessary
177  std::vector<EarlyDeleteHelper*> temp;
178  temp.reserve(iWorkerToDeleter.size());
179  for(unsigned int index=0; index !=size();++index) {
180  auto found = iWorkerToDeleter.find(getWorker(index));
181  if(found != iWorkerToDeleter.end()) {
182  temp.push_back(found->second);
183  found->second->addedToPath();
184  }
185  }
186  std::vector<EarlyDeleteHelper*> tempCorrectSize(temp.begin(),temp.end());
187  earlyDeleteHelpers_.swap(tempCorrectSize);
188  }
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 156 of file Path.cc.

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

Referenced by finished(), and processOneOccurrence().

156  {
157  if (success) {
158  if (isEvent) ++timesPassed_;
159  state_ = hlt::Pass;
160  } else {
161  if(isEvent) ++timesFailed_;
162  state_ = hlt::Fail;
163  }
164  }
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 220 of file Path.cc.

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

Referenced by runNextWorkerAsync().

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