1 #ifndef FWCore_Framework_StreamSchedule_h 2 #define FWCore_Framework_StreamSchedule_h 97 #include <unordered_set> 102 class BranchIDListHelper;
103 class ExceptionCollector;
104 class ExceptionToActionTable;
105 class OutputModuleCommunicator;
106 class ProcessContext;
109 class ModuleRegistry;
110 class TriggerResultInserter;
111 class PathStatusInserter;
112 class EndPathStatusInserter;
113 class PreallocationConfiguration;
116 class ConditionalTaskHelper;
119 class TriggerNamesService;
123 template <
typename T>
124 class StreamScheduleSignalSentry {
129 T::preScheduleSignal(a_, context_);
131 ~StreamScheduleSignalSentry() noexcept(
false) {
135 T::postScheduleSignal(a_, context_);
144 void allowThrow() { allowThrow_ =
true; }
149 typename T::Context
const* context_;
171 std::shared_ptr<ModuleRegistry>,
177 std::shared_ptr<ActivityRegistry> areg,
178 std::shared_ptr<ProcessConfiguration const> processConfiguration,
190 template <
typename T>
192 typename T::TransitionInfoType& transitionInfo,
194 bool cleaningUpAfterException =
false);
210 void availablePaths(std::vector<std::string>& oLabelsToFill)
const;
216 std::vector<ModuleDescription const*>& descriptions,
217 unsigned int hint)
const;
220 std::vector<ModuleDescription const*>& descriptions,
221 unsigned int hint)
const;
250 std::vector<std::string>
const& branchesToDeleteEarly,
251 std::multimap<std::string, std::string>
const& referencesToBranches,
252 std::vector<std::string>
const& modulesToSkip,
304 std::unordered_set<std::string>& conditionalModules,
305 std::unordered_multimap<std::string, edm::BranchDescription const*>
const& conditionalModuleBranches,
306 std::unordered_multimap<std::string, AliasInfo>
const& aliasMap,
310 std::shared_ptr<ProcessConfiguration const> processConfiguration);
314 std::shared_ptr<ProcessConfiguration const> processConfiguration,
318 std::vector<std::string>
const& endPathNames,
320 std::unordered_set<std::string>& allConditionalModules);
324 std::shared_ptr<ProcessConfiguration const> processConfiguration,
328 std::vector<std::string>
const& endPathNames,
330 std::unordered_set<std::string>& allConditionalModules);
334 std::shared_ptr<ProcessConfiguration const> processConfiguration,
337 std::vector<std::string>
const& endPathNames,
339 std::unordered_set<std::string>& allConditionalModules);
392 reportSvc->reportSkippedEvent(
ep.id().run(),
ep.id().event());
395 template <
typename T>
397 typename T::TransitionInfoType& transitionInfo,
399 bool cleaningUpAfterException) {
400 auto const& principal = transitionInfo.principal();
403 auto id = principal.id();
406 [
this, iHolder,
id, cleaningUpAfterException, weakToken](std::exception_ptr
const* iPtr)
mutable {
407 std::exception_ptr excpt;
415 std::ostringstream ost;
421 excpt = std::current_exception();
433 excpt = std::current_exception();
449 h.doneWaiting(std::current_exception());
473 oneapi::tbb::task_arena arena{oneapi::tbb::task_arena::attach()};
474 arena.enqueue([
task]() {
std::string_view transitionName(GlobalContext::Transition)
void initializeEarlyDelete(ModuleRegistry &modReg, std::vector< std::string > const &branchesToDeleteEarly, std::multimap< std::string, std::string > const &referencesToBranches, std::vector< std::string > const &modulesToSkip, edm::ProductRegistry const &preg)
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
std::vector< Worker * > Workers
std::vector< int > empty_trig_paths_
roAction_t actions[nactions]
std::vector< edm::propagate_const< WorkerPtr > > pathStatusInserterWorkers_
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::unordered_set< std::string > &allConditionalModules)
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_
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)
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::unordered_set< std::string > &allConditionalModules)
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 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()
void replaceModule(maker::ModuleHolder *iMod, std::string const &iLabel)
clone the type of module with label iLabel but configure with iPSet.
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
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, std::unordered_set< std::string > &allConditionalModules)
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()