#include <EPStates.h>
Public Types | |
typedef sc::transition< File, NewInputAndOutputFiles > | reactions |
Public Member Functions | |
void | beginRun (Run const &run) |
bool | beginRunCalled () const |
void | beginRunIfNotDoneAlready () |
Run const & | currentRun () const |
void | endRun (Run const &run) |
void | exit () |
void | finalizeRun (Run const &) |
void | finalizeRun () |
HandleRuns (my_context ctx) | |
bool | runException () const |
void | setupCurrentRun () |
~HandleRuns () | |
Private Attributes | |
bool | beginRunCalled_ |
Run | currentRun_ |
edm::IEventProcessor & | ep_ |
bool | exitCalled_ |
bool | runException_ |
Definition at line 233 of file EPStates.h.
typedef sc::transition<File, NewInputAndOutputFiles> statemachine::HandleRuns::reactions |
Definition at line 240 of file EPStates.h.
statemachine::HandleRuns::HandleRuns | ( | my_context | ctx | ) |
Definition at line 209 of file EPStates.cc.
: my_base(ctx), ep_(context<Machine>().ep()), exitCalled_(false), beginRunCalled_(false), currentRun_(INVALID_RUN), runException_(false) { }
statemachine::HandleRuns::~HandleRuns | ( | ) |
Definition at line 223 of file EPStates.cc.
References ExpressReco_HICollisions_FallBack::e, ep_, exception, exitCalled_, cms::Exception::explainSelf(), finalizeRun(), argparse::message, runTheMatrix::msg, and edm::IEventProcessor::setExceptionMessageRuns().
{ if (!exitCalled_) { try { finalizeRun(); } catch (cms::Exception& e) { std::ostringstream message; message << "------------------------------------------------------------\n" << "Another exception was caught while trying to clean up runs after\n" << "the primary exception. We give up trying to clean up runs at\n" << "this point. The description of this additional exception follows:\n" << "cms::Exception\n" << e.explainSelf(); std::string msg(message.str()); ep_.setExceptionMessageRuns(msg); } catch (std::bad_alloc& e) { std::ostringstream message; message << "------------------------------------------------------------\n" << "Another exception was caught while trying to clean up runs\n" << "after the primary exception. We give up trying to clean up runs\n" << "at this point. This additional exception was a\n" << "std::bad_alloc exception thrown inside HandleRuns::finalizeRun.\n" << "The job has probably exhausted the virtual memory available\n" << "to the process.\n"; std::string msg(message.str()); ep_.setExceptionMessageRuns(msg); } catch (std::exception& e) { std::ostringstream message; message << "------------------------------------------------------------\n" << "Another exception was caught while trying to clean up runs after\n" << "the primary exception. We give up trying to clean up runs at\n" << "this point. This additional exception was a\n" << "standard library exception thrown inside HandleRuns::finalizeRun\n" << e.what() << "\n"; std::string msg(message.str()); ep_.setExceptionMessageRuns(msg); } catch (...) { std::ostringstream message; message << "------------------------------------------------------------\n" << "Another exception was caught while trying to clean up runs after\n" << "the primary exception. We give up trying to clean up runs at\n" << "this point. This additional exception was of unknown type and\n" << "thrown inside HandleRuns::finalizeRun\n"; std::string msg(message.str()); ep_.setExceptionMessageRuns(msg); } } }
void statemachine::HandleRuns::beginRun | ( | Run const & | run | ) |
Definition at line 290 of file EPStates.cc.
References edm::IEventProcessor::beginRun(), beginRunCalled_, ep_, and runException_.
Referenced by beginRunIfNotDoneAlready(), and setupCurrentRun().
{ beginRunCalled_ = true; runException_ = true; ep_.beginRun(run); runException_ = false; }
bool statemachine::HandleRuns::beginRunCalled | ( | ) | const |
void statemachine::HandleRuns::beginRunIfNotDoneAlready | ( | ) |
Definition at line 322 of file EPStates.cc.
References beginRun(), beginRunCalled_, and currentRun().
{ if (!beginRunCalled_) beginRun(currentRun()); }
Run const & statemachine::HandleRuns::currentRun | ( | ) | const |
Definition at line 276 of file EPStates.cc.
References currentRun_.
Referenced by beginRunIfNotDoneAlready(), finalizeRun(), and setupCurrentRun().
{ return currentRun_; }
void statemachine::HandleRuns::endRun | ( | Run const & | run | ) |
Definition at line 298 of file EPStates.cc.
References beginRunCalled_, edm::IEventProcessor::endRun(), ep_, and runException_.
Referenced by finalizeRun().
{ beginRunCalled_ = false; runException_ = true; ep_.endRun(run); runException_ = false; }
void statemachine::HandleRuns::exit | ( | ) |
Definition at line 217 of file EPStates.cc.
References edm::IEventProcessor::alreadyHandlingException(), ep_, exitCalled_, and finalizeRun().
{ if (ep_.alreadyHandlingException()) return; exitCalled_ = true; finalizeRun(); }
void statemachine::HandleRuns::finalizeRun | ( | ) |
Definition at line 310 of file EPStates.cc.
References beginRunCalled_, currentRun(), currentRun_, edm::IEventProcessor::deleteRunFromCache(), endRun(), ep_, runException_, and edm::IEventProcessor::writeRun().
Referenced by exit(), finalizeRun(), statemachine::HandleNewInputFile2::react(), statemachine::ContinueRun1::react(), and ~HandleRuns().
{ if (runException_) return; runException_ = true; if (beginRunCalled_) endRun(currentRun()); ep_.writeRun(currentRun_); ep_.deleteRunFromCache(currentRun_); currentRun_ = INVALID_RUN; runException_ = false; }
void statemachine::HandleRuns::finalizeRun | ( | Run const & | ) |
bool statemachine::HandleRuns::runException | ( | ) | const |
void statemachine::HandleRuns::setupCurrentRun | ( | ) |
Definition at line 279 of file EPStates.cc.
References beginRun(), currentRun(), currentRun_, statemachine::doNotHandleEmptyRunsAndLumis, ep_, edm::IEventProcessor::readAndCacheRun(), and runException_.
{ runException_ = true; currentRun_ = ep_.readAndCacheRun(); runException_ = false; if (context<Machine>().emptyRunLumiMode() != doNotHandleEmptyRunsAndLumis) { beginRun(currentRun()); } }
bool statemachine::HandleRuns::beginRunCalled_ [private] |
Definition at line 254 of file EPStates.h.
Referenced by beginRun(), beginRunCalled(), beginRunIfNotDoneAlready(), endRun(), and finalizeRun().
Run statemachine::HandleRuns::currentRun_ [private] |
Definition at line 255 of file EPStates.h.
Referenced by currentRun(), finalizeRun(), and setupCurrentRun().
Definition at line 252 of file EPStates.h.
Referenced by beginRun(), endRun(), exit(), finalizeRun(), setupCurrentRun(), and ~HandleRuns().
bool statemachine::HandleRuns::exitCalled_ [private] |
Definition at line 253 of file EPStates.h.
Referenced by exit(), and ~HandleRuns().
bool statemachine::HandleRuns::runException_ [private] |
Definition at line 256 of file EPStates.h.
Referenced by beginRun(), endRun(), finalizeRun(), runException(), and setupCurrentRun().