1 #ifndef FWCore_Framework_GlobalSchedule_h
2 #define FWCore_Framework_GlobalSchedule_h
23 #include "boost/shared_ptr.hpp"
36 class GlobalScheduleSignalSentry {
38 GlobalScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context) :
39 a_(a), context_(context),
41 if (a_) T::preScheduleSignal(a_, context_);
45 if (a_) T::postScheduleSignal(a_, context_);
47 if(allowThrow_) {
throw;}
58 typename T::Context
const* context_;
65 class ExceptionCollector;
67 class PreallocationConfiguration;
69 class TriggerResultInserter;
79 boost::shared_ptr<ModuleRegistry> modReg,
80 std::vector<std::string>
const& modulesToUse,
85 boost::shared_ptr<ActivityRegistry>
areg,
93 bool cleaningUpAfterException =
false);
143 template <
typename T>
147 bool cleaningUpAfterException) {
150 GlobalScheduleSignalSentry<T> sentry(
actReg_.get(), &globalContext);
157 runNow<T>(ep,es,&globalContext);
171 template <
typename T>
182 std::ostringstream ost;
183 if (T::begin_ && T::branchType_ ==
InRun) {
184 ost <<
"Calling beginRun";
186 else if (T::begin_ && T::branchType_ ==
InLumi) {
187 ost <<
"Calling beginLuminosityBlock";
189 else if (!T::begin_ && T::branchType_ ==
InLumi) {
190 ost <<
"Calling endLuminosityBlock";
192 else if (!T::begin_ && T::branchType_ ==
InRun) {
193 ost <<
"Calling endRun";
197 ost <<
"Calling unknown function";
199 ost <<
" for unscheduled module " << worker->description().moduleName()
200 <<
"/'" << worker->description().moduleLabel() <<
"'";
203 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)
void addToAllWorkers(Worker *w)
static StreamID invalidStreamID()
bool terminate() const
Return whether each output module has reached its maximum count.
void beginJob(ProductRegistry const &)
std::vector< Worker * > Workers
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
std::list< std::string > const & context() const
boost::shared_ptr< ActivityRegistry > actReg_
void endJob(ExceptionCollector &collector)
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
AllWorkers const & allWorkers() const
void addContext(std::string const &context)
ExceptionToActionTable const & actionTable() const
returns the action table
GlobalSchedule(TriggerResultInserter *inserter, boost::shared_ptr< ModuleRegistry > modReg, std::vector< std::string > const &modulesToUse, ParameterSet &proc_pset, ProductRegistry &pregistry, PreallocationConfiguration const &prealloc, ExceptionToActionTable const &actions, boost::shared_ptr< ActivityRegistry > areg, boost::shared_ptr< ProcessConfiguration > processConfiguration, ProcessContext const *processContext)
auto wrap(F iFunc) -> decltype(iFunc())
volatile std::atomic< bool > shutdown_flag false
ProcessContext const * processContext_
WorkerPtr results_inserter_
WorkerManager workerManager_
boost::shared_ptr< Worker > WorkerPtr
ExceptionToActionTable const & actionTable() const