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>,
179 std::shared_ptr<ActivityRegistry> areg,
180 std::shared_ptr<ProcessConfiguration> processConfiguration,
192 template <
typename T>
194 typename T::TransitionInfoType& transitionInfo,
196 bool cleaningUpAfterException =
false);
212 void availablePaths(std::vector<std::string>& oLabelsToFill)
const;
218 std::vector<ModuleDescription const*>& descriptions,
219 unsigned int hint)
const;
222 std::vector<ModuleDescription const*>& descriptions,
223 unsigned int hint)
const;
252 std::vector<std::string>
const& branchesToDeleteEarly,
303 std::unordered_set<std::string>& conditionalModules,
304 std::multimap<std::string, edm::BranchDescription const*>
const& conditionalModuleBranches,
305 std::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;
414 ost <<
"Processing " << T::transitionName() <<
" " <<
id;
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]() {
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)
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
std::vector< Worker * > tryToPlaceConditionalModules(Worker *, std::unordered_set< std::string > &conditionalModules, std::multimap< std::string, edm::BranchDescription const *> const &conditionalModuleBranches, std::multimap< std::string, AliasInfo > const &aliasMap, ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration)
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_
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
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, BranchIDListHelper &branchIDListHelper, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration > processConfiguration, StreamID streamID, ProcessContext const *processContext)
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()