|
|
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;
296 std::shared_ptr<ProcessConfiguration const> processConfiguration,
300 std::vector<std::string>
const& endPathNames);
304 std::shared_ptr<ProcessConfiguration const> processConfiguration,
308 std::vector<std::string>
const& endPathNames);
312 std::shared_ptr<ProcessConfiguration const> processConfiguration,
315 std::vector<std::string>
const& endPathNames);
323 bool allowEarlyDelete);
374 reportSvc->reportSkippedEvent(
ep.id().run(),
ep.id().event());
377 template <
typename T>
379 typename T::TransitionInfoType& transitionInfo,
381 bool cleaningUpAfterException) {
382 auto const& principal = transitionInfo.principal();
385 auto id = principal.id();
387 tbb::task::allocate_root(),
388 [
this, iHolder,
id, cleaningUpAfterException,
token](std::exception_ptr
const* iPtr)
mutable {
389 std::exception_ptr excpt;
397 std::ostringstream ost;
399 ost <<
"Processing " << T::transitionName() <<
" " <<
id;
403 excpt = std::current_exception();
415 excpt = std::current_exception();
431 h.doneWaiting(std::current_exception());
451 tbb::task::spawn(*
task);
453 tbb::task::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_
std::vector< BranchToCount > earlyDeleteBranchToCount_
void completedSuccessfully()
std::vector< WorkerInPath > PathWorkers
FunctorTask< F > * make_functor_task(ALLOC &&iAlloc, F f)
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_
void processOneOccurrenceAsync(WaitingTask *, typename T::TransitionInfoType &, ServiceToken const &, StreamID, typename T::Context const *topContext, U const *context)
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
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
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
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
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_
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_
void reportSkipped(EventPrincipal const &ep) const
SendTerminationSignalIfException(edm::ActivityRegistry *iReg, edm::StreamContext const *iContext)