1 #ifndef FWCore_Framework_GlobalSchedule_h
2 #define FWCore_Framework_GlobalSchedule_h
36 #include "boost/range/adaptor/reversed.hpp"
42 class GlobalScheduleSignalSentry {
44 GlobalScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context)
45 : a_(
a), context_(context), allowThrow_(
false) {
47 T::preScheduleSignal(a_, context_);
49 ~GlobalScheduleSignalSentry() noexcept(
false) {
53 T::postScheduleSignal(a_, context_);
61 void allowThrow() { allowThrow_ =
true; }
66 typename T::Context
const* context_;
72 class ExceptionCollector;
74 class PreallocationConfiguration;
76 class TriggerResultInserter;
77 class PathStatusInserter;
78 class EndPathStatusInserter;
90 std::shared_ptr<ModuleRegistry> modReg,
91 std::vector<std::string>
const& modulesToUse,
96 std::shared_ptr<ActivityRegistry> areg,
97 std::shared_ptr<ProcessConfiguration> processConfiguration,
101 template <
typename T>
103 typename T::TransitionInfoType&,
105 bool cleaningUpAfterException =
false);
157 template <
typename T>
159 typename T::TransitionInfoType& transitionInfo,
161 bool cleaningUpAfterException) {
162 auto const& principal = transitionInfo.principal();
167 auto globalContext = std::make_shared<GlobalContext>(T::makeGlobalContext(principal,
processContext_));
172 T::preScheduleSignal(
actReg_.get(), globalContext.get());
176 tbb::task::allocate_root(),
177 [
this, iHolder, cleaningUpAfterException, globalContext,
token](std::exception_ptr
const* iPtr)
mutable {
178 std::exception_ptr excpt;
186 std::ostringstream ost;
188 ost <<
"Processing " << T::transitionName() <<
" ";
192 excpt = std::current_exception();
203 T::postScheduleSignal(
actReg_.get(), globalContext.get());
206 excpt = std::current_exception();
213 workerManager.resetAll();
218 workerManager.setupResolvers(transitionInfo.principal());
222 auto& aw = workerManager.allWorkers();
224 worker->doWorkAsync<
T>(