LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Path.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_Path_h
2 #define art_Framework_Core_Path_h
3 // vim: set sw=2 expandtab :
4 
5 // ====================================================================
6 // A object of type Path represents one path in a job configuration
7 // for a given schedule. It holds the assigned bit position and the
8 // list of workers that are an event must pass through when this parh
9 // is processed. The workers are held in WorkerInPath wrappers so
10 // that per-path execution statistics can be kept for each worker.
11 // ====================================================================
12 
18 #include "art/Utilities/fwd.h"
21 #include "cetlib/exempt_ptr.h"
22 #include "hep_concurrency/WaitingTask.h"
23 
24 #include <cstddef>
25 #include <string>
26 #include <vector>
27 
28 namespace art {
29  class ActivityRegistry;
30  class EventPrincipal;
31  class Path {
32  public:
33  Path(ActionTable const&,
34  ActivityRegistry const&,
35  PathContext const&,
36  std::vector<WorkerInPath>&&,
38  GlobalTaskGroup&) noexcept;
39 
40  ScheduleID scheduleID() const;
41  PathSpec const& pathSpec() const;
42  PathID pathID() const;
43  std::string const& name() const;
44  std::vector<WorkerInPath> const& workersInPath() const;
45  hlt::HLTState state() const;
46  std::size_t timesRun() const;
47  std::size_t timesPassed() const;
48  std::size_t timesFailed() const;
49  std::size_t timesExcept() const;
50  // Note: threading: Clears the counters of workersInPath.
51  void clearCounters();
53  void process(hep::concurrency::WaitingTaskPtr pathsDoneTask,
55 
56  private:
57  class WorkerDoneTask;
58 
59  void runWorkerTask(size_t idx,
60  size_t max_idx,
62  hep::concurrency::WaitingTaskPtr pathsDone);
63 
64  void process_event_idx_asynch(size_t idx,
65  size_t max_idx,
67  hep::concurrency::WaitingTaskPtr pathsDone);
68  void process_event_idx(size_t const idx,
69  size_t const max_idx,
71  hep::concurrency::WaitingTaskPtr pathsDone);
73  size_t const idx,
74  size_t const max_idx,
75  EventPrincipal& ep,
76  bool should_continue,
77  hep::concurrency::WaitingTaskPtr pathsDone);
78  void process_event_pathFinished(size_t const idx,
79  bool should_continue,
80  hep::concurrency::WaitingTaskPtr pathsDone);
81 
85  size_t const pathPosition_;
86  // Note: threading: We clear their counters.
87  std::vector<WorkerInPath> workers_;
88  // The PathManager trigger paths info actually owns this.
89  // Note: For the end path this will be the nullptr.
90  cet::exempt_ptr<HLTGlobalStatus> trptr_;
91 
93 
94  // These are adjusted in a serialized context.
96  std::size_t timesRun_{};
97  std::size_t timesPassed_{};
98  std::size_t timesFailed_{};
99  std::size_t timesExcept_{};
100  };
101 } // namespace art
102 
103 #endif /* art_Framework_Core_Path_h */
104 
105 // Local Variables:
106 // mode: c++
107 // End:
GlobalTaskGroup & taskGroup_
Definition: Path.h:92
hlt::HLTState state_
Definition: Path.h:95
Path(ActionTable const &, ActivityRegistry const &, PathContext const &, std::vector< WorkerInPath > &&, HLTGlobalStatus *, GlobalTaskGroup &) noexcept
Definition: Path.cc:32
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
std::string const & name() const
Definition: Path.cc:69
HLTState
Definition: HLTenums.h:6
ActionTable const & actionTable_
Definition: Path.h:82
void process(Transition, Principal &)
Definition: Path.cc:111
std::size_t timesRun() const
Definition: Path.cc:75
std::size_t timesExcept_
Definition: Path.h:99
std::size_t timesFailed() const
Definition: Path.cc:87
std::size_t timesFailed_
Definition: Path.h:98
Transition
Definition: Transition.h:7
ScheduleID scheduleID() const
Definition: Path.cc:51
PathSpec const & pathSpec() const
Definition: Path.cc:57
void clearCounters()
void process_event_idx_asynch(size_t idx, size_t max_idx, EventPrincipal &, hep::concurrency::WaitingTaskPtr pathsDone)
Definition: Path.cc:232
size_t const pathPosition_
Definition: Path.h:85
ActivityRegistry const & actReg_
Definition: Path.h:83
cet::exempt_ptr< HLTGlobalStatus > trptr_
Definition: Path.h:90
void process_event_idx(size_t const idx, size_t const max_idx, EventPrincipal &, hep::concurrency::WaitingTaskPtr pathsDone)
Definition: Path.cc:332
void process_event_pathFinished(size_t const idx, bool should_continue, hep::concurrency::WaitingTaskPtr pathsDone)
Definition: Path.cc:374
std::vector< WorkerInPath > workers_
Definition: Path.h:87
std::size_t timesExcept() const
Definition: Path.cc:93
std::size_t timesRun_
Definition: Path.h:96
Definition: Path.h:31
hlt::HLTState state() const
Definition: Path.cc:99
Definition: MVAAlg.h:12
std::vector< WorkerInPath > const & workersInPath() const
Definition: Path.cc:105
std::size_t timesPassed_
Definition: Path.h:97
PathContext const pc_
Definition: Path.h:84
PathID pathID() const
Definition: Path.cc:63
void runWorkerTask(size_t idx, size_t max_idx, EventPrincipal &, hep::concurrency::WaitingTaskPtr pathsDone)
Definition: Path.cc:210
std::size_t timesPassed() const
Definition: Path.cc:81