1 #ifndef FWCore_Framework_GlobalSchedule_h 2 #define FWCore_Framework_GlobalSchedule_h 37 #include "boost/range/adaptor/reversed.hpp" 43 class GlobalScheduleSignalSentry {
48 T::preScheduleSignal(a_, context_);
50 ~GlobalScheduleSignalSentry() noexcept(
false) {
54 T::postScheduleSignal(a_, context_);
62 void allowThrow() { allowThrow_ =
true; }
67 typename T::Context
const* context_;
73 class ExceptionCollector;
75 class PreallocationConfiguration;
77 class TriggerResultInserter;
78 class PathStatusInserter;
79 class EndPathStatusInserter;
91 std::shared_ptr<ModuleRegistry> modReg,
92 std::vector<std::string>
const& modulesToUse,
97 std::shared_ptr<ActivityRegistry> areg,
98 std::shared_ptr<ProcessConfiguration const> processConfiguration,
102 template <
typename T>
104 typename T::TransitionInfoType&,
106 bool cleaningUpAfterException =
false);
162 template <
typename T>
164 typename T::TransitionInfoType& transitionInfo,
166 bool cleaningUpAfterException) {
167 auto const& principal = transitionInfo.principal();
172 auto globalContext = std::make_shared<GlobalContext>(T::makeGlobalContext(principal,
processContext_));
177 T::preScheduleSignal(
actReg_.get(), globalContext.get());
182 [
this, iHolder, cleaningUpAfterException, globalContext, weakToken](std::exception_ptr
const* iPtr)
mutable {
183 std::exception_ptr excpt;
191 std::ostringstream ost;
197 excpt = std::current_exception();
208 T::postScheduleSignal(
actReg_.get(), globalContext.get());
211 excpt = std::current_exception();
217 unsigned int managerIndex = principal.index();
218 if constexpr (T::branchType_ ==
InRun) {
233 worker->doWorkAsync<
T>(
std::string_view transitionName(GlobalContext::Transition)
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]
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.
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
edm::ActivityRegistry * reg_
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 doneWaiting(std::exception_ptr iExcept)
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)
ServiceToken lock() const
std::shared_ptr< ActivityRegistry > actReg_
PreGlobalEarlyTermination preGlobalEarlyTerminationSignal_
~SendTerminationSignalIfException()
void beginJob(ProductRegistry const &, eventsetup::ESRecordsToProxyIndices const &, ProcessBlockHelperBase const &)
SendTerminationSignalIfException(edm::ActivityRegistry *iReg, edm::GlobalContext const *iContext)
void setupResolvers(Principal &principal)
void processOneGlobalAsync(WaitingTaskHolder holder, typename T::TransitionInfoType &, ServiceToken const &token, bool cleaningUpAfterException=false)
GlobalContext const * context_
auto wrap(F iFunc) -> decltype(iFunc())
ProcessContext const * processContext_
void completedSuccessfully()
std::list< std::string > const & context() const
unsigned int numberOfConcurrentLumis_
std::vector< edm::propagate_const< WorkerPtr > > extraWorkers_