#include <FWCore/Framework/src/Path.h>
Definition at line 35 of file Path.h.
typedef hlt::HLTState edm::Path::State |
typedef boost::shared_ptr<HLTGlobalStatus> edm::Path::TrigResPtr |
typedef std::vector<WorkerInPath> edm::Path::WorkersInPath |
edm::Path::Path | ( | int | bitpos, | |
std::string const & | path_name, | |||
WorkersInPath const & | workers, | |||
TrigResPtr | trptr, | |||
ParameterSet const & | proc_pset, | |||
ActionTable & | actions, | |||
boost::shared_ptr< ActivityRegistry > | reg, | |||
bool | isEndPath | |||
) |
Definition at line 11 of file Path.cc.
00017 : 00018 stopwatch_(new RunStopwatch::StopwatchPointer::element_type), 00019 timesRun_(), 00020 timesPassed_(), 00021 timesFailed_(), 00022 timesExcept_(), 00023 state_(edm::hlt::Ready), 00024 bitpos_(bitpos), 00025 name_(path_name), 00026 trptr_(trptr), 00027 actReg_(areg), 00028 act_table_(&actions), 00029 workers_(workers), 00030 isEndPath_(isEndPath) 00031 { 00032 }
int edm::Path::bitPosition | ( | ) | const [inline] |
Definition at line 54 of file Path.h.
References bitpos_.
Referenced by edm::fillPathSummary(), and processOneOccurrence().
00054 { return bitpos_; }
void edm::Path::clearCounters | ( | ) |
Definition at line 95 of file Path.cc.
References edm::WorkerInPath::clearCounters(), edm::for_all(), timesExcept_, timesFailed_, timesPassed_, timesRun_, and workers_.
Referenced by edm::Schedule::clearCounters().
00095 { 00096 timesRun_ = timesPassed_ = timesFailed_ = timesExcept_ = 0; 00097 for_all(workers_, boost::bind(&WorkerInPath::clearCounters, _1)); 00098 }
bool edm::Path::handleWorkerFailure | ( | cms::Exception const & | e, | |
int | nwrwue, | |||
bool | isEvent | |||
) | [private] |
Definition at line 35 of file Path.cc.
References act_table_, cmsRelvalreport::action, cms::Exception::category(), edm::hlt::Exception, edm::actions::FailModule, edm::actions::FailPath, edm::ActionTable::find(), name_, recordStatus(), edm::actions::Rethrow, cms::Exception::rootCause(), edm::errors::ScheduleExecutionFailure, state_, timesExcept_, and cms::Exception::what().
Referenced by processOneOccurrence().
00036 { 00037 bool should_continue = true; 00038 00039 // there is no support as of yet for specific paths having 00040 // different exception behavior 00041 00042 // If not processing an event, always rethrow. 00043 actions::ActionCodes action = (isEvent ? act_table_->find(e.rootCause()) : actions::Rethrow); 00044 assert (action != actions::FailModule); 00045 switch(action) { 00046 case actions::FailPath: { 00047 should_continue = false; 00048 LogWarning(e.category()) 00049 << "Failing path " << name_ 00050 << ", due to exception, message:\n" 00051 << e.what() << "\n"; 00052 break; 00053 } 00054 default: { 00055 if (isEvent) ++timesExcept_; 00056 state_ = edm::hlt::Exception; 00057 recordStatus(nwrwue, isEvent); 00058 throw edm::Exception(errors::ScheduleExecutionFailure, 00059 "ProcessingStopped", e) 00060 << "Exception going through path " << name_ << "\n"; 00061 } 00062 } 00063 00064 return should_continue; 00065 }
std::string const& edm::Path::name | ( | ) | const [inline] |
Definition at line 55 of file Path.h.
References name_.
Referenced by edm::fillPathSummary().
00055 { return name_; }
void edm::Path::processOneOccurrence | ( | typename T::MyPrincipal & | ep, | |
EventSetup const & | es | |||
) | [inline] |
Definition at line 132 of file Path.h.
References edm::CurrentProcessingContext::activate(), actReg_, bitPosition(), e, end, handleWorkerFailure(), i, isEndPath_, name_, edm::hlt::Ready, recordStatus(), recordUnknownException(), state_, stopwatch_, timesRun_, updateCounters(), and workers_.
Referenced by edm::ProcessOneOccurrence< T >::operator()().
00133 { 00134 00135 //Create the PathSignalSentry before the RunStopwatch so that 00136 // we only record the time spent in the path not from the signal 00137 int nwrwue = -1; 00138 std::auto_ptr<PathSignalSentry<T> > signaler(new PathSignalSentry<T>(actReg_.get(), name_, nwrwue, state_)); 00139 00140 // A RunStopwatch, but only if we are processing an event. 00141 std::auto_ptr<RunStopwatch> stopwatch(T::isEvent_ ? new RunStopwatch(stopwatch_) : 0); 00142 00143 if (T::isEvent_) { 00144 ++timesRun_; 00145 } 00146 state_ = hlt::Ready; 00147 00148 // nwrue = numWorkersRunWithoutUnhandledException 00149 bool should_continue = true; 00150 CurrentProcessingContext cpc(&name_, bitPosition(), isEndPath_); 00151 00152 WorkersInPath::size_type idx = 0; 00153 // It seems likely that 'nwrwue' and 'idx' can never differ --- 00154 // if so, we should remove one of them!. 00155 for (WorkersInPath::iterator i = workers_.begin(), end = workers_.end(); 00156 i != end && should_continue; 00157 ++i, ++idx) { 00158 ++nwrwue; 00159 assert (static_cast<int>(idx) == nwrwue); 00160 try { 00161 cpc.activate(idx, i->getWorker()->descPtr()); 00162 should_continue = i->runWorker<T>(ep, es, &cpc); 00163 } 00164 catch(cms::Exception& e) { 00165 // handleWorkerFailure may throw a new exception. 00166 should_continue = handleWorkerFailure(e, nwrwue, T::isEvent_); 00167 } 00168 catch(...) { 00169 recordUnknownException(nwrwue, T::isEvent_); 00170 throw; 00171 } 00172 } 00173 updateCounters(should_continue, T::isEvent_); 00174 recordStatus(nwrwue, T::isEvent_); 00175 }
Definition at line 77 of file Path.cc.
References bitpos_, and state_.
Referenced by handleWorkerFailure(), processOneOccurrence(), and recordUnknownException().
Definition at line 68 of file Path.cc.
References edm::hlt::Exception, name_, recordStatus(), state_, and timesExcept_.
Referenced by processOneOccurrence().
00068 { 00069 LogError("PassingThrough") 00070 << "Exception passing through path " << name_ << "\n"; 00071 if (isEvent) ++timesExcept_; 00072 state_ = edm::hlt::Exception; 00073 recordStatus(nwrwue, isEvent); 00074 }
Definition at line 74 of file Path.h.
References workers_.
Referenced by edm::fillPathSummary().
00074 { return workers_.size(); }
State edm::Path::state | ( | ) | const [inline] |
std::pair<double,double> edm::Path::timeCpuReal | ( | unsigned int const | i | ) | const [inline] |
std::pair<double,double> edm::Path::timeCpuReal | ( | ) | const [inline] |
Definition at line 57 of file Path.h.
References stopwatch_.
00057 { 00058 return std::pair<double,double>(stopwatch_->cpuTime(),stopwatch_->realTime()); 00059 }
int edm::Path::timesExcept | ( | ) | const [inline] |
Definition at line 70 of file Path.h.
References timesExcept_.
Referenced by edm::fillModuleInPathSummary(), and edm::fillPathSummary().
00070 { return timesExcept_; }
int edm::Path::timesFailed | ( | ) | const [inline] |
Definition at line 69 of file Path.h.
References timesFailed_.
Referenced by edm::fillModuleInPathSummary(), and edm::fillPathSummary().
00069 { return timesFailed_; }
int edm::Path::timesPassed | ( | ) | const [inline] |
Definition at line 68 of file Path.h.
References timesPassed_.
Referenced by edm::fillModuleInPathSummary(), and edm::fillPathSummary().
00068 { return timesPassed_; }
int edm::Path::timesRun | ( | ) | const [inline] |
Definition at line 67 of file Path.h.
References timesRun_.
Referenced by edm::fillPathSummary().
00067 { return timesRun_; }
Definition at line 84 of file Path.cc.
References edm::hlt::Fail, edm::hlt::Pass, state_, timesFailed_, and timesPassed_.
Referenced by processOneOccurrence().
00084 { 00085 if (success) { 00086 if (isEvent) ++timesPassed_; 00087 state_ = edm::hlt::Pass; 00088 } else { 00089 if(isEvent) ++timesFailed_; 00090 state_ = edm::hlt::Fail; 00091 } 00092 }
ActionTable* edm::Path::act_table_ [private] |
boost::shared_ptr<ActivityRegistry> edm::Path::actReg_ [private] |
int edm::Path::bitpos_ [private] |
bool edm::Path::isEndPath_ [private] |
std::string edm::Path::name_ [private] |
Definition at line 91 of file Path.h.
Referenced by handleWorkerFailure(), name(), processOneOccurrence(), and recordUnknownException().
State edm::Path::state_ [private] |
Definition at line 88 of file Path.h.
Referenced by handleWorkerFailure(), processOneOccurrence(), recordStatus(), recordUnknownException(), state(), and updateCounters().
int edm::Path::timesExcept_ [private] |
Definition at line 86 of file Path.h.
Referenced by clearCounters(), handleWorkerFailure(), recordUnknownException(), and timesExcept().
int edm::Path::timesFailed_ [private] |
Definition at line 85 of file Path.h.
Referenced by clearCounters(), timesFailed(), and updateCounters().
int edm::Path::timesPassed_ [private] |
Definition at line 84 of file Path.h.
Referenced by clearCounters(), timesPassed(), and updateCounters().
int edm::Path::timesRun_ [private] |
Definition at line 83 of file Path.h.
Referenced by clearCounters(), processOneOccurrence(), and timesRun().
TrigResPtr edm::Path::trptr_ [private] |
WorkersInPath edm::Path::workers_ [private] |
Definition at line 96 of file Path.h.
Referenced by clearCounters(), getWorker(), processOneOccurrence(), size(), timeCpuReal(), timesExcept(), timesFailed(), timesPassed(), and timesVisited().