1 #ifndef FWCore_Framework_GlobalSchedule_h
2 #define FWCore_Framework_GlobalSchedule_h
32 #include "boost/range/adaptor/reversed.hpp"
38 class GlobalScheduleSignalSentry {
40 GlobalScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context)
41 : a_(
a), context_(context), allowThrow_(
false) {
43 T::preScheduleSignal(a_, context_);
45 ~GlobalScheduleSignalSentry() noexcept(
false) {
49 T::postScheduleSignal(a_, context_);
57 void allowThrow() { allowThrow_ =
true; }
62 typename T::Context
const* context_;
69 class ExceptionCollector;
71 class PreallocationConfiguration;
73 class TriggerResultInserter;
74 class PathStatusInserter;
75 class EndPathStatusInserter;
86 std::vector<
edm::propagate_const<std::shared_ptr<EndPathStatusInserter>>>& endPathStatusInserters,
87 std::shared_ptr<ModuleRegistry> modReg,
88 std::vector<std::string>
const& modulesToUse,
93 std::shared_ptr<ActivityRegistry> areg,
94 std::shared_ptr<ProcessConfiguration> processConfiguration,
100 typename T::MyPrincipal& principal,
103 bool cleaningUpAfterException =
false);
159 template <
typename T>
161 typename T::MyPrincipal&
ep,
164 bool cleaningUpAfterException) {
168 auto globalContext = std::make_shared<GlobalContext>(T::makeGlobalContext(
ep,
processContext_));
173 T::preScheduleSignal(
actReg_.get(), globalContext.get());
177 tbb::task::allocate_root(),
178 [
this, iHolder, cleaningUpAfterException, globalContext,
token](std::exception_ptr
const* iPtr)
mutable {
179 std::exception_ptr excpt;
187 std::ostringstream ost;
189 ost <<
"Processing " << T::transitionName() <<
" ";
193 excpt = std::current_exception();
204 T::postScheduleSignal(
actReg_.get(), globalContext.get());
207 excpt = std::current_exception();
224 worker->doWorkAsync<
T>(