19 std::shared_ptr<ActivityRegistry> areg,
21 std::atomic<bool>* stopProcessingEvent,
33 pathContext_(path_name, streamContext, bitpos, pathType),
34 stopProcessingEvent_(stopProcessingEvent),
36 pathStatusInserterWorker_(
nullptr) {
38 for (
auto& workerInPath :
workers_) {
60 for (
auto& workerInPath :
workers_) {
77 bool should_continue =
true;
86 should_continue =
false;
103 std::ostringstream ost;
104 ost <<
"If you wish to continue processing events after a " << pNF <<
" exception,\n" <<
105 "add \"SkipEvent = cms.untracked.vstring('ProductNotFound')\" to the \"options\" PSet in the configuration.\n";
114 return should_continue;
125 std::ostringstream ost;
126 ost <<
"Running path '" << pathContext.
pathName() <<
"'";
129 ost <<
"Processing ";
132 if (begin && branchType ==
InRun) {
133 ost <<
"stream begin Run";
135 else if (begin && branchType ==
InLumi) {
136 ost <<
"stream begin LuminosityBlock ";
138 else if (!begin && branchType ==
InLumi) {
139 ost <<
"stream end LuminosityBlock ";
141 else if (!begin && branchType ==
InRun) {
142 ost <<
"stream end Run ";
172 using std::placeholders::_1;
181 std::vector<EarlyDeleteHelper*>
temp;
182 temp.reserve(iWorkerToDeleter.size());
185 if(
found != iWorkerToDeleter.end()) {
186 temp.push_back(
found->second);
187 found->second->addedToPath();
190 std::vector<EarlyDeleteHelper*> tempCorrectSize(temp.begin(),temp.end());
196 Worker* pathStatusInserterWorker) {
204 helper->pathFinished(iEvent);
223 finished(-1,
true, std::exception_ptr(), iStreamContext, iEP, iES, iStreamID);
232 unsigned int iModuleIndex,
238 auto& worker =
workers_[iModuleIndex];
239 bool shouldContinue = worker.checkResultsOfRunWorker(
true);
240 std::exception_ptr finalException;
242 std::unique_ptr<cms::Exception> pEx;
244 std::rethrow_exception(*iException);
246 pEx = std::unique_ptr<cms::Exception>(oldEx.
clone());
249 std::ostringstream ost;
252 worker.getWorker()->description(), ost.str());
254 worker.skipWorker(iEP);
255 finalException = std::exception_ptr();
257 shouldContinue =
false;
258 finalException = std::current_exception();
262 shouldContinue =
false;
264 auto const nextIndex = iModuleIndex +1;
265 if (shouldContinue and nextIndex <
workers_.size()) {
270 if (not shouldContinue) {
278 finished(iModuleIndex, shouldContinue, finalException, iContext, iEP, iES, iID);
297 std::exception_ptr jException =
302 if(jException && not iException) {
303 iException = jException;
308 iException = std::current_exception();
323 [
this, iNextModuleIndex, &iEP,&iES, iID, iContext, token](std::exception_ptr
const* iException)
326 this->
workerFinished(iException, iNextModuleIndex, iEP,iES,iID,iContext);
329 workers_[iNextModuleIndex].runWorkerAsync<
std::string const & pathName() const
void recordStatus(int nwrwue, bool isEvent)
void handleEarlyFinish(EventPrincipal const &)
roAction_t actions[nactions]
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
std::vector< EarlyDeleteHelper * > earlyDeleteHelpers_
std::vector< WorkerInPath > WorkersInPath
void add(WaitingTask *)
Adds task to the waiting list.
EventID const & id() const
void setPathStatus(StreamID const &, HLTPathStatus const &)
std::string const & category() const
exception_actions::ActionCodes find(const std::string &category) const
void runNextWorkerAsync(unsigned int iNextModuleIndex, EventPrincipal const &, EventSetup const &, StreamID const &, StreamContext const *)
WaitingTaskList waitingTasks_
void reset()
Resets access to the resource so that added tasks will wait.
ServiceToken presentToken() const
std::exception_ptr runModuleDirectly(typename T::MyPrincipal const &ep, EventSetup const &es, StreamID streamID, ParentContext const &parentContext, typename T::Context const *context)
void setPathStatusInserter(PathStatusInserter *pathStatusInserter, Worker *pathStatusInserterWorker)
std::shared_ptr< ActivityRegistry > actReg_
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
void workerFinished(std::exception_ptr const *iException, unsigned int iModuleIndex, EventPrincipal const &iEP, EventSetup const &iES, StreamID const &iID, StreamContext const *iContext)
std::shared_ptr< HLTGlobalStatus > TrigResPtr
void processOneOccurrenceAsync(WaitingTask *, EventPrincipal const &, EventSetup const &, StreamID const &, StreamContext const *)
std::list< std::string > const & context() const
static ServiceRegistry & instance()
void addAdditionalInfo(std::string const &info)
static void exceptionContext(cms::Exception &ex, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id, PathContext const &)
void finished(int iModuleIndex, bool iSucceeded, std::exception_ptr, StreamContext const *, EventPrincipal const &iEP, EventSetup const &iES, StreamID const &streamID)
void updateCounters(bool succeed, bool isEvent)
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)
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
void addContext(std::string const &context)
bool handleWorkerFailure(cms::Exception &e, int nwrwue, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id)
void setEarlyDeleteHelpers(std::map< const Worker *, EarlyDeleteHelper * > const &)
ExceptionToActionTable const * act_table_
Worker const * getWorker(size_type i) const
std::atomic< bool > * stopProcessingEvent_
def branchType(schema, name)
Worker * pathStatusInserterWorker_
virtual Exception * clone() const
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
PathStatusInserter * pathStatusInserter_