LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::Path::WorkerDoneTask Class Reference

Public Member Functions

 WorkerDoneTask (Path *path, size_t const idx, size_t const max_idx, EventPrincipal &ep, WaitingTaskPtr pathsDone, GlobalTaskGroup &group)
 
void operator() (exception_ptr ex)
 

Private Attributes

Pathpath_
 
size_t const idx_
 
size_t const max_idx_
 
EventPrincipalep_
 
WaitingTaskPtr pathsDone_
 
GlobalTaskGroupgroup_
 

Detailed Description

Definition at line 245 of file Path.cc.

Constructor & Destructor Documentation

art::Path::WorkerDoneTask::WorkerDoneTask ( Path path,
size_t const  idx,
size_t const  max_idx,
EventPrincipal ep,
WaitingTaskPtr  pathsDone,
GlobalTaskGroup group 
)
inline

Definition at line 247 of file Path.cc.

253  : path_{path}
254  , idx_{idx}
255  , max_idx_{max_idx}
256  , ep_{ep}
257  , pathsDone_{pathsDone}
258  , group_{group}
259  {}
WaitingTaskPtr pathsDone_
Definition: Path.cc:326
size_t const idx_
Definition: Path.cc:323
EventPrincipal & ep_
Definition: Path.cc:325
GlobalTaskGroup & group_
Definition: Path.cc:327
size_t const max_idx_
Definition: Path.cc:324

Member Function Documentation

void art::Path::WorkerDoneTask::operator() ( exception_ptr  ex)
inline

Definition at line 261 of file Path.cc.

References e, art::actions::FailModule, art::actions::FailPath, art::errors::ScheduleExecutionFailure, TDEBUG_BEGIN_TASK_SI, TDEBUG_END_TASK_SI, and TDEBUG_TASK_SI.

262  {
263  auto const sid = path_->pc_.scheduleID();
264  TDEBUG_BEGIN_TASK_SI(4, sid);
265  auto& workerInPath = path_->workers_[idx_];
266  // Note: This will only be set false by a filter which has rejected.
267  bool new_should_continue = workerInPath.returnCode();
268  TDEBUG_TASK_SI(4, sid) << "new_should_continue: " << new_should_continue;
269  if (ex) {
270  try {
271  rethrow_exception(ex);
272  }
273  catch (cet::exception& e) {
274  auto action = path_->actionTable_.find(e.root_cause());
275  assert(action != actions::FailModule);
276  if (action != actions::FailPath) {
277  // Possible actions: IgnoreCompletely, Rethrow, SkipEvent
278  ++path_->timesExcept_;
280  if (path_->trptr_) {
281  // Not the end path.
283  HLTPathStatus(path_->state_, idx_);
284  }
285  auto art_ex =
286  Exception{
287  errors::ScheduleExecutionFailure, "Path: ProcessingStopped.", e}
288  << "Exception going through path " << path_->name() << '\n';
289  auto ex_ptr = make_exception_ptr(art_ex);
290  group_.may_run(pathsDone_, ex_ptr);
291  TDEBUG_END_TASK_SI(4, sid) << "terminate path because of EXCEPTION";
292  return;
293  }
294  new_should_continue = false;
295  mf::LogWarning(e.category()) << "Failing path " << path_->name()
296  << ", due to exception, message:\n"
297  << e.what();
298  // WARNING: We continue processing below!!!
299  }
300  catch (...) {
301  mf::LogError("PassingThrough")
302  << "Exception passing through path " << path_->name();
303  ++path_->timesExcept_;
305  if (path_->trptr_) {
306  // Not the end path.
308  HLTPathStatus(path_->state_, idx_);
309  }
310  group_.may_run(pathsDone_, current_exception());
311  TDEBUG_END_TASK_SI(4, sid) << "terminate path because of EXCEPTION";
312  return;
313  }
314  }
315 
317  idx_, max_idx_, ep_, new_should_continue, pathsDone_);
318  TDEBUG_END_TASK_SI(4, sid);
319  }
#define TDEBUG_BEGIN_TASK_SI(LEVEL, SI)
hlt::HLTState state_
Definition: Path.h:95
void process_event_workerFinished(size_t const idx, size_t const max_idx, EventPrincipal &ep, bool should_continue, hep::concurrency::WaitingTaskPtr pathsDone)
Definition: Path.cc:347
actions::ActionCodes find(std::string const &category) const
Definition: Actions.cc:58
#define TDEBUG_END_TASK_SI(LEVEL, SI)
std::string const & name() const
Definition: Path.cc:69
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
ActionTable const & actionTable_
Definition: Path.h:82
auto scheduleID() const
Definition: PathContext.h:52
#define TDEBUG_TASK_SI(LEVEL, SI)
std::size_t timesExcept_
Definition: Path.h:99
WaitingTaskPtr pathsDone_
Definition: Path.cc:326
size_t const idx_
Definition: Path.cc:323
EventPrincipal & ep_
Definition: Path.cc:325
size_t const pathPosition_
Definition: Path.h:85
cet::exempt_ptr< HLTGlobalStatus > trptr_
Definition: Path.h:90
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::vector< WorkerInPath > workers_
Definition: Path.h:87
GlobalTaskGroup & group_
Definition: Path.cc:327
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void may_run(hep::concurrency::WaitingTaskPtr task, std::exception_ptr ex_ptr={})
PathContext const pc_
Definition: Path.h:84
Float_t e
Definition: plot.C:35
size_t const max_idx_
Definition: Path.cc:324
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

EventPrincipal& art::Path::WorkerDoneTask::ep_
private

Definition at line 325 of file Path.cc.

GlobalTaskGroup& art::Path::WorkerDoneTask::group_
private

Definition at line 327 of file Path.cc.

size_t const art::Path::WorkerDoneTask::idx_
private

Definition at line 323 of file Path.cc.

size_t const art::Path::WorkerDoneTask::max_idx_
private

Definition at line 324 of file Path.cc.

Path* art::Path::WorkerDoneTask::path_
private

Definition at line 322 of file Path.cc.

WaitingTaskPtr art::Path::WorkerDoneTask::pathsDone_
private

Definition at line 326 of file Path.cc.


The documentation for this class was generated from the following file: