1 #ifndef FWCore_Framework_GlobalSchedule_h 2 #define FWCore_Framework_GlobalSchedule_h 31 #include "boost/range/adaptor/reversed.hpp" 37 class GlobalScheduleSignalSentry {
39 GlobalScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context)
40 : a_(a), context_(context), allowThrow_(
false) {
42 T::preScheduleSignal(a_, context_);
47 T::postScheduleSignal(a_, context_);
55 void allowThrow() { allowThrow_ =
true; }
60 typename T::Context
const* context_;
67 class ExceptionCollector;
69 class PreallocationConfiguration;
71 class TriggerResultInserter;
72 class PathStatusInserter;
73 class EndPathStatusInserter;
84 std::vector<
edm::propagate_const<std::shared_ptr<EndPathStatusInserter>>>& endPathStatusInserters,
85 std::shared_ptr<ModuleRegistry> modReg,
86 std::vector<std::string>
const& modulesToUse,
91 std::shared_ptr<ActivityRegistry> areg,
92 std::shared_ptr<ProcessConfiguration> processConfiguration,
101 bool cleaningUpAfterException =
false);
112 std::vector<ModuleDescription const*> getAllModuleDescriptions()
const;
119 bool terminate()
const;
125 AllWorkers
const&
allWorkers()
const {
return workerManagers_[0].allWorkers(); }
135 : reg_(iReg), context_(iContext) {}
157 template <
typename T>
159 typename T::MyPrincipal& ep,
162 bool cleaningUpAfterException) {
165 auto globalContext = std::make_shared<GlobalContext>(T::makeGlobalContext(ep, processContext_));
170 T::preScheduleSignal(actReg_.get(), globalContext.get());
174 tbb::task::allocate_root(),
175 [
this, iHolder, cleaningUpAfterException, globalContext, token](std::exception_ptr
const* iPtr)
mutable {
176 std::exception_ptr excpt;
184 std::ostringstream ost;
186 ost <<
"Processing " << T::transitionName() <<
" ";
190 excpt = std::current_exception();
200 T::postScheduleSignal(actReg_.get(), globalContext.get());
203 excpt = std::current_exception();
209 workerManagers_[ep.index()].resetAll();
214 workerManagers_[ep.index()].setupOnDemandSystem(ep, es);
218 auto&
aw = workerManagers_[ep.index()].allWorkers();
220 worker->doWorkAsync<
T>(
std::vector< std::string > vstring
std::vector< WorkerManager > workerManagers_
roAction_t actions[nactions]
std::vector< Worker * > AllWorkers
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
edm::ActivityRegistry * reg_
static StreamID invalidStreamID()
void doneWaiting(std::exception_ptr iExcept)
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 processOneGlobalAsync(WaitingTaskHolder holder, typename T::MyPrincipal &principal, EventSetupImpl const &eventSetup, ServiceToken const &token, bool cleaningUpAfterException=false)
std::shared_ptr< ActivityRegistry > actReg_
~SendTerminationSignalIfException()
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
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_
void completedSuccessfully()
std::vector< edm::propagate_const< WorkerPtr > > extraWorkers_