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,
92 bool cleaningUpAfterException =
false);
164 template <
typename T>
168 bool cleaningUpAfterException) {
171 GlobalScheduleSignalSentry<T> sentry(
actReg_.get(), &globalContext);
178 ep.resetFailedFromThisProcess();
185 runNow<T>(ep,es,&globalContext);
196 terminationSentry.completedSuccessfully();
201 template <
typename T>
212 std::ostringstream ost;
213 if (T::begin_ && T::branchType_ ==
InRun) {
214 ost <<
"Calling global beginRun";
216 else if (T::begin_ && T::branchType_ ==
InLumi) {
217 ost <<
"Calling global beginLuminosityBlock";
219 else if (!T::begin_ && T::branchType_ ==
InLumi) {
220 ost <<
"Calling global endLuminosityBlock";
222 else if (!T::begin_ && T::branchType_ ==
InRun) {
223 ost <<
"Calling global endRun";
227 ost <<
"Calling unknown function";
229 ost <<
" for module " << worker->description().moduleName()
230 <<
"/'" << worker->description().moduleLabel() <<
"'";
233 ost <<
"Processing " << p.id();
void getTriggerReport(TriggerReport &rep) const
void processOneGlobal(typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
std::vector< std::string > vstring
edm::propagate_const< WorkerPtr > results_inserter_
void replaceModule(maker::ModuleHolder *iMod, std::string const &iLabel)
clone the type of module with label iLabel but configure with iPSet.
void processOneOccurrence(typename T::MyPrincipal &principal, EventSetup const &eventSetup, StreamID streamID, typename T::Context const *topContext, U const *context, bool cleaningUpAfterException=false)
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_
void addToAllWorkers(Worker *w)
static StreamID invalidStreamID()
bool terminate() const
Return whether each output module has reached its maximum count.
void beginJob(ProductRegistry const &)
GlobalSchedule(std::shared_ptr< TriggerResultInserter > inserter, std::shared_ptr< ModuleRegistry > modReg, std::vector< std::string > const &modulesToUse, ParameterSet &proc_pset, ProductRegistry &pregistry, PreallocationConfiguration const &prealloc, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration > processConfiguration, ProcessContext const *processContext)
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
void endJob(ExceptionCollector &collector)
std::shared_ptr< ActivityRegistry > actReg_
PreGlobalEarlyTermination preGlobalEarlyTerminationSignal_
~SendTerminationSignalIfException()
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
AllWorkers const & allWorkers() const
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())
volatile std::atomic< bool > shutdown_flag false
ProcessContext const * processContext_
WorkerManager workerManager_
void completedSuccessfully()
ExceptionToActionTable const & actionTable() const