1 #ifndef FWCore_Framework_GlobalSchedule_h
2 #define FWCore_Framework_GlobalSchedule_h
34 class GlobalScheduleSignalSentry {
36 GlobalScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context) :
37 a_(a), context_(context),
39 if (a_) T::preScheduleSignal(a_, context_);
43 if (a_) T::postScheduleSignal(a_, context_);
45 if(allowThrow_) {
throw;}
56 typename T::Context
const* context_;
63 class ExceptionCollector;
65 class PreallocationConfiguration;
67 class TriggerResultInserter;
77 std::shared_ptr<ModuleRegistry> modReg,
78 std::vector<std::string>
const& modulesToUse,
83 std::shared_ptr<ActivityRegistry>
areg,
91 bool cleaningUpAfterException =
false);
163 template <
typename T>
167 bool cleaningUpAfterException) {
170 GlobalScheduleSignalSentry<T> sentry(
actReg_.get(), &globalContext);
179 runNow<T>(ep,es,&globalContext);
190 terminationSentry.completedSuccessfully();
195 template <
typename T>
206 std::ostringstream ost;
207 if (T::begin_ && T::branchType_ ==
InRun) {
208 ost <<
"Calling global beginRun";
210 else if (T::begin_ && T::branchType_ ==
InLumi) {
211 ost <<
"Calling global beginLuminosityBlock";
213 else if (!T::begin_ && T::branchType_ ==
InLumi) {
214 ost <<
"Calling global endLuminosityBlock";
216 else if (!T::begin_ && T::branchType_ ==
InRun) {
217 ost <<
"Calling global endRun";
221 ost <<
"Calling unknown function";
223 ost <<
" for module " << worker->description().moduleName()
224 <<
"/'" << worker->description().moduleLabel() <<
"'";
227 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
void replaceModule(maker::ModuleHolder *iMod, std::string const &iLabel)
clone the type of module with label iLabel but configure with iPSet.
void runNow(typename T::MyPrincipal &p, EventSetup const &es, GlobalContext const *context)
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)
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_
WorkerPtr results_inserter_
WorkerManager workerManager_
void completedSuccessfully()
ExceptionToActionTable const & actionTable() const