15 #include "cetlib_except/exception.h" 16 #include "hep_concurrency/SerialTaskQueueChain.h" 17 #include "hep_concurrency/WaitingTask.h" 18 #include "hep_concurrency/WaitingTaskList.h" 44 result << brief_context(md) <<
' ';
48 result << principal.
runID();
62 rethrow_with_context(std::exception_ptr eptr,
69 brief_context(md) +
" during " + transition;
71 std::rethrow_exception(eptr);
75 "An exception was thrown while processing module " +
84 "A string exception was thrown while processing module " +
88 catch (
char const*
c) {
91 "A char const* exception was thrown while processing module " +
97 <<
"An unknown exception was thrown while processing module " +
136 SerialTaskQueueChain*
151 <<
hex <<
this <<
dec <<
" Resetting waitingTasks_";
199 rethrow_with_context(std::current_exception(),
md_,
"beginJob");
209 rethrow_with_context(std::current_exception(),
md_,
"endJob");
260 mf::LogWarning(
"repeat") <<
"A module has been invoked a second time " 261 "even though it caught an exception during " 262 "the previous invocation.\nThis may be an " 263 "indication of a configuration problem.\n";
275 <<
"A Module has been invoked while it is still being executed.\n" 276 <<
"Product dependencies have invoked a module execution cycle.\n";
281 rc =
implDoBegin(dynamic_cast<RunPrincipal&>(principal), mc);
285 rc =
implDoEnd(dynamic_cast<RunPrincipal&>(principal), mc);
289 rc =
implDoBegin(dynamic_cast<SubRunPrincipal&>(principal), mc);
293 rc =
implDoEnd(dynamic_cast<SubRunPrincipal&>(principal), mc);
300 e <<
"The above exception was thrown while processing module " 301 << brief_context(
md_, principal) <<
'\n';
302 if (
auto edmEx = dynamic_cast<art::Exception*>(&e)) {
310 catch (std::bad_alloc
const& bda) {
314 <<
"A bad_alloc exception occurred during a call to the module " 315 << brief_context(
md_, principal) <<
'\n' 316 <<
"The job has probably exhausted the virtual memory available to the " 324 <<
"An exception occurred during a call to the module " 325 << brief_context(
md_, principal) << e.what();
332 <<
"A string thrown as an exception occurred during a call " 334 << brief_context(
md_, principal) <<
'\n' 339 catch (
char const*
c) {
342 <<
"A char const* thrown as an exception occurred during a " 343 "call to the module " 344 << brief_context(
md_, principal) <<
'\n' 353 <<
"An unknown occurred during a previous call to the module " 354 << brief_context(
md_, principal) <<
'\n';
378 assert(not mc.onEndPath());
383 mf::LogWarning(
"IgnoreCompletely") <<
"Module ignored an exception\n" 390 mf::LogWarning(
"FailModule") <<
"Module failed due to an exception\n" 396 e <<
"The above exception was thrown while processing module " 397 << brief_context(
md_,
p) <<
'\n';
398 if (
auto edmEx = dynamic_cast<Exception*>(&e)) {
407 catch (bad_alloc
const& bda) {
412 <<
"A bad_alloc exception occurred during a call to the module " 413 << brief_context(
md_,
p) <<
'\n' 414 <<
"The job has probably exhausted the virtual memory available to the " 423 <<
"An exception occurred during a call to the module " 424 << brief_context(
md_,
p) <<
'\n' 429 catch (
string const& s) {
433 <<
"A string thrown as an exception occurred during a call " 435 << brief_context(
md_,
p) <<
'\n' 440 catch (
char const*
c) {
444 <<
"A char const* thrown as an exception occurred during a " 445 "call to the module " 446 << brief_context(
md_,
p) <<
'\n' 455 <<
"An unknown occurred during a previous call to the module " 456 << brief_context(
md_,
p) <<
'\n';
493 mf::LogWarning(
"IgnoreCompletely") <<
"Module ignored an exception\n" 500 mf::LogWarning(
"FailModule") <<
"Module failed due to an exception\n" 506 e <<
"The above exception was thrown while processing module " 507 << brief_context(
md_, p);
508 if (
auto art_ex = dynamic_cast<Exception*>(&e)) {
519 catch (bad_alloc
const& bda) {
524 <<
"A bad_alloc exception was thrown while processing module " 525 << brief_context(
md_, p) <<
'\n' 526 <<
"The job has probably exhausted the virtual memory available to the " 537 <<
"An exception was thrown while processing module " 538 << brief_context(
md_, p) <<
'\n' 545 catch (
string const& s) {
550 <<
"A string was thrown as an exception while processing module " 551 << brief_context(
md_, p) <<
'\n' 558 catch (
char const* c) {
563 <<
"A char const* was thrown as an exception while processing module " 564 << brief_context(
md_, p) <<
'\n' 576 <<
"An unknown exception was thrown while processing module " 577 << brief_context(
md_, p) <<
'\n';
607 if (
workStarted_.compare_exchange_strong(expected,
true)) {
611 chain->push([&p, &mc,
this] {
runWorker(p, mc); });
#define TDEBUG_BEGIN_TASK_SI(LEVEL, SI)
EventID const & eventID() const
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleContext const &)> sPreModuleBeginRun
std::size_t timesExcept() const
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleContext const &)> sPreModuleEndRun
virtual void implBeginJob(detail::SharedResources const &resources)=0
RunID const & runID() const
void respondToOpenOutputFiles(FileBlock const &fb)
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleDescription const &)> sPostModuleBeginJob
void respondToCloseOutputFiles(FileBlock const &fb)
actions::ActionCodes find(std::string const &category) const
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleDescription const &)> sPostModuleRespondToCloseOutputFiles
#define TDEBUG_END_TASK_SI(LEVEL, SI)
std::size_t timesPassed() const
bool doWork(Transition, Principal &, ModuleContext const &)
std::string const & moduleLabel() const
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleDescription const &)> sPostModuleRespondToCloseInputFile
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleContext const &)> sPreModule
std::string const & label() const
virtual hep::concurrency::SerialTaskQueueChain * implSerialTaskQueueChain() const =0
QTextStream & hex(QTextStream &s)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
ActionTable const & actions_
std::size_t timesRun() const
std::atomic< std::size_t > counts_visited_
virtual void implRespondToOpenInputFile(FileBlock const &fb)=0
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleContext const &)> sPostModuleEndRun
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleContext const &)> sPreModuleEndSubRun
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleDescription const &)> sPreModuleBeginJob
std::atomic< int > state_
std::size_t timesVisited() const
virtual void implRespondToCloseOutputFiles(FileBlock const &fb)=0
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleDescription const &)> sPreModuleRespondToOpenInputFile
virtual bool implDoEnd(RunPrincipal &rp, ModuleContext const &mc)=0
std::string const & moduleName() const
ActivityRegistry const & actReg_
void runWorker(EventPrincipal &, ModuleContext const &)
SubRunID subRunID() const
ModuleDescription const md_
virtual bool implDoProcess(EventPrincipal &, ModuleContext const &)=0
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleContext const &)> sPostModuleBeginRun
#define TDEBUG_FUNC_SI(LEVEL, SI)
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleDescription const &)> sPostModuleRespondToOpenInputFile
ScheduleID const scheduleID_
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleDescription const &)> sPreModuleEndJob
QTextStream & dec(QTextStream &s)
void respondToOpenInputFile(FileBlock const &fb)
std::atomic< bool > returnCode_
std::atomic< std::size_t > counts_run_
ModuleDescription const & description() const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
#define TDEBUG_END_FUNC_SI(LEVEL, SI)
virtual void implRespondToCloseInputFile(FileBlock const &fb)=0
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleContext const &)> sPostModule
std::atomic< std::size_t > counts_thrown_
std::atomic< std::size_t > counts_passed_
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleDescription const &)> sPreModuleRespondToOpenOutputFiles
std::atomic< std::size_t > counts_failed_
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
virtual void implEndJob()=0
#define TDEBUG_BEGIN_FUNC_SI(LEVEL, SI)
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleDescription const &)> sPostModuleEndJob
void respondToCloseInputFile(FileBlock const &fb)
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleContext const &)> sPostModuleEndSubRun
void beginJob(detail::SharedResources const &)
virtual bool implDoBegin(RunPrincipal &rp, ModuleContext const &mc)=0
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleContext const &)> sPostModuleBeginSubRun
hep::concurrency::SerialTaskQueueChain * serialTaskQueueChain() const
std::exception_ptr cached_exception_
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleContext const &)> sPreModuleBeginSubRun
hep::concurrency::WaitingTaskList waitingTasks_
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleDescription const &)> sPreModuleRespondToCloseOutputFiles
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleDescription const &)> sPostModuleRespondToOpenOutputFiles
void doWork_event(hep::concurrency::WaitingTaskPtr workerInPathDoneTask, EventPrincipal &, ModuleContext const &)
virtual void implRespondToOpenOutputFiles(FileBlock const &fb)=0
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleDescription const &)> sPreModuleRespondToCloseInputFile
cet::coded_exception< error, detail::translate > exception
BranchType branchType() const
std::atomic< bool > workStarted_
std::size_t timesFailed() const