9 class ModuleBeginJobSignalSentry {
11 ModuleBeginJobSignalSentry(
ActivityRegistry*
a, ModuleDescription& md):a_(a), md_(&md) {
12 if(a_) a_->preModuleBeginJobSignal_(*md_);
14 ~ModuleBeginJobSignalSentry() {
15 if(a_) a_->postModuleBeginJobSignal_(*md_);
19 ModuleDescription* md_;
22 class ModuleEndJobSignalSentry {
24 ModuleEndJobSignalSentry(
ActivityRegistry* a, ModuleDescription& md):a_(a), md_(&md) {
25 if(a_) a_->preModuleEndJobSignal_(*md_);
27 ~ModuleEndJobSignalSentry() {
28 if(a_) a_->postModuleEndJobSignal_(*md_);
32 ModuleDescription* md_;
37 iEx << iMD.moduleName() <<
"/" << iMD.moduleLabel() <<
"\n";
53 actions_(iWP.actions_),
69 ModuleBeginJobSignalSentry cpp(
actReg_.get(),
md_);
74 <<
"A cms::Exception is going through " <<
workerType() <<
":\n";
76 e <<
"A cms::Exception is going through " <<
workerType() <<
":\n";
77 exceptionContext(
md_, e);
80 catch(std::bad_alloc& bda) {
82 <<
"A std::bad_alloc is going through " <<
workerType() <<
":\n"
87 <<
"A std::bad_alloc exception occurred during a call to the module ";
89 <<
"The job has probably exhausted the virtual memory available to the process.\n";
94 <<
"A std::exception is going through " <<
workerType() <<
":\n"
99 <<
"A std::exception occurred during a call to the module ";
101 <<
"Previous information:\n" << e.what();
104 catch(std::string&
s) {
106 <<
"module caught a std::string during endJob\n";
110 <<
"A std::string thrown as an exception occurred during a call to the module ";
112 <<
"Previous information:\n string = " <<
s;
115 catch(
char const*
c) {
117 <<
"module caught a const char* during endJob\n";
121 <<
"A const char* thrown as an exception occurred during a call to the module ";
123 <<
"Previous information:\n const char* = " << c <<
"\n";
128 <<
"An unknown Exception occurred in\n" <<
description() <<
"\n";
132 <<
"An unknown occurred during a previous call to the module ";
140 ModuleEndJobSignalSentry cpp(
actReg_.get(),
md_);
145 <<
"A cms::Exception is going through " <<
workerType() <<
":\n";
147 e <<
"A cms::Exception is going through " <<
workerType() <<
":\n";
148 exceptionContext(
md_, e);
151 catch(std::bad_alloc& bda) {
153 <<
"A std::bad_alloc is going through " <<
workerType() <<
":\n"
158 <<
"A std::bad_alloc exception occurred during a call to the module ";
160 <<
"The job has probably exhausted the virtual memory available to the process.\n";
165 <<
"A std::exception is going through " <<
workerType() <<
":\n"
170 <<
"A std::exception occurred during a call to the module ";
172 <<
"Previous information:\n" << e.what();
175 catch(std::string&
s) {
177 <<
"module caught a std::string during endJob\n";
181 <<
"A std::string thrown as an exception occurred during a call to the module ";
183 <<
"Previous information:\n string = " <<
s;
186 catch(
char const*
c) {
188 <<
"module caught a const char* during endJob\n";
192 <<
"A const char* thrown as an exception occurred during a call to the module ";
194 <<
"Previous information:\n const char* = " << c <<
"\n";
199 <<
"An unknown Exception occurred in\n" <<
description() <<
"\n";
203 <<
"An unknown occurred during a previous call to the module ";
211 stopwatch_.reset(
new RunStopwatch::StopwatchPointer::element_type);
ModuleDescription const & description() const
boost::shared_ptr< ActivityRegistry > actReg_
void setActivityRegistry(boost::shared_ptr< ActivityRegistry > areg)
virtual std::string workerType() const =0
virtual void implEndJob()=0
virtual void implBeginJob()=0
Worker(ModuleDescription const &iMD, WorkerParams const &iWP)
boost::shared_ptr< edm::Exception > cached_exception_
RunStopwatch::StopwatchPointer stopwatch_