1 #ifndef FWCore_Framework_StreamSchedule_h 2 #define FWCore_Framework_StreamSchedule_h 102 #include <unordered_set> 107 class BranchIDListHelper;
108 class ExceptionCollector;
109 class ExceptionToActionTable;
110 class OutputModuleCommunicator;
113 class ModuleRegistry;
114 class TriggerResultInserter;
115 class PathStatusInserter;
116 class EndPathStatusInserter;
117 class PreallocationConfiguration;
118 class ConditionalTaskHelper;
121 class TriggerNamesService;
140 std::shared_ptr<ModuleRegistry>,
146 std::shared_ptr<ActivityRegistry> areg,
147 std::shared_ptr<ProcessConfiguration const> processConfiguration,
159 template <
typename T>
161 typename T::TransitionInfoType& transitionInfo,
163 bool cleaningUpAfterException =
false);
179 void availablePaths(std::vector<std::string>& oLabelsToFill)
const;
185 std::vector<ModuleDescription const*>& descriptions,
186 unsigned int hint)
const;
189 std::vector<ModuleDescription const*>& descriptions,
190 unsigned int hint)
const;
219 std::vector<std::string>
const& branchesToDeleteEarly,
220 std::multimap<std::string, std::string>
const& referencesToBranches,
221 std::vector<std::string>
const& modulesToSkip,
257 std::unordered_set<std::string>& conditionalModules,
258 std::unordered_multimap<std::string, edm::BranchDescription const*>
const& conditionalModuleBranches,
259 std::unordered_multimap<std::string, AliasInfo>
const& aliasMap,
263 std::shared_ptr<ProcessConfiguration const> processConfiguration);
267 std::shared_ptr<ProcessConfiguration const> processConfiguration,
271 std::vector<std::string>
const& endPathNames,
273 std::unordered_set<std::string>& allConditionalModules);
277 std::shared_ptr<ProcessConfiguration const> processConfiguration,
281 std::vector<std::string>
const& endPathNames,
283 std::unordered_set<std::string>& allConditionalModules);
287 std::shared_ptr<ProcessConfiguration const> processConfiguration,
290 std::vector<std::string>
const& endPathNames,
292 std::unordered_set<std::string>& allConditionalModules);
306 template <
typename T>
309 template <
typename T>
355 reportSvc->reportSkippedEvent(
ep.id().run(),
ep.id().event());
358 template <
typename T>
360 typename T::TransitionInfoType& transitionInfo,
362 bool cleaningUpAfterException) {
364 auto const& principal = transitionInfo.principal();
369 std::exception_ptr
const* iPtr)
mutable {
370 std::exception_ptr excpt;
389 if (T::branchType_ ==
InLumi) {
399 h.presetTaskAsFailed(std::current_exception());
415 oneapi::tbb::task_arena arena{oneapi::tbb::task_arena::attach()};
416 arena.enqueue([
task]() {
423 template <
typename T>
428 std::ostringstream ost;
429 ex.
addContext(
"Handling pre signal, likely in a service function");
436 template <
typename T>
438 std::exception_ptr& excpt)
const noexcept {
443 std::ostringstream ost;
444 ex.
addContext(
"Handling post signal, likely in a service function");
447 excpt = std::current_exception();
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)
AllWorkers const & allWorkersBeginEnd() const
returns the collection of pointers to workers
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]
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
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::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 preScheduleSignal(StreamContext const *) const
void endStream(ExceptionCollector &collector, std::mutex &collectorMutex) noexcept
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 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
WorkerManager workerManagerBeginEnd_
unsigned int number_of_unscheduled_modules_
int totalEventsFailed() const
std::shared_ptr< ActivityRegistry > actReg_
oneapi::tbb::task_group * group() const noexcept
std::vector< WorkerInPath > PathWorkers
std::vector< int > empty_end_paths_
WorkerManager workerManagerRuns_
void moduleDescriptionsInPath(std::string const &iPathLabel, std::vector< ModuleDescription const *> &descriptions, unsigned int hint) const
TrigResConstPtr results() const
void processOneOccurrenceAsync(WaitingTaskHolder, typename T::TransitionInfoType &, ServiceToken const &, StreamID, typename T::Context const *topContext, U const *context) noexcept
StreamContext streamContext_
std::vector< std::string > vstring
AllWorkers const & unscheduledWorkersLumisAndEvents() const
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.
void doneWaiting(std::exception_ptr iExcept) noexcept
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)
void handleException(StreamContext const &, bool cleaningUpAfterException, std::exception_ptr &) const noexcept
AllWorkers const & allWorkersLumisAndEvents() const
void addContext(std::string const &context)
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
void postScheduleSignal(StreamContext const *, std::exception_ptr &) const noexcept
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)
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
WorkerManager workerManagerLumisAndEvents_
std::vector< Path > TrigPaths
AllWorkers const & allWorkersRuns() const
std::vector< EarlyDeleteHelper > earlyDeleteHelpers_