1 #ifndef FWCore_Framework_GlobalSchedule_h 2 #define FWCore_Framework_GlobalSchedule_h 35 class GlobalScheduleSignalSentry {
37 GlobalScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context) :
38 a_(a), context_(context),
40 if (a_) T::preScheduleSignal(a_, context_);
44 if (a_) T::postScheduleSignal(a_, context_);
46 if(allowThrow_) {
throw;}
57 typename T::Context
const* context_;
64 class ExceptionCollector;
66 class PreallocationConfiguration;
68 class TriggerResultInserter;
78 std::shared_ptr<ModuleRegistry> modReg,
79 std::vector<std::string>
const& modulesToUse,
84 std::shared_ptr<ActivityRegistry> areg,
85 std::shared_ptr<ProcessConfiguration> processConfiguration,
90 void processOneGlobal(
typename T::MyPrincipal&
principal,
92 bool cleaningUpAfterException =
false);
103 std::vector<ModuleDescription const*> getAllModuleDescriptions()
const;
110 bool terminate()
const;
117 return workerManager_.allWorkers();
145 void runNow(
typename T::MyPrincipal
const&
p,
EventSetup const& es,
150 return workerManager_.actionTable();
153 void addToAllWorkers(
Worker*
w);
164 template <
typename T>
168 bool cleaningUpAfterException) {
169 GlobalContext globalContext = T::makeGlobalContext(ep, processContext_);
171 GlobalScheduleSignalSentry<T> sentry(actReg_.get(), &globalContext);
178 ep.resetFailedFromThisProcess();
181 workerManager_.processOneOccurrence<
T>(ep, es,
StreamID::invalidStreamID(), &globalContext, &globalContext, cleaningUpAfterException);
185 runNow<T>(ep,es,&globalContext);
196 terminationSentry.completedSuccessfully();
201 template <
typename T>
206 for(
auto & worker: allWorkers()) {
213 std::ostringstream ost;
214 ost <<
"Processing " <<T::transitionName()<<
" "<< p.id();
void processOneGlobal(typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
std::vector< std::string > vstring
edm::propagate_const< WorkerPtr > results_inserter_
roAction_t actions[nactions]
std::vector< Worker * > AllWorkers
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
void runNow(typename T::MyPrincipal const &p, EventSetup const &es, GlobalContext const *context)
edm::ActivityRegistry * reg_
static StreamID invalidStreamID()
std::vector< Worker * > Workers
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
std::list< std::string > const & context() const
std::shared_ptr< Worker > WorkerPtr
std::shared_ptr< ActivityRegistry > actReg_
~SendTerminationSignalIfException()
void addContext(std::string const &context)
SendTerminationSignalIfException(edm::ActivityRegistry *iReg, edm::GlobalContext const *iContext)
ExceptionToActionTable const & actionTable() const
returns the action table
GlobalContext const * context_
auto wrap(F iFunc) -> decltype(iFunc())
ProcessContext const * processContext_
WorkerManager workerManager_
void completedSuccessfully()