1 #ifndef FWCore_Framework_Worker_h
2 #define FWCore_Framework_Worker_h
32 #include "boost/shared_ptr.hpp"
33 #include "boost/utility.hpp"
40 class Worker :
private boost::noncopyable {
113 unsigned int iNumberOfChildren) = 0;
131 template <
typename T>
132 class ModuleSignalSentry {
135 if(a_) T::preModuleSignal(a_, md_);
137 ~ModuleSignalSentry() {
138 if(a_) T::postModuleSignal(a_, md_);
145 template <
typename T>
149 iEx << iMD.moduleName() <<
"/" << iMD.moduleLabel()
150 <<
" " << ip.id() <<
"\n";
155 template <
typename T>
172 case Pass:
return true;
173 case Fail:
return false;
179 LogWarning(
"repeat") <<
"A module has been invoked a second "
180 <<
"time even though it caught an "
181 <<
"exception during the previous "
183 <<
"This may be an indication of a "
184 <<
"configuration problem.\n";
194 ModuleSignalSentry<T> cpp(
actReg_.get(),
md_);
233 <<
"Module ignored an exception\n"
241 <<
"Module failed due to an exception\n"
262 e <<
"cms::Exception going through module ";
263 exceptionContext(
md_, ep, e);
275 catch(std::bad_alloc& bda) {
280 <<
"A std::bad_alloc exception occurred during a call to the module ";
282 <<
"The job has probably exhausted the virtual memory available to the process.\n";
290 <<
"A std::exception occurred during a call to the module ";
292 <<
"Previous information:\n" << e.what();
295 catch(std::string&
s) {
300 <<
"A std::string thrown as an exception occurred during a call to the module ";
302 <<
"Previous information:\n string = " <<
s;
305 catch(
char const*
c) {
310 <<
"A const char* thrown as an exception occurred during a call to the module ";
312 <<
"Previous information:\n const char* = " << c <<
"\n";
320 <<
"An unknown occurred during a previous call to the module ";
virtual char const * what() const
ModuleDescription const & description() const
bool isEndPath() const
Return true if the path is an end path, and false otherwise.
virtual void implPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)=0
std::string rootCause() const
virtual void implRespondToOpenOutputFiles(FileBlock const &fb)=0
boost::shared_ptr< ActivityRegistry > actReg_
void setActivityRegistry(boost::shared_ptr< ActivityRegistry > areg)
virtual void implRespondToCloseInputFile(FileBlock const &fb)=0
void respondToOpenOutputFiles(FileBlock const &fb)
virtual void implPreForkReleaseResources()=0
virtual std::string workerType() const =0
virtual bool implDoEnd(EventPrincipal &, EventSetup const &c, CurrentProcessingContext const *cpc)=0
std::pair< double, double > timeCpuReal() const
bool isUnscheduled() const
Returns true if the module is being called via unscheduled execution.
virtual bool implDoBegin(EventPrincipal &, EventSetup const &c, CurrentProcessingContext const *cpc)=0
boost::shared_ptr< CPUTimer > StopwatchPointer
virtual void implRespondToCloseOutputFiles(FileBlock const &fb)=0
ModuleDescription const * descPtr() const
virtual void implEndJob()=0
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
void respondToCloseOutputFiles(FileBlock const &fb)
virtual void implBeginJob()=0
void respondToOpenInputFile(FileBlock const &fb)
ActionTable const * actions_
void respondToCloseInputFile(FileBlock const &fb)
Worker(ModuleDescription const &iMD, WorkerParams const &iWP)
void preForkReleaseResources()
boost::shared_ptr< edm::Exception > cached_exception_
RunStopwatch::StopwatchPointer stopwatch_
actions::ActionCodes find(const std::string &category) const
bool doWork(typename T::MyPrincipal &, EventSetup const &c, CurrentProcessingContext const *cpc, CPUTimer *const timer)
virtual void implRespondToOpenInputFile(FileBlock const &fb)=0