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;
118 class TriggerNamesService;
122 template <
typename T>
123 class StreamScheduleSignalSentry {
128 T::preScheduleSignal(a_, context_);
130 ~StreamScheduleSignalSentry() noexcept(
false) {
134 T::postScheduleSignal(a_, context_);
143 void allowThrow() { allowThrow_ =
true; }
148 typename T::Context
const* context_;
170 std::shared_ptr<ModuleRegistry>,
177 std::shared_ptr<ActivityRegistry> areg,
178 std::shared_ptr<ProcessConfiguration> 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,
300 std::unordered_set<std::string>& conditionalModules,
301 std::multimap<std::string, edm::BranchDescription const*>
const& conditionalModuleBranches,
302 std::multimap<std::string, AliasInfo>
const& aliasMap,
306 std::shared_ptr<ProcessConfiguration const> processConfiguration);
310 std::shared_ptr<ProcessConfiguration const> processConfiguration,
314 std::vector<std::string>
const& endPathNames);
318 std::shared_ptr<ProcessConfiguration const> processConfiguration,
322 std::vector<std::string>
const& endPathNames);
326 std::shared_ptr<ProcessConfiguration const> processConfiguration,
329 std::vector<std::string>
const& endPathNames);
383 reportSvc->reportSkippedEvent(
ep.id().run(),
ep.id().event());
386 template <
typename T>
388 typename T::TransitionInfoType& transitionInfo,
390 bool cleaningUpAfterException) {
391 auto const& principal = transitionInfo.principal();
394 auto id = principal.id();
397 [
this, iHolder,
id, cleaningUpAfterException, weakToken](std::exception_ptr
const* iPtr)
mutable {
398 std::exception_ptr excpt;
406 std::ostringstream ost;
408 ost <<
"Processing " << T::transitionName() <<
" " <<
id;
412 excpt = std::current_exception();
424 excpt = std::current_exception();
440 h.doneWaiting(std::current_exception());
464 oneapi::tbb::task_arena arena{oneapi::tbb::task_arena::attach()};
465 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
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
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)
WorkerManager workerManager_
std::shared_ptr< ActivityRegistry > actReg_
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)
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_
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 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)
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.
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()