|
|
#include <Path.h>
|
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 &) |
|
void | processOneOccurrenceAsync (WaitingTask *, EventPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID const &, StreamContext const *) |
|
template<typename T > |
void | runAllModulesAsync (WaitingTask *, typename T::MyPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID const &, typename T::Context const *) |
|
void | setEarlyDeleteHelpers (std::map< const Worker *, EarlyDeleteHelper * > const &) |
|
void | setPathStatusInserter (PathStatusInserter *pathStatusInserter, Worker *pathStatusInserterWorker) |
|
size_type | size () 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 |
|
|
void | finished (std::exception_ptr, StreamContext const *, EventPrincipal const &iEP, EventSetupImpl const &iES, StreamID const &streamID) |
|
bool | handleWorkerFailure (cms::Exception &e, int nwrwue, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id) const |
|
Path const & | operator= (Path const &)=delete |
|
void | recordStatus (int nwrwue, hlt::HLTState state) |
|
void | runNextWorkerAsync (unsigned int iNextModuleIndex, EventPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID const &, StreamContext const *) |
|
void | threadsafe_setFailedModuleInfo (int nwrwue, std::exception_ptr) |
|
void | updateCounters (hlt::HLTState state) |
|
void | workerFinished (std::exception_ptr const *iException, unsigned int iModuleIndex, EventPrincipal const &iEP, EventSetupImpl const &iES, ServiceToken const &iToken, StreamID const &iID, StreamContext const *iContext) |
|
Definition at line 44 of file Path.h.
◆ size_type
◆ State
◆ TrigResPtr
◆ WorkersInPath
◆ Path() [1/2]
◆ Path() [2/2]
edm::Path::Path |
( |
Path const & |
r | ) |
|
◆ bitPosition()
int edm::Path::bitPosition |
( |
| ) |
const |
|
inline |
◆ clearCounters()
void edm::Path::clearCounters |
( |
| ) |
|
◆ exceptionContext()
◆ finished()
Definition at line 316 of file Path.cc.
330 std::exception_ptr jException =
332 iEP, iES, streamID, ParentContext(iContext), iContext);
333 if (jException && not iException) {
334 iException = jException;
338 if (not iException) {
339 iException = std::current_exception();
References actReg_, CMS_SA_ALLOW, edm::WaitingTaskList::doneWaiting(), failedModuleIndex_, pathContext_, pathStatusInserter_, pathStatusInserterWorker_, recordStatus(), edm::Worker::runModuleDirectly(), edm::PathStatusInserter::setPathStatus(), state_, mps_update::status, updateCounters(), and waitingTasks_.
Referenced by processOneOccurrenceAsync(), and workerFinished().
◆ getWorker()
◆ handleWorkerFailure()
Definition at line 68 of file Path.cc.
75 if (
e.context().empty()) {
78 bool should_continue =
true;
87 should_continue =
false;
101 if (
e.category() == pNF) {
102 std::ostringstream ost;
103 ost <<
"If you wish to continue processing events after a " << pNF <<
" exception,\n"
104 <<
"add \"SkipEvent = cms.untracked.vstring('ProductNotFound')\" to the \"options\" PSet in the "
106 e.addAdditionalInfo(ost.str());
114 return should_continue;
References act_table_, writedatasetfile::action, begin, edm::Exception::codeToString(), MillePedeFileConverter_cfg::e, exceptionContext(), edm::exception_actions::FailPath, edm::ExceptionToActionTable::find(), pathContext_, edm::printCmsExceptionWarning(), edm::errors::ProductNotFound, edm::exception_actions::Rethrow, edm::exception_actions::SkipEvent, stopProcessingEvent_, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by workerFinished().
◆ name()
std::string const& edm::Path::name |
( |
void |
| ) |
const |
|
inline |
◆ operator=()
Path const& edm::Path::operator= |
( |
Path const & |
| ) |
|
|
privatedelete |
◆ processOneOccurrenceAsync()
Definition at line 216 of file Path.cc.
236 finished(std::exception_ptr(), iStreamContext, iEP, iES, iStreamID);
References actReg_, edm::WaitingTaskList::add(), failedModuleIndex_, finished(), modulesToRun_, edm::hlt::Pass, pathContext_, edm::WaitingTaskList::reset(), runNextWorkerAsync(), state_, timesRun_, waitingTasks_, and workers_.
◆ recordStatus()
◆ runAllModulesAsync()
◆ runNextWorkerAsync()
Definition at line 345 of file Path.cc.
352 const int firstModuleIndex = iNextModuleIndex;
353 int lastModuleIndex = firstModuleIndex;
354 while (lastModuleIndex + 1 != static_cast<int>(
workers_.size()) and
workers_[lastModuleIndex].runConcurrently()) {
357 for (; lastModuleIndex >= firstModuleIndex; --lastModuleIndex) {
359 tbb::task::allocate_root(),
360 [
this, lastModuleIndex, &iEP, &iES, iID, iContext,
token = iToken](std::exception_ptr
const* iException) {
363 workers_[lastModuleIndex].runWorkerAsync<OccurrenceTraits<EventPrincipal, BranchActionStreamBegin>>(
364 nextTask, iEP, iES, iToken, iID, iContext);
References edm::make_waiting_task(), unpackBuffers-CaloStage2::token, workerFinished(), and workers_.
Referenced by processOneOccurrenceAsync(), and workerFinished().
◆ setEarlyDeleteHelpers()
◆ setPathStatusInserter()
◆ size()
◆ threadsafe_setFailedModuleInfo()
void edm::Path::threadsafe_setFailedModuleInfo |
( |
int |
nwrwue, |
|
|
std::exception_ptr |
iExcept |
|
) |
| |
|
private |
◆ timesExcept() [1/2]
int edm::Path::timesExcept |
( |
| ) |
const |
|
inline |
◆ timesExcept() [2/2]
int edm::Path::timesExcept |
( |
size_type |
i | ) |
const |
|
inline |
◆ timesFailed() [1/2]
int edm::Path::timesFailed |
( |
| ) |
const |
|
inline |
◆ timesFailed() [2/2]
int edm::Path::timesFailed |
( |
size_type |
i | ) |
const |
|
inline |
◆ timesPassed() [1/2]
int edm::Path::timesPassed |
( |
| ) |
const |
|
inline |
◆ timesPassed() [2/2]
int edm::Path::timesPassed |
( |
size_type |
i | ) |
const |
|
inline |
◆ timesRun()
int edm::Path::timesRun |
( |
| ) |
const |
|
inline |
◆ timesVisited()
int edm::Path::timesVisited |
( |
size_type |
i | ) |
const |
|
inline |
◆ updateCounters()
◆ workerFinished()
Definition at line 243 of file Path.cc.
254 auto& worker =
workers_[iModuleIndex];
255 bool shouldContinue = worker.checkResultsOfRunWorker(
true);
256 std::exception_ptr finalException;
258 std::unique_ptr<cms::Exception> pEx;
260 std::rethrow_exception(*iException);
262 pEx = std::unique_ptr<cms::Exception>(oldEx.
clone());
266 std::ostringstream ost;
273 worker.getWorker()->description(),
276 worker.skipWorker(iEP);
277 finalException = std::exception_ptr();
279 shouldContinue =
false;
280 finalException = std::current_exception();
289 shouldContinue =
false;
291 auto const nextIndex = iModuleIndex + 1;
292 if (shouldContinue and nextIndex <
workers_.size()) {
293 if (not worker.runConcurrently()) {
300 if (not shouldContinue) {
303 if (not shouldContinue and not worker.runConcurrently()) {
305 for (
auto it =
workers_.begin() + nextIndex, itEnd =
workers_.end(); it != itEnd; ++it) {
312 finished(finalException, iContext, iEP, iES, iID);
References cms::Exception::clone(), CMS_SA_ALLOW, finished(), handleWorkerFailure(), edm::EventPrincipal::id(), edm::InEvent, modulesToRun_, edm::WaitingTaskList::presetTaskAsFailed(), runNextWorkerAsync(), stopProcessingEvent_, threadsafe_setFailedModuleInfo(), waitingTasks_, and workers_.
Referenced by runNextWorkerAsync().
◆ act_table_
◆ actReg_
◆ bitpos_
const int edm::Path::bitpos_ |
|
private |
◆ failedModuleIndex_
int edm::Path::failedModuleIndex_ |
|
private |
◆ modulesToRun_
std::atomic<unsigned int> edm::Path::modulesToRun_ |
|
private |
◆ pathContext_
◆ pathStatusInserter_
◆ pathStatusInserterWorker_
Worker* edm::Path::pathStatusInserterWorker_ |
|
private |
◆ state_
◆ stateLock_
std::atomic<bool> edm::Path::stateLock_ = false |
|
private |
◆ stopProcessingEvent_
std::atomic<bool>* const edm::Path::stopProcessingEvent_ |
|
private |
◆ timesExcept_
int edm::Path::timesExcept_ |
|
private |
◆ timesFailed_
int edm::Path::timesFailed_ |
|
private |
◆ timesPassed_
int edm::Path::timesPassed_ |
|
private |
◆ timesRun_
◆ trptr_
◆ waitingTasks_
◆ workers_
Definition at line 123 of file Path.h.
Referenced by clearCounters(), getWorker(), Path(), processOneOccurrenceAsync(), runAllModulesAsync(), runNextWorkerAsync(), size(), timesExcept(), timesFailed(), timesPassed(), timesVisited(), and workerFinished().
Worker * pathStatusInserterWorker_
PathStatusInserter * pathStatusInserter_
Worker const * getWorker(size_type i) const
void addContext(std::string const &context)
std::atomic< bool > stateLock_
void threadsafe_setFailedModuleInfo(int nwrwue, std::exception_ptr)
WaitingTaskList waitingTasks_
std::atomic< unsigned int > modulesToRun_
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
void add(WaitingTask *)
Adds task to the waiting list.
void finished(std::exception_ptr, StreamContext const *, EventPrincipal const &iEP, EventSetupImpl const &iES, StreamID const &streamID)
void reset()
Resets access to the resource so that added tasks will wait.
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
void presetTaskAsFailed(std::exception_ptr iExcept)
std::atomic< bool > *const stopProcessingEvent_
void updateCounters(hlt::HLTState state)
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
void setPathStatus(StreamID const &, HLTPathStatus const &)
ExceptionToActionTable const *const act_table_
static void exceptionContext(cms::Exception &ex, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id, PathContext const &)
const std::shared_ptr< ActivityRegistry > actReg_
std::string const & pathName() const
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
virtual Exception * clone() const
exception_actions::ActionCodes find(const std::string &category) const
roAction_t actions[nactions]
std::exception_ptr runModuleDirectly(typename T::MyPrincipal const &ep, EventSetupImpl const &es, StreamID streamID, ParentContext const &parentContext, typename T::Context const *context)
bool handleWorkerFailure(cms::Exception &e, int nwrwue, bool isEvent, bool begin, BranchType branchType, ModuleDescription const &, std::string const &id) const
void recordStatus(int nwrwue, hlt::HLTState state)
void workerFinished(std::exception_ptr const *iException, unsigned int iModuleIndex, EventPrincipal const &iEP, EventSetupImpl const &iES, ServiceToken const &iToken, StreamID const &iID, StreamContext const *iContext)
void runNextWorkerAsync(unsigned int iNextModuleIndex, EventPrincipal const &, EventSetupImpl const &, ServiceToken const &, StreamID const &, StreamContext const *)