1 #ifndef FWCore_Framework_GlobalSchedule_h
2 #define FWCore_Framework_GlobalSchedule_h
23 #include "boost/shared_ptr.hpp"
36 class GlobalScheduleSignalSentry {
39 a_(a), principal_(principal), es_(es), context_(context),
41 if (a_) T::preScheduleSignal(a_, principal_, context_);
45 if (a_)
if (principal_) T::postScheduleSignal(a_, principal_, es_, context_);
47 if(allowThrow_) {
throw;}
58 typename T::MyPrincipal* principal_;
60 typename T::Context
const* context_;
67 class ExceptionCollector;
69 class PreallocationConfiguration;
71 class TriggerResultInserter;
81 boost::shared_ptr<ModuleRegistry> modReg,
82 std::vector<std::string>
const& modulesToUse,
87 boost::shared_ptr<ActivityRegistry>
areg,
95 bool cleaningUpAfterException =
false);
145 template <
typename T>
149 bool cleaningUpAfterException) {
152 GlobalScheduleSignalSentry<T> sentry(
actReg_.get(), &ep, &es, &globalContext);
159 runNow<T>(ep,es,&globalContext);
179 template <
typename T>
190 std::ostringstream ost;
191 if (T::begin_ && T::branchType_ ==
InRun) {
192 ost <<
"Calling beginRun";
194 else if (T::begin_ && T::branchType_ ==
InLumi) {
195 ost <<
"Calling beginLuminosityBlock";
197 else if (!T::begin_ && T::branchType_ ==
InLumi) {
198 ost <<
"Calling endLuminosityBlock";
200 else if (!T::begin_ && T::branchType_ ==
InRun) {
201 ost <<
"Calling endRun";
205 ost <<
"Calling unknown function";
207 ost <<
" for unscheduled module " << worker->description().moduleName()
208 <<
"/'" << worker->description().moduleLabel() <<
"'";
211 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
void stdToEDM(std::exception const &e)
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 charPtrToEDM(char const *c)
void stringToEDM(std::string &s)
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)
volatile std::atomic< bool > shutdown_flag false
ProcessContext const * processContext_
WorkerPtr results_inserter_
WorkerManager workerManager_
boost::shared_ptr< Worker > WorkerPtr
ExceptionToActionTable const & actionTable() const