1 #ifndef FWCore_Framework_StreamSchedule_h 2 #define FWCore_Framework_StreamSchedule_h 98 #include <unordered_set> 103 class BranchIDListHelper;
104 class ExceptionCollector;
105 class ExceptionToActionTable;
106 class OutputModuleCommunicator;
107 class ProcessContext;
110 class ModuleRegistry;
111 class TriggerResultInserter;
112 class PathStatusInserter;
113 class EndPathStatusInserter;
114 class PreallocationConfiguration;
117 class ConditionalTaskHelper;
120 class TriggerNamesService;
124 template <
typename T>
125 class StreamScheduleSignalSentry {
130 T::preScheduleSignal(a_, context_);
132 ~StreamScheduleSignalSentry() noexcept(
false) {
136 T::postScheduleSignal(a_, context_);
145 void allowThrow() { allowThrow_ =
true; }
150 typename T::Context
const* context_;
172 std::shared_ptr<ModuleRegistry>,
178 std::shared_ptr<ActivityRegistry> areg,
179 std::shared_ptr<ProcessConfiguration const> processConfiguration,
191 template <
typename T>
193 typename T::TransitionInfoType& transitionInfo,
195 bool cleaningUpAfterException =
false);
211 void availablePaths(std::vector<std::string>& oLabelsToFill)
const;
217 std::vector<ModuleDescription const*>& descriptions,
218 unsigned int hint)
const;
221 std::vector<ModuleDescription const*>& descriptions,
222 unsigned int hint)
const;
251 std::vector<std::string>
const& branchesToDeleteEarly,
303 std::unordered_set<std::string>& conditionalModules,
304 std::unordered_multimap<std::string, edm::BranchDescription const*>
const& conditionalModuleBranches,
305 std::unordered_multimap<std::string, AliasInfo>
const& aliasMap,
309 std::shared_ptr<ProcessConfiguration const> processConfiguration);
313 std::shared_ptr<ProcessConfiguration const> processConfiguration,
317 std::vector<std::string>
const& endPathNames,
322 std::shared_ptr<ProcessConfiguration const> processConfiguration,
326 std::vector<std::string>
const& endPathNames,
331 std::shared_ptr<ProcessConfiguration const> processConfiguration,
334 std::vector<std::string>
const& endPathNames,
389 reportSvc->reportSkippedEvent(
ep.id().run(),
ep.id().event());
392 template <
typename T>
394 typename T::TransitionInfoType& transitionInfo,
396 bool cleaningUpAfterException) {
397 auto const& principal = transitionInfo.principal();
400 auto id = principal.id();
403 [
this, iHolder,
id, cleaningUpAfterException, weakToken](std::exception_ptr
const* iPtr)
mutable {
404 std::exception_ptr excpt;
412 std::ostringstream ost;
418 excpt = std::current_exception();
430 excpt = std::current_exception();
446 h.doneWaiting(std::current_exception());
470 oneapi::tbb::task_arena arena{oneapi::tbb::task_arena::attach()};
471 arena.enqueue([
task]() {
std::string_view transitionName(GlobalContext::Transition)
StreamContext const * context_
void moduleDescriptionsInEndPath(std::string const &iEndPathLabel, std::vector< ModuleDescription const *> &descriptions, unsigned int hint) const
ExceptionToActionTable const & actionTable() const
returns the action table
std::string originalInstanceLabel
std::shared_ptr< HLTGlobalStatus const > TrigResConstPtr
void fillTrigPath(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name, TrigResPtr, std::vector< std::string > const &endPathNames, ConditionalTaskHelper const &conditionalTaskHelper)
std::vector< Worker * > Workers
std::vector< int > empty_trig_paths_
roAction_t actions[nactions]
std::vector< edm::propagate_const< WorkerPtr > > pathStatusInserterWorkers_
std::vector< Path > NonTrigPaths
std::shared_ptr< HLTGlobalStatus > TrigResPtr
int totalEventsPassed() const
void modulesInPath(std::string const &iPathLabel, std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill in execution order the labels of all modules in path iPathLabel ...
void processOneEventAsync(WaitingTaskHolder iTask, EventTransitionInfo &, ServiceToken const &token, std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter >>> &pathStatusInserters)
std::vector< BranchToCount > earlyDeleteBranchToCount_
unsigned int numberOfUnscheduledModules() const
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
void addToAllWorkers(Worker *w)
StreamSchedule(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 >, ParameterSet &proc_pset, service::TriggerNamesService const &tns, PreallocationConfiguration const &prealloc, ProductRegistry &pregistry, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration const > processConfiguration, StreamID streamID, ProcessContext const *processContext)
AllWorkers const & unscheduledWorkers() const
std::vector< Worker * > tryToPlaceConditionalModules(Worker *, std::unordered_set< std::string > &conditionalModules, std::unordered_multimap< std::string, edm::BranchDescription const *> const &conditionalModuleBranches, std::unordered_multimap< std::string, AliasInfo > const &aliasMap, ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration)
edm::propagate_const< WorkerPtr > results_inserter_
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr< Worker > WorkerPtr
StreamID streamID() const
unsigned int number_of_unscheduled_modules_
int totalEventsFailed() const
WorkerManager workerManager_
std::shared_ptr< ActivityRegistry > actReg_
void processOneOccurrenceAsync(WaitingTaskHolder, typename T::TransitionInfoType &, ServiceToken const &, StreamID, typename T::Context const *topContext, U const *context)
oneapi::tbb::task_group * group() const noexcept
std::vector< WorkerInPath > PathWorkers
std::vector< int > empty_end_paths_
AllWorkers const & unscheduledWorkers() const
void doneWaiting(std::exception_ptr iExcept)
PreStreamEarlyTermination preStreamEarlyTerminationSignal_
void fillEndPath(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name, std::vector< std::string > const &endPathNames, ConditionalTaskHelper const &conditionalTaskHelper)
SendTerminationSignalIfException(edm::ActivityRegistry *iReg, edm::StreamContext const *iContext)
void moduleDescriptionsInPath(std::string const &iPathLabel, std::vector< ModuleDescription const *> &descriptions, unsigned int hint) const
TrigResConstPtr results() const
StreamContext streamContext_
std::vector< std::string > vstring
AllWorkers const & allWorkers() const
void finishedPaths(std::atomic< std::exception_ptr *> &, WaitingTaskHolder, EventTransitionInfo &)
FunctorWaitingTask< F > * make_waiting_task(F f)
std::string friendlyClassName
std::vector< Worker * > AllWorkers
std::string instanceLabel
std::exception_ptr finishProcessOneEvent(std::exception_ptr)
void reportSkipped(EventPrincipal const &ep) const
ServiceToken lock() const
void deleteModule(std::string const &iLabel)
Delete the module with label iLabel.
ExceptionToActionTable const & actionTable() const
StreamContext const & context() const
void clearCounters()
Clear all the counters in the trigger report.
void initializeEarlyDelete(ModuleRegistry &modReg, std::vector< std::string > const &branchesToDeleteEarly, edm::ProductRegistry const &preg)
void getTriggerReport(TriggerReport &rep) const
void processOneStreamAsync(WaitingTaskHolder iTask, typename T::TransitionInfoType &transitionInfo, ServiceToken const &token, bool cleaningUpAfterException=false)
std::vector< unsigned int > earlyDeleteHelperToBranchIndicies_
edm::propagate_const< TrigResPtr > results_
FunctorTask< F > * make_functor_task(F f)
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
~SendTerminationSignalIfException()
std::atomic< bool > skippingEvent_
void replaceModule(maker::ModuleHolder *iMod, std::string const &iLabel)
clone the type of module with label iLabel but configure with iPSet.
void fillWorkers(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, std::string const &name, bool ignoreFilters, PathWorkers &out, std::vector< std::string > const &endPathNames, ConditionalTaskHelper const &conditionalTaskHelper)
std::vector< edm::propagate_const< WorkerPtr > > endPathStatusInserterWorkers_
void makePathStatusInserters(std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter >>> &pathStatusInserters, std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter >>> &endPathStatusInserters, ExceptionToActionTable const &actions)
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
unsigned int value() const
auto wrap(F iFunc) -> decltype(iFunc())
std::string originalModuleLabel
edm::ActivityRegistry * reg_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
std::list< std::string > const & context() const
std::vector< Path > TrigPaths
std::vector< EarlyDeleteHelper > earlyDeleteHelpers_
void completedSuccessfully()