1 #ifndef FWCore_Framework_GlobalSchedule_h 2 #define FWCore_Framework_GlobalSchedule_h 37 #include "boost/range/adaptor/reversed.hpp" 42 class ExceptionCollector;
44 class PreallocationConfiguration;
46 class TriggerResultInserter;
47 class PathStatusInserter;
48 class EndPathStatusInserter;
60 std::shared_ptr<ModuleRegistry> modReg,
61 std::vector<std::string>
const& modulesToUse,
66 std::shared_ptr<ActivityRegistry> areg,
67 std::shared_ptr<ProcessConfiguration const> processConfiguration,
73 typename T::TransitionInfoType&,
75 bool cleaningUpAfterException =
false);
106 template <
typename T>
109 template <
typename T>
114 bool cleaningUpAfterException,
115 std::exception_ptr&);
124 template <
typename T>
126 typename T::TransitionInfoType& transitionInfo,
128 bool cleaningUpAfterException) {
129 auto const& principal = transitionInfo.principal();
134 auto globalContext = std::make_shared<GlobalContext>(T::makeGlobalContext(principal,
processContext_));
138 [
this, iHolder, cleaningUpAfterException, globalContext, weakToken](std::exception_ptr
const* iPtr)
mutable {
139 std::exception_ptr excpt;
143 handleException(globalContext.get(), weakToken, cleaningUpAfterException, excpt);
145 postScheduleSignal<T>(globalContext.get(), weakToken, excpt);
153 preScheduleSignal<T>(globalContext.get(),
token);
155 unsigned int managerIndex = principal.index();
169 worker->doWorkAsync<
T>(
173 holdForLoop.doneWaiting(std::current_exception());
180 template <
typename T>
187 std::ostringstream ost;
188 ex.
addContext(
"Handling pre signal, likely in a service function");
196 template <
typename T>
199 std::exception_ptr& excpt) {
204 T::postScheduleSignal(
actReg_.get(), globalContext);
208 std::ostringstream ost;
209 ex.
addContext(
"Handling post signal, likely in a service function");
212 excpt = std::current_exception();
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.
std::vector< WorkerManager > workerManagers_
roAction_t actions[nactions]
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
std::vector< Worker * > AllWorkers
ExceptionToActionTable const & actionTable() const
returns the action table
void deleteModule(std::string const &iLabel)
Delete the module with label iLabel.
static StreamID invalidStreamID()
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
oneapi::tbb::task_group * group() const noexcept
bool terminate() const
Return whether each output module has reached its maximum count.
void preScheduleSignal(GlobalContext const *, ServiceToken const &)
std::vector< Worker * > Workers
GlobalSchedule(std::shared_ptr< TriggerResultInserter > inserter, std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter >>> &pathStatusInserters, std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter >>> &endPathStatusInserters, std::shared_ptr< ModuleRegistry > modReg, std::vector< std::string > const &modulesToUse, ParameterSet &proc_pset, ProductRegistry &pregistry, PreallocationConfiguration const &prealloc, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration const > processConfiguration, ProcessContext const *processContext)
std::shared_ptr< Worker > WorkerPtr
AllWorkers const & allWorkers() const
FunctorWaitingTask< F > * make_waiting_task(F f)
void endJob(ExceptionCollector &collector)
void postScheduleSignal(GlobalContext const *, ServiceWeakToken const &, std::exception_ptr &)
ServiceToken lock() const
void doneWaiting(std::exception_ptr iExcept) noexcept
std::shared_ptr< ActivityRegistry > actReg_
void addContext(std::string const &context)
void handleException(GlobalContext const *, ServiceWeakToken const &, bool cleaningUpAfterException, std::exception_ptr &)
void setupResolvers(Principal &principal)
void processOneGlobalAsync(WaitingTaskHolder holder, typename T::TransitionInfoType &, ServiceToken const &token, bool cleaningUpAfterException=false)
void beginJob(ProductRegistry const &, eventsetup::ESRecordsToProductResolverIndices const &, ProcessBlockHelperBase const &)
auto wrap(F iFunc) -> decltype(iFunc())
ProcessContext const * processContext_
unsigned int numberOfConcurrentLumis_
std::vector< edm::propagate_const< WorkerPtr > > extraWorkers_