|
|
Go to the documentation of this file. 1 #ifndef FWCore_Framework_StreamSchedule_h
2 #define FWCore_Framework_StreamSchedule_h
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;
117 class TriggerNamesService;
121 template <
typename T>
122 class StreamScheduleSignalSentry {
124 StreamScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context)
125 : a_(
a), context_(context), allowThrow_(
false) {
127 T::preScheduleSignal(a_, context_);
129 ~StreamScheduleSignalSentry() noexcept(
false) {
133 T::postScheduleSignal(a_, context_);
142 void allowThrow() { allowThrow_ =
true; }
147 typename T::Context
const* context_;
169 std::shared_ptr<ModuleRegistry>,
176 std::shared_ptr<ActivityRegistry> areg,
177 std::shared_ptr<ProcessConfiguration> processConfiguration,
178 bool allowEarlyDelete,
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;
299 std::shared_ptr<ProcessConfiguration const> processConfiguration,
303 std::vector<std::string>
const& endPathNames);
307 std::shared_ptr<ProcessConfiguration const> processConfiguration,
311 std::vector<std::string>
const& endPathNames);
315 std::shared_ptr<ProcessConfiguration const> processConfiguration,
318 std::vector<std::string>
const& endPathNames);
326 bool allowEarlyDelete);
377 reportSvc->reportSkippedEvent(
ep.id().run(),
ep.id().event());
380 template <
typename T>
382 typename T::TransitionInfoType& transitionInfo,
384 bool cleaningUpAfterException) {
385 auto const& principal = transitionInfo.principal();
388 auto id = principal.id();
391 [
this, iHolder,
id, cleaningUpAfterException, weakToken](std::exception_ptr
const* iPtr)
mutable {
392 std::exception_ptr excpt;
400 std::ostringstream ost;
402 ost <<
"Processing " << T::transitionName() <<
" " <<
id;
406 excpt = std::current_exception();
418 excpt = std::current_exception();
434 h.doneWaiting(std::current_exception());
458 tbb::task_arena arena{tbb::task_arena::attach()};
459 arena.enqueue([
task]() {
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 addToAllWorkers(Worker *w)
std::vector< edm::propagate_const< WorkerPtr > > endPathStatusInserterWorkers_
std::vector< int > empty_end_paths_
void clearCounters()
Clear all the counters in the trigger report.
void getTriggerReport(TriggerReport &rep) const
TrigResConstPtr results() const
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 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_
StreamContext streamContext_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< BranchToCount > earlyDeleteBranchToCount_
void completedSuccessfully()
std::vector< WorkerInPath > PathWorkers
int totalEventsPassed() const
std::shared_ptr< HLTGlobalStatus const > TrigResConstPtr
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, bool allowEarlyDelete, StreamID streamID, ProcessContext const *processContext)
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
ExceptionToActionTable const & actionTable() const
unsigned int value() const
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr< Worker > WorkerPtr
void doneWaiting(std::exception_ptr iExcept)
std::vector< std::string > vstring
edm::propagate_const< WorkerPtr > results_inserter_
FunctorTask< F > * make_functor_task(F f)
unsigned int number_of_unscheduled_modules_
void moduleDescriptionsInEndPath(std::string const &iEndPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
void processOneEventAsync(WaitingTaskHolder iTask, EventTransitionInfo &, ServiceToken const &token, std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter >>> &pathStatusInserters)
bool endPathsEnabled() const
auto wrap(F iFunc) -> decltype(iFunc())
StreamContext const & context() const
AllWorkers const & allWorkers() const
void enableEndPaths(bool active)
void replaceModule(maker::ModuleHolder *iMod, std::string const &iLabel)
clone the type of module with label iLabel but configure with iPSet.
ExceptionToActionTable const & actionTable() const
returns the action table
edm::propagate_const< TrigResPtr > results_
std::vector< int > empty_trig_paths_
void initializeEarlyDelete(ModuleRegistry &modReg, edm::ParameterSet const &opts, edm::ProductRegistry const &preg, bool allowEarlyDelete)
void moduleDescriptionsInPath(std::string const &iPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
std::list< std::string > const & context() const
FunctorWaitingTask< F > * make_waiting_task(F f)
std::atomic< bool > skippingEvent_
std::shared_ptr< ActivityRegistry > actReg_
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
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)
std::vector< Worker * > Workers
ServiceToken lock() const
void processOneStreamAsync(WaitingTaskHolder iTask, typename T::TransitionInfoType &transitionInfo, ServiceToken const &token, bool cleaningUpAfterException=false)
std::vector< Path > NonTrigPaths
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
std::vector< Path > TrigPaths
void finishedPaths(std::atomic< std::exception_ptr * > &, WaitingTaskHolder, EventTransitionInfo &)
std::vector< EarlyDeleteHelper > earlyDeleteHelpers_
std::shared_ptr< HLTGlobalStatus > TrigResPtr
unsigned int numberOfUnscheduledModules() const
std::vector< Worker * > AllWorkers
StreamContext const * context_
void processOneOccurrenceAsync(WaitingTaskHolder, typename T::TransitionInfoType &, ServiceToken const &, StreamID, typename T::Context const *topContext, U const *context)
roAction_t actions[nactions]
StreamID streamID() const
PreStreamEarlyTermination preStreamEarlyTerminationSignal_
std::vector< edm::propagate_const< WorkerPtr > > pathStatusInserterWorkers_
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
std::vector< unsigned int > earlyDeleteHelperToBranchIndicies_
edm::ActivityRegistry * reg_
std::exception_ptr finishProcessOneEvent(std::exception_ptr)
int totalEventsFailed() 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
~SendTerminationSignalIfException()
volatile bool endpathsAreActive_
tbb::task_group * group() const noexcept
void reportSkipped(EventPrincipal const &ep) const
SendTerminationSignalIfException(edm::ActivityRegistry *iReg, edm::StreamContext const *iContext)
void deleteModule(std::string const &iLabel)
Delete the module with label iLabel.