diff --git a/FWCore/Concurrency/interface/TaskBase.h b/FWCore/Concurrency/interface/TaskBase.h index 9c8aeb37d6d1c..2e194bb3cf64a 100644 --- a/FWCore/Concurrency/interface/TaskBase.h +++ b/FWCore/Concurrency/interface/TaskBase.h @@ -33,13 +33,13 @@ namespace edm { friend class TaskSentry; ///Constructor - TaskBase() : m_refCount{0} {} - virtual ~TaskBase() = default; + TaskBase() noexcept : m_refCount{0} {} + virtual ~TaskBase() noexcept = default; virtual void execute() = 0; - void increment_ref_count() { ++m_refCount; } - unsigned int decrement_ref_count() { return --m_refCount; } + void increment_ref_count() noexcept { ++m_refCount; } + unsigned int decrement_ref_count() noexcept { return --m_refCount; } private: virtual void recycle() { delete this; } @@ -49,7 +49,7 @@ namespace edm { class TaskSentry { public: - TaskSentry(TaskBase* iTask) : m_task{iTask} {} + TaskSentry(TaskBase* iTask) noexcept : m_task{iTask} {} ~TaskSentry() { m_task->recycle(); } TaskSentry() = delete; TaskSentry(TaskSentry const&) = delete; diff --git a/FWCore/Concurrency/interface/WaitingTask.h b/FWCore/Concurrency/interface/WaitingTask.h index 3f517bd2a0105..4895b01ab9c0d 100644 --- a/FWCore/Concurrency/interface/WaitingTask.h +++ b/FWCore/Concurrency/interface/WaitingTask.h @@ -40,15 +40,15 @@ namespace edm { friend class WaitingTaskWithArenaHolder; ///Constructor - WaitingTask() : m_ptr{} {} - ~WaitingTask() override{}; + WaitingTask() noexcept : m_ptr{} {} + ~WaitingTask() noexcept override{}; // ---------- const member functions --------------------------- ///Returns exception thrown by dependent task /** If the value evalutes to true then the dependent task failed. */ - std::exception_ptr exceptionPtr() const { + std::exception_ptr exceptionPtr() const noexcept { if (m_ptrSet == static_cast(State::kSet)) { return m_ptr; } @@ -56,7 +56,7 @@ namespace edm { } protected: - std::exception_ptr const& uncheckedExceptionPtr() const { return m_ptr; } + std::exception_ptr const& uncheckedExceptionPtr() const noexcept { return m_ptr; } private: enum class State : unsigned char { kUnset = 0, kSetting = 1, kSet = 2 }; @@ -65,7 +65,7 @@ namespace edm { * moved to another thread. * This method should only be called by WaitingTaskList */ - void dependentTaskFailed(std::exception_ptr iPtr) { + void dependentTaskFailed(std::exception_ptr iPtr) noexcept { unsigned char isSet = static_cast(State::kUnset); if (iPtr and m_ptrSet.compare_exchange_strong(isSet, static_cast(State::kSetting))) { m_ptr = iPtr; diff --git a/FWCore/Concurrency/interface/WaitingTaskHolder.h b/FWCore/Concurrency/interface/WaitingTaskHolder.h index 57fcc6f31898f..9b813900fe4f2 100644 --- a/FWCore/Concurrency/interface/WaitingTaskHolder.h +++ b/FWCore/Concurrency/interface/WaitingTaskHolder.h @@ -36,32 +36,32 @@ namespace edm { WaitingTaskHolder() : m_task(nullptr), m_group(nullptr) {} - explicit WaitingTaskHolder(oneapi::tbb::task_group& iGroup, edm::WaitingTask* iTask) + explicit WaitingTaskHolder(oneapi::tbb::task_group& iGroup, edm::WaitingTask* iTask) noexcept : m_task(iTask), m_group(&iGroup) { m_task->increment_ref_count(); } - ~WaitingTaskHolder() { + ~WaitingTaskHolder() noexcept { if (m_task) { doneWaiting(std::exception_ptr{}); } } - WaitingTaskHolder(const WaitingTaskHolder& iHolder) : m_task(iHolder.m_task), m_group(iHolder.m_group) { + WaitingTaskHolder(const WaitingTaskHolder& iHolder) noexcept : m_task(iHolder.m_task), m_group(iHolder.m_group) { m_task->increment_ref_count(); } - WaitingTaskHolder(WaitingTaskHolder&& iOther) : m_task(iOther.m_task), m_group(iOther.m_group) { + WaitingTaskHolder(WaitingTaskHolder&& iOther) noexcept : m_task(iOther.m_task), m_group(iOther.m_group) { iOther.m_task = nullptr; } - WaitingTaskHolder& operator=(const WaitingTaskHolder& iRHS) { + WaitingTaskHolder& operator=(const WaitingTaskHolder& iRHS) noexcept { WaitingTaskHolder tmp(iRHS); std::swap(m_task, tmp.m_task); std::swap(m_group, tmp.m_group); return *this; } - WaitingTaskHolder& operator=(WaitingTaskHolder&& iRHS) { + WaitingTaskHolder& operator=(WaitingTaskHolder&& iRHS) noexcept { WaitingTaskHolder tmp(std::move(iRHS)); std::swap(m_task, tmp.m_task); std::swap(m_group, tmp.m_group); @@ -85,13 +85,13 @@ namespace edm { a different, but related failure. You must later call doneWaiting in the same thread passing the same exceptoin. */ - void presetTaskAsFailed(std::exception_ptr iExcept) { + void presetTaskAsFailed(std::exception_ptr iExcept) noexcept { if (iExcept) { m_task->dependentTaskFailed(iExcept); } } - void doneWaiting(std::exception_ptr iExcept) { + void doneWaiting(std::exception_ptr iExcept) noexcept { if (iExcept) { m_task->dependentTaskFailed(iExcept); } diff --git a/FWCore/Framework/interface/Callback.h b/FWCore/Framework/interface/Callback.h index 6975d19f09c13..9cc51184343c1 100644 --- a/FWCore/Framework/interface/Callback.h +++ b/FWCore/Framework/interface/Callback.h @@ -56,7 +56,7 @@ namespace edm { EventSetupRecordImpl const* iRecord, EventSetupImpl const* iEventSetupImpl, ServiceToken const& token, - ESParentContext const& iParent) { + ESParentContext const& iParent) noexcept { return Base::prefetchAsyncImpl( [this](auto&& group, auto&& token, auto&& record, auto&& es) { constexpr bool emitPostPrefetchingSignal = true; diff --git a/FWCore/Framework/interface/CallbackBase.h b/FWCore/Framework/interface/CallbackBase.h index 814001527bc1e..cec3d158fb14c 100644 --- a/FWCore/Framework/interface/CallbackBase.h +++ b/FWCore/Framework/interface/CallbackBase.h @@ -165,7 +165,7 @@ namespace edm { EventSetupRecordImpl const* iRecord, EventSetupImpl const* iEventSetupImpl, ServiceToken const& token, - ESParentContext const& iParent) { + ESParentContext const& iParent) noexcept { bool expected = false; auto doPrefetch = wasCalledForThisRecord_.compare_exchange_strong(expected, true); taskList_.add(iTask); @@ -221,16 +221,16 @@ namespace edm { taskList_.reset(); } - unsigned int transitionID() const { return id_; } - ESResolverIndex const* getTokenIndices() const { return producer_->getTokenIndices(id_); } + unsigned int transitionID() const noexcept { return id_; } + ESResolverIndex const* getTokenIndices() const noexcept { return producer_->getTokenIndices(id_); } std::optional> const& postMayGetResolvers() const { return postMayGetResolvers_; } - T* producer() { return producer_.get(); } - ESModuleCallingContext& callingContext() { return callingContext_; } - WaitingTaskList& taskList() { return taskList_; } - std::shared_ptr const& produceFunction() { return produceFunction_; } - TDecorator const& decorator() const { return decorator_; } - SerialTaskQueueChain& queue() { return producer_->queue(); } + T* producer() noexcept { return producer_.get(); } + ESModuleCallingContext& callingContext() noexcept { return callingContext_; } + WaitingTaskList& taskList() noexcept { return taskList_; } + std::shared_ptr const& produceFunction() noexcept { return produceFunction_; } + TDecorator const& decorator() const noexcept { return decorator_; } + SerialTaskQueueChain& queue() noexcept { return producer_->queue(); } protected: ~CallbackBase() = default; @@ -244,7 +244,7 @@ namespace edm { void prefetchNeededDataAsync(WaitingTaskHolder task, EventSetupImpl const* iImpl, ESResolverIndex const* proxies, - ServiceToken const& token) const { + ServiceToken const& token) const noexcept { auto recs = producer_->getTokenRecordIndices(id_); auto n = producer_->numberOfTokenIndices(id_); for (size_t i = 0; i != n; ++i) { diff --git a/FWCore/Framework/interface/CallbackExternalWork.h b/FWCore/Framework/interface/CallbackExternalWork.h index 362993c48cd67..cbacdbc690564 100644 --- a/FWCore/Framework/interface/CallbackExternalWork.h +++ b/FWCore/Framework/interface/CallbackExternalWork.h @@ -101,7 +101,7 @@ namespace edm { EventSetupRecordImpl const* iRecord, EventSetupImpl const* iEventSetupImpl, ServiceToken const& token, - ESParentContext const& iParent) { + ESParentContext const& iParent) noexcept { return Base::prefetchAsyncImpl( [this](auto&& group, auto&& token, auto&& record, auto&& es) { constexpr bool emitPostPrefetchingSignal = false; diff --git a/FWCore/Framework/interface/CallbackProductResolver.h b/FWCore/Framework/interface/CallbackProductResolver.h index a557d84bd75ae..5006a1abc30fa 100644 --- a/FWCore/Framework/interface/CallbackProductResolver.h +++ b/FWCore/Framework/interface/CallbackProductResolver.h @@ -59,7 +59,7 @@ namespace edm::eventsetup { const DataKey&, EventSetupImpl const* iEventSetupImpl, ServiceToken const& iToken, - edm::ESParentContext const& iParent) final { + edm::ESParentContext const& iParent) noexcept final { assert(iRecord.key() == RecordT::keyForClass()); callback_->prefetchAsync(iWaitTask, &iRecord, iEventSetupImpl, iToken, iParent); } diff --git a/FWCore/Framework/interface/EDLooperBase.h b/FWCore/Framework/interface/EDLooperBase.h index 49993c2e20c7f..3a9d671d86720 100644 --- a/FWCore/Framework/interface/EDLooperBase.h +++ b/FWCore/Framework/interface/EDLooperBase.h @@ -107,12 +107,12 @@ namespace edm { ServiceToken const& token, Transition iTrans, Principal const& iPrincipal, - EventSetupImpl const& iImpl) const; + EventSetupImpl const& iImpl) const noexcept; void esPrefetchAsync(WaitingTaskHolder iTask, EventSetupImpl const& iImpl, Transition iTrans, - ServiceToken const& iToken) const; + ServiceToken const& iToken) const noexcept; ///Override this method if you need to monitor the state of the processing virtual void attachTo(ActivityRegistry&); @@ -159,7 +159,9 @@ namespace edm { ///Called after all event modules have processed the end of a LuminosityBlock virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&); - void edPrefetchAsync(WaitingTaskHolder iTask, ServiceToken const& token, Principal const& iPrincipal) const; + void edPrefetchAsync(WaitingTaskHolder iTask, + ServiceToken const& token, + Principal const& iPrincipal) const noexcept; unsigned int iCounter_; ExceptionToActionTable const* act_table_; diff --git a/FWCore/Framework/interface/ESProductResolver.h b/FWCore/Framework/interface/ESProductResolver.h index 97937c882e119..470f94c329940 100644 --- a/FWCore/Framework/interface/ESProductResolver.h +++ b/FWCore/Framework/interface/ESProductResolver.h @@ -52,7 +52,7 @@ namespace edm { DataKey const&, EventSetupImpl const*, ServiceToken const&, - ESParentContext const&) const; + ESParentContext const&) const noexcept; void const* getAfterPrefetch(const EventSetupRecordImpl& iRecord, const DataKey& iKey, bool iTransiently) const; @@ -83,7 +83,7 @@ namespace edm { DataKey const& iKey, EventSetupImpl const*, ServiceToken const&, - ESParentContext const&) = 0; + ESParentContext const&) noexcept = 0; /** indicates that the Resolver should invalidate any cached information as that information has 'expired' (i.e. we have moved to a new IOV) diff --git a/FWCore/Framework/interface/ESProductResolverTemplate.h b/FWCore/Framework/interface/ESProductResolverTemplate.h index 82ae697e0c6d7..718760206b474 100644 --- a/FWCore/Framework/interface/ESProductResolverTemplate.h +++ b/FWCore/Framework/interface/ESProductResolverTemplate.h @@ -62,7 +62,7 @@ namespace edm { const DataKey& iKey, EventSetupImpl const* iEventSetupImpl, edm::ServiceToken const& iToken, - edm::ESParentContext const& iParent) override { + edm::ESParentContext const& iParent) noexcept override { assert(iRecord.key() == RecordT::keyForClass()); bool expected = false; bool doPrefetch = prefetching_.compare_exchange_strong(expected, true); diff --git a/FWCore/Framework/interface/ESSourceProductResolverConcurrentBase.h b/FWCore/Framework/interface/ESSourceProductResolverConcurrentBase.h index ad15e8f555ac1..5984d35651956 100644 --- a/FWCore/Framework/interface/ESSourceProductResolverConcurrentBase.h +++ b/FWCore/Framework/interface/ESSourceProductResolverConcurrentBase.h @@ -39,7 +39,7 @@ namespace edm::eventsetup { edm::eventsetup::DataKey const& iKey, edm::EventSetupImpl const*, edm::ServiceToken const&, - edm::ESParentContext const&) final; + edm::ESParentContext const&) noexcept final; // ---------- member data -------------------------------- }; diff --git a/FWCore/Framework/interface/ESSourceProductResolverNonConcurrentBase.h b/FWCore/Framework/interface/ESSourceProductResolverNonConcurrentBase.h index 855c64d1e1792..23a1815eaee16 100644 --- a/FWCore/Framework/interface/ESSourceProductResolverNonConcurrentBase.h +++ b/FWCore/Framework/interface/ESSourceProductResolverNonConcurrentBase.h @@ -47,7 +47,7 @@ namespace edm::eventsetup { edm::eventsetup::DataKey const& iKey, edm::EventSetupImpl const*, edm::ServiceToken const&, - edm::ESParentContext const&) final; + edm::ESParentContext const&) noexcept final; // ---------- member data -------------------------------- diff --git a/FWCore/Framework/interface/EventForTransformer.h b/FWCore/Framework/interface/EventForTransformer.h index 4b627e6d2f861..9ff3f97460377 100644 --- a/FWCore/Framework/interface/EventForTransformer.h +++ b/FWCore/Framework/interface/EventForTransformer.h @@ -28,13 +28,13 @@ namespace edm { class EventForTransformer { public: - EventForTransformer(EventPrincipal const&, ModuleCallingContext); + EventForTransformer(EventPrincipal const&, ModuleCallingContext) noexcept; BasicHandle get(edm::TypeID const& iTypeID, ProductResolverIndex iIndex) const; void put(ProductResolverIndex index, std::unique_ptr edp, BasicHandle const& iGetHandle); - ModuleCallingContext const& moduleCallingContext() const { return mcc_; } + ModuleCallingContext const& moduleCallingContext() const noexcept { return mcc_; } private: EventPrincipal const& eventPrincipal_; diff --git a/FWCore/Framework/interface/EventSetupRecordImpl.h b/FWCore/Framework/interface/EventSetupRecordImpl.h index 9d725927b859b..d728eddec8d91 100644 --- a/FWCore/Framework/interface/EventSetupRecordImpl.h +++ b/FWCore/Framework/interface/EventSetupRecordImpl.h @@ -87,7 +87,7 @@ namespace edm { ESResolverIndex iResolverIndex, EventSetupImpl const*, ServiceToken const&, - ESParentContext) const; + ESParentContext) const noexcept; /**returns true only if someone has already requested data for this key and the data was retrieved diff --git a/FWCore/Framework/interface/OutputModuleCommunicator.h b/FWCore/Framework/interface/OutputModuleCommunicator.h index a0fbdb6d54ec5..fef592e46fadd 100644 --- a/FWCore/Framework/interface/OutputModuleCommunicator.h +++ b/FWCore/Framework/interface/OutputModuleCommunicator.h @@ -57,18 +57,18 @@ namespace edm { virtual void writeProcessBlockAsync(WaitingTaskHolder iTask, ProcessBlockPrincipal const&, ProcessContext const*, - ActivityRegistry*) = 0; + ActivityRegistry*) noexcept = 0; virtual void writeRunAsync(WaitingTaskHolder iTask, RunPrincipal const&, ProcessContext const*, ActivityRegistry*, - MergeableRunProductMetadata const*) = 0; + MergeableRunProductMetadata const*) noexcept = 0; virtual void writeLumiAsync(WaitingTaskHolder iTask, LuminosityBlockPrincipal const&, ProcessContext const*, - ActivityRegistry*) = 0; + ActivityRegistry*) noexcept = 0; ///\return true if OutputModule has reached its limit on maximum number of events it wants to see virtual bool limitReached() const = 0; diff --git a/FWCore/Framework/interface/OutputModuleCommunicatorT.h b/FWCore/Framework/interface/OutputModuleCommunicatorT.h index f81035de8f1ae..31bbbca4e5794 100644 --- a/FWCore/Framework/interface/OutputModuleCommunicatorT.h +++ b/FWCore/Framework/interface/OutputModuleCommunicatorT.h @@ -46,18 +46,18 @@ namespace edm { void writeProcessBlockAsync(WaitingTaskHolder iTask, ProcessBlockPrincipal const&, ProcessContext const*, - ActivityRegistry*) override; + ActivityRegistry*) noexcept override; void writeRunAsync(WaitingTaskHolder iTask, edm::RunPrincipal const& rp, ProcessContext const*, ActivityRegistry*, - MergeableRunProductMetadata const*) override; + MergeableRunProductMetadata const*) noexcept override; void writeLumiAsync(WaitingTaskHolder iTask, edm::LuminosityBlockPrincipal const& lbp, ProcessContext const*, - ActivityRegistry*) override; + ActivityRegistry*) noexcept override; ///\return true if OutputModule has reached its limit on maximum number of events it wants to see bool limitReached() const override; @@ -81,7 +81,7 @@ namespace edm { } private: - inline T& module() const { return *module_; } + inline T& module() const noexcept { return *module_; } T* module_; }; } // namespace edm diff --git a/FWCore/Framework/interface/OutputModuleCore.h b/FWCore/Framework/interface/OutputModuleCore.h index 65b8169d655b9..68b28b29bf4ae 100644 --- a/FWCore/Framework/interface/OutputModuleCore.h +++ b/FWCore/Framework/interface/OutputModuleCore.h @@ -217,8 +217,8 @@ namespace edm { void registerProductsAndCallbacks(OutputModuleCore const*, ProductRegistry*); - bool needToRunSelection() const; - std::vector productsUsedBySelection() const; + bool needToRunSelection() const noexcept; + std::vector productsUsedBySelection() const noexcept; bool prePrefetchSelection(StreamID id, EventPrincipal const&, ModuleCallingContext const*); // Do the end-of-file tasks; this is only called internally, after @@ -247,7 +247,7 @@ namespace edm { virtual void setProcessesWithSelectedMergeableRunProducts(std::set const&) {} - bool hasAccumulator() const { return false; } + bool hasAccumulator() const noexcept { return false; } void keepThisBranch(BranchDescription const& desc, std::map& trueBranchIDToKeptBranchDesc, diff --git a/FWCore/Framework/interface/ProductProvenanceRetriever.h b/FWCore/Framework/interface/ProductProvenanceRetriever.h index b9b99fb90acd3..dec75fa54d065 100644 --- a/FWCore/Framework/interface/ProductProvenanceRetriever.h +++ b/FWCore/Framework/interface/ProductProvenanceRetriever.h @@ -31,7 +31,7 @@ namespace edm { virtual void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const* moduleCallingContext, unsigned int transitionIndex, - std::atomic*>& writeTo) const = 0; + std::atomic*>& writeTo) const noexcept = 0; }; class ProductProvenanceRetriever : public ProductProvenanceLookup { @@ -50,7 +50,7 @@ namespace edm { void reset(); - void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const* moduleCallingContext) const; + void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const* moduleCallingContext) const noexcept; private: std::unique_ptr> readProvenance() const final; diff --git a/FWCore/Framework/interface/ProductResolverBase.h b/FWCore/Framework/interface/ProductResolverBase.h index 4c7e094c028de..8eecac4afd141 100644 --- a/FWCore/Framework/interface/ProductResolverBase.h +++ b/FWCore/Framework/interface/ProductResolverBase.h @@ -71,7 +71,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const { + ModuleCallingContext const* mcc) const noexcept { return prefetchAsync_(waitTask, principal, skipCurrentProcess, token, sra, mcc); } @@ -172,7 +172,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const = 0; + ModuleCallingContext const* mcc) const noexcept = 0; virtual void retrieveAndMerge_(Principal const& principal, MergeableRunProductMetadata const* mergeableRunProductMetadata) const; diff --git a/FWCore/Framework/interface/TransformerBase.h b/FWCore/Framework/interface/TransformerBase.h index 3c5eb94ccec7d..3753efcfd55af 100644 --- a/FWCore/Framework/interface/TransformerBase.h +++ b/FWCore/Framework/interface/TransformerBase.h @@ -45,13 +45,15 @@ namespace edm { void registerTransformAsyncImp( ProducerBase&, EDPutToken, const TypeID& id, std::string instanceName, PreTransformFunction, TransformFunction); - std::size_t findMatchingIndex(ProducerBase const& iBase, edm::BranchDescription const&) const; - ProductResolverIndex prefetchImp(std::size_t iIndex) const { return transformInfo_.get(iIndex); } + std::size_t findMatchingIndex(ProducerBase const& iBase, edm::BranchDescription const&) const noexcept; + ProductResolverIndex prefetchImp(std::size_t iIndex) const noexcept { + return transformInfo_.get(iIndex); + } void transformImpAsync(WaitingTaskHolder iTask, std::size_t iIndex, edm::ActivityRegistry* iAct, ProducerBase const& iBase, - edm::EventForTransformer&) const; + edm::EventForTransformer&) const noexcept; void extendUpdateLookup(ProducerBase const&, ModuleDescription const& iModuleDesc, diff --git a/FWCore/Framework/interface/UnscheduledCallProducer.h b/FWCore/Framework/interface/UnscheduledCallProducer.h index c41a3ba53c801..e6fe14fa58088 100644 --- a/FWCore/Framework/interface/UnscheduledCallProducer.h +++ b/FWCore/Framework/interface/UnscheduledCallProducer.h @@ -73,7 +73,7 @@ namespace edm { ServiceToken const& token, StreamID streamID, typename T::Context const* topContext, - U const* context) const { + U const* context) const noexcept { //do nothing for event since we will run when requested if (!T::isEvent_) { for (auto worker : unscheduledWorkers_) { @@ -95,7 +95,7 @@ namespace edm { ServiceToken const& token, StreamID streamID, ParentContext const& parentContext, - typename T::Context const* context) { + typename T::Context const* context) noexcept { for (auto worker : accumulatorWorkers_) { worker->doWorkAsync(task, info, token, streamID, parentContext, context); } diff --git a/FWCore/Framework/interface/global/EDAnalyzer.h b/FWCore/Framework/interface/global/EDAnalyzer.h index eb87e8d5f5f09..df9103cf446f3 100644 --- a/FWCore/Framework/interface/global/EDAnalyzer.h +++ b/FWCore/Framework/interface/global/EDAnalyzer.h @@ -42,13 +42,17 @@ namespace edm { virtual ~EDAnalyzer() {} #endif // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } - bool wantsStreamRuns() const final { return WantsStreamRunTransitions::value; } - bool wantsStreamLuminosityBlocks() const final { return WantsStreamLuminosityBlockTransitions::value; } + bool wantsStreamRuns() const noexcept final { return WantsStreamRunTransitions::value; } + bool wantsStreamLuminosityBlocks() const noexcept final { + return WantsStreamLuminosityBlockTransitions::value; + } // ---------- static member functions -------------------- diff --git a/FWCore/Framework/interface/global/EDAnalyzerBase.h b/FWCore/Framework/interface/global/EDAnalyzerBase.h index d05a8b8361f0f..7086bccfb11cb 100644 --- a/FWCore/Framework/interface/global/EDAnalyzerBase.h +++ b/FWCore/Framework/interface/global/EDAnalyzerBase.h @@ -61,12 +61,12 @@ namespace edm { // Warning: the returned moduleDescription will be invalid during construction ModuleDescription const& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; void callWhenNewProductsRegistered(std::function const& func) { callWhenNewProductsRegistered_ = func; @@ -77,7 +77,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, - Principal const&) const {} + Principal const&) const noexcept {} void doPreallocate(PreallocationConfiguration const&); void doBeginJob(); @@ -139,8 +139,8 @@ namespace edm { virtual void clearInputProcessBlockCaches(); - bool hasAcquire() const { return false; } - bool hasAccumulator() const { return false; } + bool hasAcquire() const noexcept { return false; } + bool hasAccumulator() const noexcept { return false; } void setModuleDescription(ModuleDescription const& md) { moduleDescription_ = md; } ModuleDescription moduleDescription_; diff --git a/FWCore/Framework/interface/global/EDFilter.h b/FWCore/Framework/interface/global/EDFilter.h index 1750e4782fbd2..dd9a5a88fe929 100644 --- a/FWCore/Framework/interface/global/EDFilter.h +++ b/FWCore/Framework/interface/global/EDFilter.h @@ -48,13 +48,17 @@ namespace edm { virtual ~EDFilter() = default; #endif // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } - bool wantsStreamRuns() const final { return WantsStreamRunTransitions::value; } - bool wantsStreamLuminosityBlocks() const final { return WantsStreamLuminosityBlockTransitions::value; } + bool wantsStreamRuns() const noexcept final { return WantsStreamRunTransitions::value; } + bool wantsStreamLuminosityBlocks() const noexcept final { + return WantsStreamLuminosityBlockTransitions::value; + } bool hasAbilityToProduceInBeginProcessBlocks() const final { return HasAbilityToProduceInBeginProcessBlocks::value; diff --git a/FWCore/Framework/interface/global/EDFilterBase.h b/FWCore/Framework/interface/global/EDFilterBase.h index e3152c315c6d0..c1b2cae96cbf5 100644 --- a/FWCore/Framework/interface/global/EDFilterBase.h +++ b/FWCore/Framework/interface/global/EDFilterBase.h @@ -66,12 +66,12 @@ namespace edm { // Warning: the returned moduleDescription will be invalid during construction ModuleDescription const& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; private: bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*); @@ -84,11 +84,11 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry*, ModuleCallingContext, - ServiceWeakToken const&); + ServiceWeakToken const&) noexcept; //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& iModuleCallingContext, - Principal const& iPrincipal) const {} + Principal const& iPrincipal) const noexcept {} void doPreallocate(PreallocationConfiguration const&); void doBeginJob(); @@ -157,17 +157,17 @@ namespace edm { virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); - virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const; - virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const; + virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept; + virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept; virtual void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const; + ServiceWeakToken const& iToken) const noexcept; virtual void clearInputProcessBlockCaches(); - virtual bool hasAcquire() const { return false; } - bool hasAccumulator() const { return false; } + virtual bool hasAcquire() const noexcept { return false; } + bool hasAccumulator() const noexcept { return false; } virtual void doAcquire_(StreamID, Event const&, edm::EventSetup const&, WaitingTaskWithArenaHolder&); diff --git a/FWCore/Framework/interface/global/EDProducer.h b/FWCore/Framework/interface/global/EDProducer.h index 36b51eab9849e..192218307a4a0 100644 --- a/FWCore/Framework/interface/global/EDProducer.h +++ b/FWCore/Framework/interface/global/EDProducer.h @@ -42,13 +42,17 @@ namespace edm { EDProducer& operator=(const EDProducer&) = delete; // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } - bool wantsStreamRuns() const final { return WantsStreamRunTransitions::value; } - bool wantsStreamLuminosityBlocks() const final { return WantsStreamLuminosityBlockTransitions::value; } + bool wantsStreamRuns() const noexcept final { return WantsStreamRunTransitions::value; } + bool wantsStreamLuminosityBlocks() const noexcept final { + return WantsStreamLuminosityBlockTransitions::value; + } bool hasAbilityToProduceInBeginProcessBlocks() const final { return HasAbilityToProduceInBeginProcessBlocks::value; diff --git a/FWCore/Framework/interface/global/EDProducerBase.h b/FWCore/Framework/interface/global/EDProducerBase.h index 0a8fda6f86af3..e41ad995bbdf2 100644 --- a/FWCore/Framework/interface/global/EDProducerBase.h +++ b/FWCore/Framework/interface/global/EDProducerBase.h @@ -69,12 +69,12 @@ namespace edm { // Warning: the returned moduleDescription will be invalid during construction ModuleDescription const& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; private: bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*); @@ -87,7 +87,7 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry*, ModuleCallingContext, - ServiceWeakToken const&); + ServiceWeakToken const&) noexcept; void doPreallocate(PreallocationConfiguration const&); void doBeginJob(); void doEndJob(); @@ -121,7 +121,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& iModuleCallingContext, - Principal const& iPrincipal) const {} + Principal const& iPrincipal) const noexcept {} virtual void beginJob() {} virtual void endJob() {} @@ -160,18 +160,18 @@ namespace edm { virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); - virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const; - virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const; + virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept; + virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept; virtual void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const; + ServiceWeakToken const& iToken) const noexcept; virtual void clearInputProcessBlockCaches(); - virtual bool hasAccumulator() const { return false; } + virtual bool hasAccumulator() const noexcept { return false; } - virtual bool hasAcquire() const { return false; } + virtual bool hasAcquire() const noexcept { return false; } virtual void doAcquire_(StreamID, Event const&, edm::EventSetup const&, WaitingTaskWithArenaHolder&); diff --git a/FWCore/Framework/interface/global/OutputModule.h b/FWCore/Framework/interface/global/OutputModule.h index 486728d5fa732..aec2d428cfb41 100644 --- a/FWCore/Framework/interface/global/OutputModule.h +++ b/FWCore/Framework/interface/global/OutputModule.h @@ -41,10 +41,12 @@ namespace edm { #endif // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsStreamRuns() const final { return WantsStreamRunTransitions::value; } - bool wantsStreamLuminosityBlocks() const final { return WantsStreamLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsStreamRuns() const noexcept final { return WantsStreamRunTransitions::value; } + bool wantsStreamLuminosityBlocks() const noexcept final { + return WantsStreamLuminosityBlockTransitions::value; + } // ---------- static member functions -------------------- diff --git a/FWCore/Framework/interface/global/OutputModuleBase.h b/FWCore/Framework/interface/global/OutputModuleBase.h index 7ed8dbd6ca1b8..38ebb5ec88962 100644 --- a/FWCore/Framework/interface/global/OutputModuleBase.h +++ b/FWCore/Framework/interface/global/OutputModuleBase.h @@ -42,13 +42,13 @@ namespace edm { OutputModuleBase& operator=(OutputModuleBase const&) = delete; // Disallow copying and moving //Output modules always need writeRun and writeLumi to be called - bool wantsGlobalRuns() const { return true; } - bool wantsGlobalLuminosityBlocks() const { return true; } + bool wantsGlobalRuns() const noexcept { return true; } + bool wantsGlobalLuminosityBlocks() const noexcept { return true; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; protected: void doPreallocate(PreallocationConfiguration const&); @@ -66,7 +66,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& iModuleCallingContext, - Principal const& iPrincipal) const {} + Principal const& iPrincipal) const noexcept {} private: std::string workerType() const { return "WorkerT"; } @@ -88,7 +88,7 @@ namespace edm { virtual void doEndLuminosityBlockSummary_(LuminosityBlockForOutput const&, EventSetup const&) {} virtual void doAcquire_(StreamID, EventForOutput const&, WaitingTaskWithArenaHolder&) {} - virtual bool hasAcquire() const { return false; } + virtual bool hasAcquire() const noexcept { return false; } }; } // namespace global } // namespace edm diff --git a/FWCore/Framework/interface/global/implementors.h b/FWCore/Framework/interface/global/implementors.h index 83cc2fbd1072c..626c65e964848 100644 --- a/FWCore/Framework/interface/global/implementors.h +++ b/FWCore/Framework/interface/global/implementors.h @@ -434,7 +434,7 @@ namespace edm { ~ExternalWork() noexcept(false) override{}; private: - bool hasAcquire() const override { return true; } + bool hasAcquire() const noexcept override { return true; } void doAcquire_(StreamID, Event const&, edm::EventSetup const&, WaitingTaskWithArenaHolder&) final; @@ -450,7 +450,7 @@ namespace edm { ~Accumulator() noexcept(false) override{}; private: - bool hasAccumulator() const override { return true; } + bool hasAccumulator() const noexcept override { return true; } void produce(StreamID streamID, Event& ev, EventSetup const& es) const final { accumulate(streamID, ev, es); } @@ -511,17 +511,17 @@ namespace edm { } private: - size_t transformIndex_(edm::BranchDescription const& iBranch) const final { + size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept final { return TransformerBase::findMatchingIndex(*this, iBranch); } - ProductResolverIndex transformPrefetch_(std::size_t iIndex) const final { + ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept final { return TransformerBase::prefetchImp(iIndex); } void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const final { + ServiceWeakToken const& iToken) const noexcept final { return TransformerBase::transformImpAsync(std::move(iTask), iIndex, iAct, *this, iEvent); } void extendUpdateLookup(BranchType iBranchType, ProductResolverIndexHelper const& iHelper) override { diff --git a/FWCore/Framework/interface/global/outputmoduleAbilityToImplementor.h b/FWCore/Framework/interface/global/outputmoduleAbilityToImplementor.h index 9d57a1eb276fb..88cf3e869c861 100644 --- a/FWCore/Framework/interface/global/outputmoduleAbilityToImplementor.h +++ b/FWCore/Framework/interface/global/outputmoduleAbilityToImplementor.h @@ -139,7 +139,7 @@ namespace edm { ~ExternalWork() noexcept(false) override{}; private: - bool hasAcquire() const override { return true; } + bool hasAcquire() const noexcept override { return true; } void doAcquire_(StreamID id, EventForOutput const& event, WaitingTaskWithArenaHolder& holder) final { acquire(id, event, holder); diff --git a/FWCore/Framework/interface/limited/EDAnalyzer.h b/FWCore/Framework/interface/limited/EDAnalyzer.h index ec5cd655b8e0b..44e7e048ed5fc 100644 --- a/FWCore/Framework/interface/limited/EDAnalyzer.h +++ b/FWCore/Framework/interface/limited/EDAnalyzer.h @@ -40,12 +40,16 @@ namespace edm { virtual ~EDAnalyzer() {} #endif // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } - bool wantsStreamRuns() const final { return WantsStreamRunTransitions::value; } - bool wantsStreamLuminosityBlocks() const final { return WantsStreamLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } + bool wantsStreamRuns() const noexcept final { return WantsStreamRunTransitions::value; } + bool wantsStreamLuminosityBlocks() const noexcept final { + return WantsStreamLuminosityBlockTransitions::value; + } // ---------- static member functions -------------------- diff --git a/FWCore/Framework/interface/limited/EDAnalyzerBase.h b/FWCore/Framework/interface/limited/EDAnalyzerBase.h index cb6fa7a82c555..7a843b803c660 100644 --- a/FWCore/Framework/interface/limited/EDAnalyzerBase.h +++ b/FWCore/Framework/interface/limited/EDAnalyzerBase.h @@ -62,12 +62,12 @@ namespace edm { // Warning: the returned moduleDescription will be invalid during construction ModuleDescription const& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; void callWhenNewProductsRegistered(std::function const& func) { callWhenNewProductsRegistered_ = func; @@ -82,7 +82,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& iModuleCallingContext, - Principal const& iPrincipal) const {} + Principal const& iPrincipal) const noexcept {} void doPreallocate(PreallocationConfiguration const&); void doBeginJob(); @@ -144,8 +144,8 @@ namespace edm { virtual void clearInputProcessBlockCaches(); - bool hasAcquire() const { return false; } - bool hasAccumulator() const { return false; } + bool hasAcquire() const noexcept { return false; } + bool hasAccumulator() const noexcept { return false; } void setModuleDescription(ModuleDescription const& md) { moduleDescription_ = md; } ModuleDescription moduleDescription_; diff --git a/FWCore/Framework/interface/limited/EDFilter.h b/FWCore/Framework/interface/limited/EDFilter.h index e8ace6806d208..47b4b17ca4447 100644 --- a/FWCore/Framework/interface/limited/EDFilter.h +++ b/FWCore/Framework/interface/limited/EDFilter.h @@ -52,12 +52,16 @@ namespace edm { virtual ~EDFilter() = default; #endif // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } - bool wantsStreamRuns() const final { return WantsStreamRunTransitions::value; } - bool wantsStreamLuminosityBlocks() const final { return WantsStreamLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } + bool wantsStreamRuns() const noexcept final { return WantsStreamRunTransitions::value; } + bool wantsStreamLuminosityBlocks() const noexcept final { + return WantsStreamLuminosityBlockTransitions::value; + } bool hasAbilityToProduceInBeginProcessBlocks() const final { return HasAbilityToProduceInBeginProcessBlocks::value; diff --git a/FWCore/Framework/interface/limited/EDFilterBase.h b/FWCore/Framework/interface/limited/EDFilterBase.h index 2496ff84d1674..d9aa7e72b1411 100644 --- a/FWCore/Framework/interface/limited/EDFilterBase.h +++ b/FWCore/Framework/interface/limited/EDFilterBase.h @@ -66,12 +66,12 @@ namespace edm { // Warning: the returned moduleDescription will be invalid during construction ModuleDescription const& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; unsigned int concurrencyLimit() const { return queue_.concurrencyLimit(); } @@ -84,12 +84,12 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry*, ModuleCallingContext, - ServiceWeakToken const&); + ServiceWeakToken const&) noexcept; //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, - Principal const&) const {} + Principal const&) const noexcept {} void doPreallocate(PreallocationConfiguration const&); void doBeginJob(); @@ -158,18 +158,18 @@ namespace edm { virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); - virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const; - virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const; + virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept; + virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept; virtual void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const; + ServiceWeakToken const& iToken) const noexcept; virtual void clearInputProcessBlockCaches(); - bool hasAcquire() const { return false; } - bool hasAccumulator() const { return false; } + bool hasAcquire() const noexcept { return false; } + bool hasAccumulator() const noexcept { return false; } void setModuleDescription(ModuleDescription const& md) { moduleDescription_ = md; } ModuleDescription moduleDescription_; diff --git a/FWCore/Framework/interface/limited/EDProducer.h b/FWCore/Framework/interface/limited/EDProducer.h index caaf7061fdcd0..0679eafa8d1c2 100644 --- a/FWCore/Framework/interface/limited/EDProducer.h +++ b/FWCore/Framework/interface/limited/EDProducer.h @@ -47,12 +47,16 @@ namespace edm { T>::Type(iPSet)... {} // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } - bool wantsStreamRuns() const final { return WantsStreamRunTransitions::value; } - bool wantsStreamLuminosityBlocks() const final { return WantsStreamLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } + bool wantsStreamRuns() const noexcept final { return WantsStreamRunTransitions::value; } + bool wantsStreamLuminosityBlocks() const noexcept final { + return WantsStreamLuminosityBlockTransitions::value; + } bool hasAbilityToProduceInBeginProcessBlocks() const final { return HasAbilityToProduceInBeginProcessBlocks::value; diff --git a/FWCore/Framework/interface/limited/EDProducerBase.h b/FWCore/Framework/interface/limited/EDProducerBase.h index c123c2125648b..0fe2b6f5c9e13 100644 --- a/FWCore/Framework/interface/limited/EDProducerBase.h +++ b/FWCore/Framework/interface/limited/EDProducerBase.h @@ -69,12 +69,12 @@ namespace edm { // Warning: the returned moduleDescription will be invalid during construction ModuleDescription const& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; unsigned int concurrencyLimit() const { return queue_.concurrencyLimit(); } @@ -87,7 +87,7 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry*, ModuleCallingContext, - ServiceWeakToken const&); + ServiceWeakToken const&) noexcept; void doPreallocate(PreallocationConfiguration const&); void doBeginJob(); void doEndJob(); @@ -122,7 +122,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& iModuleCallingContext, - Principal const& iPrincipal) const {} + Principal const& iPrincipal) const noexcept {} virtual void beginJob() {} virtual void endJob() {} @@ -161,18 +161,18 @@ namespace edm { virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); - virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const; - virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const; + virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept; + virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept; virtual void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const; + ServiceWeakToken const& iToken) const noexcept; virtual void clearInputProcessBlockCaches(); - virtual bool hasAccumulator() const { return false; } + virtual bool hasAccumulator() const noexcept { return false; } - bool hasAcquire() const { return false; } + bool hasAcquire() const noexcept { return false; } void setModuleDescription(ModuleDescription const& md) { moduleDescription_ = md; } ModuleDescription moduleDescription_; diff --git a/FWCore/Framework/interface/limited/OutputModule.h b/FWCore/Framework/interface/limited/OutputModule.h index 0068fe7f3af90..c4d2b1bbafa22 100644 --- a/FWCore/Framework/interface/limited/OutputModule.h +++ b/FWCore/Framework/interface/limited/OutputModule.h @@ -41,10 +41,12 @@ namespace edm { #endif // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsStreamRuns() const final { return WantsStreamRunTransitions::value; } - bool wantsStreamLuminosityBlocks() const final { return WantsStreamLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsStreamRuns() const noexcept final { return WantsStreamRunTransitions::value; } + bool wantsStreamLuminosityBlocks() const noexcept final { + return WantsStreamLuminosityBlockTransitions::value; + } // ---------- static member functions -------------------- diff --git a/FWCore/Framework/interface/limited/OutputModuleBase.h b/FWCore/Framework/interface/limited/OutputModuleBase.h index adbcfa7556dfc..2b5b72ef86e4c 100644 --- a/FWCore/Framework/interface/limited/OutputModuleBase.h +++ b/FWCore/Framework/interface/limited/OutputModuleBase.h @@ -47,12 +47,12 @@ namespace edm { std::vector const& iDefaultOutputCommands = ProductSelectorRules::defaultSelectionStrings()); //Output modules always need writeRun and writeLumi to be called - bool wantsGlobalRuns() const { return true; } - bool wantsGlobalLuminosityBlocks() const { return true; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + bool wantsGlobalRuns() const noexcept { return true; } + bool wantsGlobalLuminosityBlocks() const noexcept { return true; } + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; unsigned int concurrencyLimit() const { return queue_.concurrencyLimit(); } @@ -70,7 +70,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, - Principal const&) const {} + Principal const&) const noexcept {} private: LimitedTaskQueue queue_; @@ -92,7 +92,7 @@ namespace edm { virtual void doEndRunSummary_(RunForOutput const&, EventSetup const&) {} virtual void doBeginLuminosityBlockSummary_(LuminosityBlockForOutput const&, EventSetup const&) {} virtual void doEndLuminosityBlockSummary_(LuminosityBlockForOutput const&, EventSetup const&) {} - bool hasAcquire() const { return false; } + bool hasAcquire() const noexcept { return false; } }; } // namespace limited } // namespace edm diff --git a/FWCore/Framework/interface/limited/implementors.h b/FWCore/Framework/interface/limited/implementors.h index efd5a1e18c473..b8c1af22713f2 100644 --- a/FWCore/Framework/interface/limited/implementors.h +++ b/FWCore/Framework/interface/limited/implementors.h @@ -437,7 +437,7 @@ namespace edm { ~Accumulator() noexcept(false) override{}; private: - bool hasAccumulator() const override { return true; } + bool hasAccumulator() const noexcept override { return true; } void produce(StreamID streamID, Event& ev, EventSetup const& es) const final { accumulate(streamID, ev, es); } @@ -499,17 +499,17 @@ namespace edm { } private: - size_t transformIndex_(edm::BranchDescription const& iBranch) const final { + size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept final { return TransformerBase::findMatchingIndex(*this, iBranch); } - ProductResolverIndex transformPrefetch_(std::size_t iIndex) const final { + ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept final { return TransformerBase::prefetchImp(iIndex); } void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const final { + ServiceWeakToken const& iToken) const noexcept final { return TransformerBase::transformImpAsync(std::move(iTask), iIndex, iAct, *this, iEvent); } void extendUpdateLookup(BranchType iBranchType, ProductResolverIndexHelper const& iHelper) override { diff --git a/FWCore/Framework/interface/maker/Worker.h b/FWCore/Framework/interface/maker/Worker.h index 0d3cb321798ea..a54b4f7bf0f1e 100644 --- a/FWCore/Framework/interface/maker/Worker.h +++ b/FWCore/Framework/interface/maker/Worker.h @@ -125,21 +125,24 @@ namespace edm { doClearModule(); } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; virtual SerialTaskQueue* globalRunsQueue() = 0; virtual SerialTaskQueue* globalLuminosityBlocksQueue() = 0; - void prePrefetchSelectionAsync( - oneapi::tbb::task_group&, WaitingTask* task, ServiceToken const&, StreamID stream, EventPrincipal const*); + void prePrefetchSelectionAsync(oneapi::tbb::task_group&, + WaitingTask* task, + ServiceToken const&, + StreamID stream, + EventPrincipal const*) noexcept; void prePrefetchSelectionAsync( - oneapi::tbb::task_group&, WaitingTask* task, ServiceToken const&, StreamID stream, void const*) { + oneapi::tbb::task_group&, WaitingTask* task, ServiceToken const&, StreamID stream, void const*) noexcept { assert(false); } @@ -149,7 +152,7 @@ namespace edm { ServiceToken const&, StreamID, ParentContext const&, - typename T::Context const*); + typename T::Context const*) noexcept; template void doWorkNoPrefetchingAsync(WaitingTaskHolder, @@ -157,22 +160,22 @@ namespace edm { ServiceToken const&, StreamID, ParentContext const&, - typename T::Context const*); + typename T::Context const*) noexcept; template std::exception_ptr runModuleDirectly(typename T::TransitionInfoType const&, StreamID, ParentContext const&, - typename T::Context const*); + typename T::Context const*) noexcept; - virtual size_t transformIndex(edm::BranchDescription const&) const = 0; + virtual size_t transformIndex(edm::BranchDescription const&) const noexcept = 0; void doTransformAsync(WaitingTaskHolder, size_t iTransformIndex, EventPrincipal const&, ServiceToken const&, StreamID, ModuleCallingContext const&, - StreamContext const*); + StreamContext const*) noexcept; void callWhenDoneAsync(WaitingTaskHolder task) { waitingTasks_.add(std::move(task)); } void skipOnPath(EventPrincipal const& iEvent); @@ -195,7 +198,7 @@ namespace edm { void postDoEvent(EventPrincipal const&); - ModuleDescription const* description() const { + ModuleDescription const* description() const noexcept { if (moduleValid_) { return moduleCallingContext_.moduleDescription(); } @@ -229,7 +232,7 @@ namespace edm { virtual Types moduleType() const = 0; virtual ConcurrencyTypes moduleConcurrencyType() const = 0; - void clearCounters() { + void clearCounters() noexcept { timesRun_.store(0, std::memory_order_release); timesVisited_.store(0, std::memory_order_release); timesPassed_.store(0, std::memory_order_release); @@ -237,21 +240,21 @@ namespace edm { timesExcept_.store(0, std::memory_order_release); } - void addedToPath() { ++numberOfPathsOn_; } + void addedToPath() noexcept { ++numberOfPathsOn_; } //NOTE: calling state() is done to force synchronization across threads - int timesRun() const { return timesRun_.load(std::memory_order_acquire); } - int timesVisited() const { return timesVisited_.load(std::memory_order_acquire); } - int timesPassed() const { return timesPassed_.load(std::memory_order_acquire); } - int timesFailed() const { return timesFailed_.load(std::memory_order_acquire); } - int timesExcept() const { return timesExcept_.load(std::memory_order_acquire); } - State state() const { return state_; } + int timesRun() const noexcept { return timesRun_.load(std::memory_order_acquire); } + int timesVisited() const noexcept { return timesVisited_.load(std::memory_order_acquire); } + int timesPassed() const noexcept { return timesPassed_.load(std::memory_order_acquire); } + int timesFailed() const noexcept { return timesFailed_.load(std::memory_order_acquire); } + int timesExcept() const noexcept { return timesExcept_.load(std::memory_order_acquire); } + State state() const noexcept { return state_; } - int timesPass() const { return timesPassed(); } // for backward compatibility only - to be removed soon + int timesPass() const noexcept { return timesPassed(); } // for backward compatibility only - to be removed soon - virtual bool hasAccumulator() const = 0; + virtual bool hasAccumulator() const noexcept = 0; // Used in PuttableProductResolver - edm::WaitingTaskList& waitingTaskList() { return waitingTasks_; } + edm::WaitingTaskList& waitingTaskList() noexcept { return waitingTasks_; } protected: template @@ -263,7 +266,7 @@ namespace edm { virtual bool implDo(EventTransitionInfo const&, ModuleCallingContext const*) = 0; virtual void itemsToGetForSelection(std::vector&) const = 0; - virtual bool implNeedToRunSelection() const = 0; + virtual bool implNeedToRunSelection() const noexcept = 0; virtual void implDoAcquire(EventTransitionInfo const&, ModuleCallingContext const*, @@ -273,8 +276,8 @@ namespace edm { size_t iTransformIndex, EventPrincipal const&, ParentContext const&, - ServiceWeakToken const&) = 0; - virtual ProductResolverIndex itemToGetForTransform(size_t iTransformIndex) const = 0; + ServiceWeakToken const&) noexcept = 0; + virtual ProductResolverIndex itemToGetForTransform(size_t iTransformIndex) const noexcept = 0; virtual bool implDoPrePrefetchSelection(StreamID, EventPrincipal const&, ModuleCallingContext const*) = 0; virtual bool implDoBeginProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) = 0; @@ -311,7 +314,7 @@ namespace edm { virtual void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& moduleCallingContext, - Principal const& iPrincipal) const = 0; + Principal const& iPrincipal) const noexcept = 0; virtual void implRespondToOpenInputFile(FileBlock const& fb) = 0; virtual void implRespondToCloseInputFile(FileBlock const& fb) = 0; @@ -324,7 +327,7 @@ namespace edm { bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const& parentContext, bool isEvent, - bool isTryToContinue) const; + bool isTryToContinue) const noexcept; void checkForShouldTryToContinue(ModuleDescription const&); template @@ -360,10 +363,10 @@ namespace edm { ServiceToken const&, ParentContext const&, typename T::TransitionInfoType const&, - Transition); + Transition) noexcept; - void esPrefetchAsync(WaitingTaskHolder, EventSetupImpl const&, Transition, ServiceToken const&); - void edPrefetchAsync(WaitingTaskHolder, ServiceToken const&, Principal const&) const; + void esPrefetchAsync(WaitingTaskHolder, EventSetupImpl const&, Transition, ServiceToken const&) noexcept; + void edPrefetchAsync(WaitingTaskHolder, ServiceToken const&, Principal const&) const noexcept; bool needsESPrefetching(Transition iTrans) const noexcept { return iTrans < edm::Transition::NumberOfEventSetupTransitions ? not esItemsToGetFrom(iTrans).empty() : false; @@ -383,23 +386,24 @@ namespace edm { moduleCallingContext_); } - virtual bool hasAcquire() const = 0; + virtual bool hasAcquire() const noexcept = 0; template std::exception_ptr runModuleAfterAsyncPrefetch(std::exception_ptr, typename T::TransitionInfoType const&, StreamID, ParentContext const&, - typename T::Context const*); + typename T::Context const*) noexcept; void runAcquire(EventTransitionInfo const&, ParentContext const&, WaitingTaskWithArenaHolder&); void runAcquireAfterAsyncPrefetch(std::exception_ptr, EventTransitionInfo const&, ParentContext const&, - WaitingTaskWithArenaHolder); + WaitingTaskWithArenaHolder) noexcept; - std::exception_ptr handleExternalWorkException(std::exception_ptr iEPtr, ParentContext const& parentContext); + std::exception_ptr handleExternalWorkException(std::exception_ptr iEPtr, + ParentContext const& parentContext) noexcept; template class RunModuleTask : public WaitingTask { @@ -410,7 +414,7 @@ namespace edm { StreamID streamID, ParentContext const& parentContext, typename T::Context const* context, - oneapi::tbb::task_group* iGroup) + oneapi::tbb::task_group* iGroup) noexcept : m_worker(worker), m_transitionInfo(transitionInfo), m_streamID(streamID), @@ -516,7 +520,7 @@ namespace edm { typename T::TransitionInfoType const&, ServiceToken const&, ParentContext const&, - WaitingTaskWithArenaHolder) {} + WaitingTaskWithArenaHolder) noexcept {} void execute() final {} }; @@ -527,7 +531,7 @@ namespace edm { EventTransitionInfo const& eventTransitionInfo, ServiceToken const& token, ParentContext const& parentContext, - WaitingTaskWithArenaHolder holder) + WaitingTaskWithArenaHolder holder) noexcept : m_worker(worker), m_eventTransitionInfo(eventTransitionInfo), m_parentContext(parentContext), @@ -590,7 +594,7 @@ namespace edm { HandleExternalWorkExceptionTask(Worker* worker, oneapi::tbb::task_group* group, WaitingTask* runModuleTask, - ParentContext const& parentContext); + ParentContext const& parentContext) noexcept; void execute() final; @@ -699,14 +703,14 @@ namespace edm { WaitingTaskHolder waitingTask, ServiceToken const& token, EventTransitionInfo const& info, - Transition transition) { + Transition transition) noexcept { worker->esPrefetchAsync(waitingTask, info.eventSetupImpl(), transition, token); } - static bool wantsTransition(Worker const* iWorker) { return true; } - static bool needToRunSelection(Worker const* iWorker) { return iWorker->implNeedToRunSelection(); } + static bool wantsTransition(Worker const* iWorker) noexcept { return true; } + static bool needToRunSelection(Worker const* iWorker) noexcept { return iWorker->implNeedToRunSelection(); } - static SerialTaskQueue* pauseGlobalQueue(Worker*) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + static SerialTaskQueue* pauseGlobalQueue(Worker*) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; template <> @@ -734,13 +738,13 @@ namespace edm { WaitingTaskHolder waitingTask, ServiceToken const& token, RunTransitionInfo const& info, - Transition transition) { + Transition transition) noexcept { worker->esPrefetchAsync(waitingTask, info.eventSetupImpl(), transition, token); } - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsGlobalRuns(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return iWorker->globalRunsQueue(); } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsGlobalRuns(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return iWorker->globalRunsQueue(); } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; template <> class CallImpl> { @@ -762,13 +766,13 @@ namespace edm { WaitingTaskHolder waitingTask, ServiceToken const& token, RunTransitionInfo const& info, - Transition transition) { + Transition transition) noexcept { worker->esPrefetchAsync(waitingTask, info.eventSetupImpl(), transition, token); } - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsStreamRuns(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsStreamRuns(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; template <> class CallImpl> { @@ -790,13 +794,13 @@ namespace edm { WaitingTaskHolder waitingTask, ServiceToken const& token, RunTransitionInfo const& info, - Transition transition) { + Transition transition) noexcept { worker->esPrefetchAsync(waitingTask, info.eventSetupImpl(), transition, token); } - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsGlobalRuns(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker* iWorker) { return iWorker->globalRunsQueue(); } + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsGlobalRuns(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker* iWorker) noexcept { return iWorker->globalRunsQueue(); } }; template <> class CallImpl> { @@ -818,13 +822,13 @@ namespace edm { WaitingTaskHolder waitingTask, ServiceToken const& token, RunTransitionInfo const& info, - Transition transition) { + Transition transition) noexcept { worker->esPrefetchAsync(waitingTask, info.eventSetupImpl(), transition, token); } - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsStreamRuns(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsStreamRuns(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; template <> @@ -848,13 +852,15 @@ namespace edm { WaitingTaskHolder waitingTask, ServiceToken const& token, LumiTransitionInfo const& info, - Transition transition) { + Transition transition) noexcept { worker->esPrefetchAsync(waitingTask, info.eventSetupImpl(), transition, token); } - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsGlobalLuminosityBlocks(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return iWorker->globalLuminosityBlocksQueue(); } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsGlobalLuminosityBlocks(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { + return iWorker->globalLuminosityBlocksQueue(); + } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; template <> class CallImpl> { @@ -877,13 +883,13 @@ namespace edm { WaitingTaskHolder waitingTask, ServiceToken const& token, LumiTransitionInfo const& info, - Transition transition) { + Transition transition) noexcept { worker->esPrefetchAsync(waitingTask, info.eventSetupImpl(), transition, token); } - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsStreamLuminosityBlocks(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsStreamLuminosityBlocks(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; template <> @@ -911,13 +917,15 @@ namespace edm { WaitingTaskHolder waitingTask, ServiceToken const& token, LumiTransitionInfo const& info, - Transition transition) { + Transition transition) noexcept { worker->esPrefetchAsync(waitingTask, info.eventSetupImpl(), transition, token); } - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsGlobalLuminosityBlocks(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker* iWorker) { return iWorker->globalLuminosityBlocksQueue(); } + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsGlobalLuminosityBlocks(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker* iWorker) noexcept { + return iWorker->globalLuminosityBlocksQueue(); + } }; template <> class CallImpl> { @@ -944,13 +952,13 @@ namespace edm { WaitingTaskHolder waitingTask, ServiceToken const& token, LumiTransitionInfo const& info, - Transition transition) { + Transition transition) noexcept { worker->esPrefetchAsync(waitingTask, info.eventSetupImpl(), transition, token); } - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsStreamLuminosityBlocks(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsStreamLuminosityBlocks(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; template <> class CallImpl> { @@ -969,11 +977,11 @@ namespace edm { return returnValue; } static void esPrefetchAsync( - Worker*, WaitingTaskHolder, ServiceToken const&, ProcessBlockTransitionInfo const&, Transition) {} - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsProcessBlocks(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + Worker*, WaitingTaskHolder, ServiceToken const&, ProcessBlockTransitionInfo const&, Transition) noexcept {} + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsProcessBlocks(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; template <> class CallImpl> { @@ -992,11 +1000,11 @@ namespace edm { return returnValue; } static void esPrefetchAsync( - Worker*, WaitingTaskHolder, ServiceToken const&, ProcessBlockTransitionInfo const&, Transition) {} - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsInputProcessBlocks(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + Worker*, WaitingTaskHolder, ServiceToken const&, ProcessBlockTransitionInfo const&, Transition) noexcept {} + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsInputProcessBlocks(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; template <> class CallImpl> { @@ -1015,11 +1023,11 @@ namespace edm { return returnValue; } static void esPrefetchAsync( - Worker*, WaitingTaskHolder, ServiceToken const&, ProcessBlockTransitionInfo const&, Transition) {} - static bool wantsTransition(Worker const* iWorker) { return iWorker->wantsProcessBlocks(); } - static bool needToRunSelection(Worker const* iWorker) { return false; } - static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) { return nullptr; } - static SerialTaskQueue* enableGlobalQueue(Worker*) { return nullptr; } + Worker*, WaitingTaskHolder, ServiceToken const&, ProcessBlockTransitionInfo const&, Transition) noexcept {} + static bool wantsTransition(Worker const* iWorker) noexcept { return iWorker->wantsProcessBlocks(); } + static bool needToRunSelection(Worker const* iWorker) noexcept { return false; } + static SerialTaskQueue* pauseGlobalQueue(Worker* iWorker) noexcept { return nullptr; } + static SerialTaskQueue* enableGlobalQueue(Worker*) noexcept { return nullptr; } }; } // namespace workerhelper @@ -1028,7 +1036,7 @@ namespace edm { ServiceToken const& token, ParentContext const& parentContext, typename T::TransitionInfoType const& transitionInfo, - Transition iTransition) { + Transition iTransition) noexcept { Principal const& principal = transitionInfo.principal(); moduleCallingContext_.setContext(ModuleCallingContext::State::kPrefetching, parentContext, nullptr); @@ -1055,7 +1063,7 @@ namespace edm { ServiceToken const& token, StreamID streamID, ParentContext const& parentContext, - typename T::Context const* context) { + typename T::Context const* context) noexcept { if (not workerhelper::CallImpl::wantsTransition(this)) { return; } @@ -1081,16 +1089,16 @@ namespace edm { //make sure the task is either run or destroyed struct DestroyTask { - DestroyTask(edm::WaitingTask* iTask) : m_task(iTask) {} + DestroyTask(edm::WaitingTask* iTask) noexcept : m_task(iTask) {} - ~DestroyTask() { + ~DestroyTask() noexcept { auto p = m_task.exchange(nullptr); if (p) { TaskSentry s{p}; } } - edm::WaitingTask* release() { return m_task.exchange(nullptr); } + edm::WaitingTask* release() noexcept { return m_task.exchange(nullptr); } private: std::atomic m_task; @@ -1144,7 +1152,7 @@ namespace edm { typename T::TransitionInfoType const& transitionInfo, StreamID streamID, ParentContext const& parentContext, - typename T::Context const* context) { + typename T::Context const* context) noexcept { std::exception_ptr exceptionPtr; bool shouldRun = true; if (iEPtr) { @@ -1177,7 +1185,7 @@ namespace edm { ServiceToken const& serviceToken, StreamID streamID, ParentContext const& parentContext, - typename T::Context const* context) { + typename T::Context const* context) noexcept { if (not workerhelper::CallImpl::wantsTransition(this)) { return; } @@ -1275,7 +1283,7 @@ namespace edm { std::exception_ptr Worker::runModuleDirectly(typename T::TransitionInfoType const& transitionInfo, StreamID streamID, ParentContext const& parentContext, - typename T::Context const* context) { + typename T::Context const* context) noexcept { timesVisited_.fetch_add(1, std::memory_order_relaxed); std::exception_ptr prefetchingException; // null because there was no prefetching to do return runModuleAfterAsyncPrefetch(prefetchingException, transitionInfo, streamID, parentContext, context); diff --git a/FWCore/Framework/interface/maker/WorkerT.h b/FWCore/Framework/interface/maker/WorkerT.h index 10d2e64cfbc3b..6878a753e63af 100644 --- a/FWCore/Framework/interface/maker/WorkerT.h +++ b/FWCore/Framework/interface/maker/WorkerT.h @@ -46,12 +46,12 @@ namespace edm { Types moduleType() const override; ConcurrencyTypes moduleConcurrencyType() const override; - bool wantsProcessBlocks() const final; - bool wantsInputProcessBlocks() const final; - bool wantsGlobalRuns() const final; - bool wantsGlobalLuminosityBlocks() const final; - bool wantsStreamRuns() const final; - bool wantsStreamLuminosityBlocks() const final; + bool wantsProcessBlocks() const noexcept final; + bool wantsInputProcessBlocks() const noexcept final; + bool wantsGlobalRuns() const noexcept final; + bool wantsGlobalLuminosityBlocks() const noexcept final; + bool wantsStreamRuns() const noexcept final; + bool wantsStreamLuminosityBlocks() const noexcept final; SerialTaskQueue* globalRunsQueue() final; SerialTaskQueue* globalLuminosityBlocksQueue() final; @@ -88,17 +88,17 @@ namespace edm { bool implDo(EventTransitionInfo const&, ModuleCallingContext const*) override; void itemsToGetForSelection(std::vector&) const final; - bool implNeedToRunSelection() const final; + bool implNeedToRunSelection() const noexcept final; void implDoAcquire(EventTransitionInfo const&, ModuleCallingContext const*, WaitingTaskWithArenaHolder&) final; - size_t transformIndex(edm::BranchDescription const&) const final; + size_t transformIndex(edm::BranchDescription const&) const noexcept final; void implDoTransformAsync(WaitingTaskHolder, size_t iTransformIndex, EventPrincipal const&, ParentContext const&, - ServiceWeakToken const&) final; - ProductResolverIndex itemToGetForTransform(size_t iTransformIndex) const final; + ServiceWeakToken const&) noexcept final; + ProductResolverIndex itemToGetForTransform(size_t iTransformIndex) const noexcept final; bool implDoPrePrefetchSelection(StreamID, EventPrincipal const&, ModuleCallingContext const*) override; bool implDoBeginProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) override; @@ -159,13 +159,13 @@ namespace edm { void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& iModuleCallingContext, - Principal const& iPrincipal) const override { + Principal const& iPrincipal) const noexcept override { module_->preActionBeforeRunEventAsync(iTask, iModuleCallingContext, iPrincipal); } - bool hasAcquire() const override { return module_->hasAcquire(); } + bool hasAcquire() const noexcept override { return module_->hasAcquire(); } - bool hasAccumulator() const override { return module_->hasAccumulator(); } + bool hasAccumulator() const noexcept override { return module_->hasAccumulator(); } edm::propagate_const> module_; }; diff --git a/FWCore/Framework/interface/one/EDAnalyzer.h b/FWCore/Framework/interface/one/EDAnalyzer.h index e4c64ba9df121..30d38461d3716 100644 --- a/FWCore/Framework/interface/one/EDAnalyzer.h +++ b/FWCore/Framework/interface/one/EDAnalyzer.h @@ -45,10 +45,12 @@ namespace edm { #endif // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } // ---------- static member functions -------------------- diff --git a/FWCore/Framework/interface/one/EDAnalyzerBase.h b/FWCore/Framework/interface/one/EDAnalyzerBase.h index f9975080ca760..ed9e21a5732f1 100644 --- a/FWCore/Framework/interface/one/EDAnalyzerBase.h +++ b/FWCore/Framework/interface/one/EDAnalyzerBase.h @@ -62,12 +62,12 @@ namespace edm { // Warning: the returned moduleDescription will be invalid during construction ModuleDescription const& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - bool wantsStreamRuns() const { return false; } - bool wantsStreamLuminosityBlocks() const { return false; }; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + bool wantsStreamRuns() const noexcept { return false; } + bool wantsStreamLuminosityBlocks() const noexcept { return false; }; virtual SerialTaskQueue* globalRunsQueue(); virtual SerialTaskQueue* globalLuminosityBlocksQueue(); @@ -78,7 +78,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, - Principal const&) const {} + Principal const&) const noexcept {} void doPreallocate(PreallocationConfiguration const&); virtual void preallocRuns(unsigned int); @@ -118,8 +118,8 @@ namespace edm { virtual void clearInputProcessBlockCaches(); - bool hasAcquire() const { return false; } - bool hasAccumulator() const { return false; } + bool hasAcquire() const noexcept { return false; } + bool hasAccumulator() const noexcept { return false; } virtual SharedResourcesAcquirer createAcquirer(); diff --git a/FWCore/Framework/interface/one/EDFilter.h b/FWCore/Framework/interface/one/EDFilter.h index 8ac7e7d067413..bf18558158f58 100644 --- a/FWCore/Framework/interface/one/EDFilter.h +++ b/FWCore/Framework/interface/one/EDFilter.h @@ -42,10 +42,12 @@ namespace edm { //virtual ~EDFilter(); // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } bool hasAbilityToProduceInBeginProcessBlocks() const final { return HasAbilityToProduceInBeginProcessBlocks::value; diff --git a/FWCore/Framework/interface/one/EDFilterBase.h b/FWCore/Framework/interface/one/EDFilterBase.h index e9c0b0f1d9b54..ecb3805b4abd6 100644 --- a/FWCore/Framework/interface/one/EDFilterBase.h +++ b/FWCore/Framework/interface/one/EDFilterBase.h @@ -64,12 +64,12 @@ namespace edm { // Warning: the returned moduleDescription will be invalid during construction ModuleDescription const& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - bool wantsStreamRuns() const { return false; } - bool wantsStreamLuminosityBlocks() const { return false; }; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + bool wantsStreamRuns() const noexcept { return false; } + bool wantsStreamLuminosityBlocks() const noexcept { return false; }; virtual SerialTaskQueue* globalRunsQueue(); virtual SerialTaskQueue* globalLuminosityBlocksQueue(); @@ -81,11 +81,11 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry*, ModuleCallingContext, - ServiceWeakToken const&); + ServiceWeakToken const&) noexcept; //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, - Principal const&) const {} + Principal const&) const noexcept {} void doPreallocate(PreallocationConfiguration const&); virtual void preallocRuns(unsigned int); @@ -134,18 +134,18 @@ namespace edm { virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); - virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const; - virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const; + virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept; + virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept; virtual void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const; + ServiceWeakToken const& iToken) const noexcept; virtual void clearInputProcessBlockCaches(); - bool hasAcquire() const { return false; } - bool hasAccumulator() const { return false; } + bool hasAcquire() const noexcept { return false; } + bool hasAccumulator() const noexcept { return false; } virtual SharedResourcesAcquirer createAcquirer(); diff --git a/FWCore/Framework/interface/one/EDProducer.h b/FWCore/Framework/interface/one/EDProducer.h index 18e764e6c30b0..fd3e2652be9a9 100644 --- a/FWCore/Framework/interface/one/EDProducer.h +++ b/FWCore/Framework/interface/one/EDProducer.h @@ -46,10 +46,12 @@ namespace edm { // // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } bool hasAbilityToProduceInBeginProcessBlocks() const final { return HasAbilityToProduceInBeginProcessBlocks::value; diff --git a/FWCore/Framework/interface/one/EDProducerBase.h b/FWCore/Framework/interface/one/EDProducerBase.h index 0b2926f3e4543..e792cd6f47432 100644 --- a/FWCore/Framework/interface/one/EDProducerBase.h +++ b/FWCore/Framework/interface/one/EDProducerBase.h @@ -64,12 +64,12 @@ namespace edm { // Warning: the returned moduleDescription will be invalid during construction ModuleDescription const& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - bool wantsStreamRuns() const { return false; } - bool wantsStreamLuminosityBlocks() const { return false; }; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + bool wantsStreamRuns() const noexcept { return false; } + bool wantsStreamLuminosityBlocks() const noexcept { return false; }; virtual SerialTaskQueue* globalRunsQueue(); virtual SerialTaskQueue* globalLuminosityBlocksQueue(); @@ -79,14 +79,14 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, - Principal const&) const {} + Principal const&) const noexcept {} void doTransformAsync(WaitingTaskHolder iTask, size_t iTransformIndex, EventPrincipal const& iEvent, ActivityRegistry*, ModuleCallingContext, - ServiceWeakToken const&); + ServiceWeakToken const&) noexcept; void doPreallocate(PreallocationConfiguration const&); virtual void preallocRuns(unsigned int); virtual void preallocLumis(unsigned int); @@ -134,18 +134,18 @@ namespace edm { virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c); - virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const; - virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const; + virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept; + virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept; virtual void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const; + ServiceWeakToken const& iToken) const noexcept; virtual void clearInputProcessBlockCaches(); - virtual bool hasAccumulator() const { return false; } + virtual bool hasAccumulator() const noexcept { return false; } - bool hasAcquire() const { return false; } + bool hasAcquire() const noexcept { return false; } virtual SharedResourcesAcquirer createAcquirer(); diff --git a/FWCore/Framework/interface/one/OutputModule.h b/FWCore/Framework/interface/one/OutputModule.h index 2ea2c7a7b1ef6..6c89cc26383eb 100644 --- a/FWCore/Framework/interface/one/OutputModule.h +++ b/FWCore/Framework/interface/one/OutputModule.h @@ -43,10 +43,12 @@ namespace edm { #endif // ---------- const member functions --------------------- - bool wantsProcessBlocks() const final { return WantsProcessBlockTransitions::value; } - bool wantsInputProcessBlocks() const final { return WantsInputProcessBlockTransitions::value; } - bool wantsGlobalRuns() const final { return WantsGlobalRunTransitions::value; } - bool wantsGlobalLuminosityBlocks() const final { return WantsGlobalLuminosityBlockTransitions::value; } + bool wantsProcessBlocks() const noexcept final { return WantsProcessBlockTransitions::value; } + bool wantsInputProcessBlocks() const noexcept final { return WantsInputProcessBlockTransitions::value; } + bool wantsGlobalRuns() const noexcept final { return WantsGlobalRunTransitions::value; } + bool wantsGlobalLuminosityBlocks() const noexcept final { + return WantsGlobalLuminosityBlockTransitions::value; + } SerialTaskQueue* globalRunsQueue() final { return globalRunsQueue_.queue(); } SerialTaskQueue* globalLuminosityBlocksQueue() final { return globalLuminosityBlocksQueue_.queue(); } diff --git a/FWCore/Framework/interface/one/OutputModuleBase.h b/FWCore/Framework/interface/one/OutputModuleBase.h index 1c9884f4f5ee9..3c4ed7cac8216 100644 --- a/FWCore/Framework/interface/one/OutputModuleBase.h +++ b/FWCore/Framework/interface/one/OutputModuleBase.h @@ -47,12 +47,12 @@ namespace edm { OutputModuleBase& operator=(OutputModuleBase const&) = delete; // Disallow copying and moving //Output modules always need writeRun and writeLumi to be called - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - bool wantsStreamRuns() const { return false; } - bool wantsStreamLuminosityBlocks() const { return false; }; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + bool wantsStreamRuns() const noexcept { return false; } + bool wantsStreamLuminosityBlocks() const noexcept { return false; }; virtual SerialTaskQueue* globalRunsQueue() { return nullptr; } virtual SerialTaskQueue* globalLuminosityBlocksQueue() { return nullptr; } @@ -81,9 +81,9 @@ namespace edm { virtual void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& iModuleCallingContext, - Principal const& iPrincipal) const {} + Principal const& iPrincipal) const noexcept {} - bool hasAcquire() const { return false; } + bool hasAcquire() const noexcept { return false; } }; } // namespace one } // namespace edm diff --git a/FWCore/Framework/interface/one/implementors.h b/FWCore/Framework/interface/one/implementors.h index 7747d75e56612..604c6216a23c2 100644 --- a/FWCore/Framework/interface/one/implementors.h +++ b/FWCore/Framework/interface/one/implementors.h @@ -330,7 +330,7 @@ namespace edm { ~Accumulator() noexcept(false) override{}; private: - bool hasAccumulator() const override { return true; } + bool hasAccumulator() const noexcept override { return true; } void produce(Event& ev, EventSetup const& es) final { accumulate(ev, es); } @@ -390,17 +390,17 @@ namespace edm { } private: - size_t transformIndex_(edm::BranchDescription const& iBranch) const final { + size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept final { return TransformerBase::findMatchingIndex(*this, iBranch); } - ProductResolverIndex transformPrefetch_(std::size_t iIndex) const final { + ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept final { return TransformerBase::prefetchImp(iIndex); } void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const final { + ServiceWeakToken const& iToken) const noexcept final { return TransformerBase::transformImpAsync(std::move(iTask), iIndex, iAct, *this, iEvent); } void extendUpdateLookup(BranchType iBranchType, ProductResolverIndexHelper const& iHelper) override { diff --git a/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h b/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h index d13a364889d88..f2466aea3ddd6 100644 --- a/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h +++ b/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h @@ -70,14 +70,16 @@ namespace edm { static void fillDescriptions(ConfigurationDescriptions& descriptions) { T::fillDescriptions(descriptions); } static void prevalidate(ConfigurationDescriptions& descriptions) { T::prevalidate(descriptions); } - bool wantsProcessBlocks() const final { return T::HasAbility::kWatchProcessBlock; } - bool wantsInputProcessBlocks() const final { return T::HasAbility::kInputProcessBlockCache; } - bool wantsGlobalRuns() const final { return T::HasAbility::kRunCache or T::HasAbility::kRunSummaryCache; } - bool wantsStreamRuns() const final { return T::HasAbility::kWatchRuns; } - bool wantsGlobalLuminosityBlocks() const final { + bool wantsProcessBlocks() const noexcept final { return T::HasAbility::kWatchProcessBlock; } + bool wantsInputProcessBlocks() const noexcept final { return T::HasAbility::kInputProcessBlockCache; } + bool wantsGlobalRuns() const noexcept final { + return T::HasAbility::kRunCache or T::HasAbility::kRunSummaryCache; + } + bool wantsStreamRuns() const noexcept final { return T::HasAbility::kWatchRuns; } + bool wantsGlobalLuminosityBlocks() const noexcept final { return T::HasAbility::kLuminosityBlockCache or T::HasAbility::kLuminosityBlockSummaryCache; } - bool wantsStreamLuminosityBlocks() const final { return T::HasAbility::kWatchLuminosityBlocks; } + bool wantsStreamLuminosityBlocks() const noexcept final { return T::HasAbility::kWatchLuminosityBlocks; } private: using MyGlobal = CallGlobal; diff --git a/FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h b/FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h index b2cdea8816e8e..dcc6429d2be55 100644 --- a/FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h +++ b/FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h @@ -82,12 +82,12 @@ namespace edm { // ---------- member functions --------------------------- const ModuleDescription& moduleDescription() const { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; std::string workerType() const { return "WorkerT"; } void registerProductsAndCallbacks(EDAnalyzerAdaptorBase const*, ProductRegistry* reg); @@ -138,7 +138,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, - Principal const&) const {} + Principal const&) const noexcept {} virtual void setupStreamModules() = 0; virtual void doBeginJob() = 0; @@ -171,8 +171,8 @@ namespace edm { virtual void doRespondToCloseOutputFile() = 0; void doRegisterThinnedAssociations(ProductRegistry const&, ThinnedAssociationsHelper&) {} - bool hasAcquire() const { return false; } - bool hasAccumulator() const { return false; } + bool hasAcquire() const noexcept { return false; } + bool hasAccumulator() const noexcept { return false; } // ---------- member data -------------------------------- void setModuleDescriptionPtr(EDAnalyzerBase* m); diff --git a/FWCore/Framework/interface/stream/EDFilterAdaptorBase.h b/FWCore/Framework/interface/stream/EDFilterAdaptorBase.h index b871f116ab06f..e0fdf609ab041 100644 --- a/FWCore/Framework/interface/stream/EDFilterAdaptorBase.h +++ b/FWCore/Framework/interface/stream/EDFilterAdaptorBase.h @@ -78,7 +78,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, - Principal const&) const {} + Principal const&) const noexcept {} }; } // namespace stream } // namespace edm diff --git a/FWCore/Framework/interface/stream/EDProducerAdaptorBase.h b/FWCore/Framework/interface/stream/EDProducerAdaptorBase.h index 7b921eb9ade15..3653c7929cd0a 100644 --- a/FWCore/Framework/interface/stream/EDProducerAdaptorBase.h +++ b/FWCore/Framework/interface/stream/EDProducerAdaptorBase.h @@ -78,7 +78,7 @@ namespace edm { //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, - Principal const&) const {} + Principal const&) const noexcept {} }; } // namespace stream } // namespace edm diff --git a/FWCore/Framework/interface/stream/EDProducerBase.h b/FWCore/Framework/interface/stream/EDProducerBase.h index 3c825ee7125a1..a272ec1ecc036 100644 --- a/FWCore/Framework/interface/stream/EDProducerBase.h +++ b/FWCore/Framework/interface/stream/EDProducerBase.h @@ -75,13 +75,13 @@ namespace edm { virtual void registerThinnedAssociations(ProductRegistry const&, ThinnedAssociationsHelper&) {} virtual void doAcquire_(Event const&, EventSetup const&, WaitingTaskWithArenaHolder&) = 0; - virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const; - virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const; + virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept; + virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept; virtual void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const; + ServiceWeakToken const& iToken) const noexcept; void setModuleDescriptionPtr(ModuleDescription const* iDesc) { moduleDescriptionPtr_ = iDesc; } // ---------- member data -------------------------------- diff --git a/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h b/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h index 545c125638750..bdc06f37b003c 100644 --- a/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h +++ b/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h @@ -58,26 +58,26 @@ namespace edm { static void fillDescriptions(ConfigurationDescriptions& descriptions) { T::fillDescriptions(descriptions); } static void prevalidate(ConfigurationDescriptions& descriptions) { T::prevalidate(descriptions); } - bool wantsProcessBlocks() const final { + bool wantsProcessBlocks() const noexcept final { return T::HasAbility::kWatchProcessBlock or T::HasAbility::kBeginProcessBlockProducer or T::HasAbility::kEndProcessBlockProducer; } - bool wantsInputProcessBlocks() const final { return T::HasAbility::kInputProcessBlockCache; } - bool wantsGlobalRuns() const final { + bool wantsInputProcessBlocks() const noexcept final { return T::HasAbility::kInputProcessBlockCache; } + bool wantsGlobalRuns() const noexcept final { return T::HasAbility::kRunCache or T::HasAbility::kRunSummaryCache or T::HasAbility::kBeginRunProducer or T::HasAbility::kEndRunProducer; } - bool wantsStreamRuns() const final { return T::HasAbility::kWatchRuns; } + bool wantsStreamRuns() const noexcept final { return T::HasAbility::kWatchRuns; } - bool wantsGlobalLuminosityBlocks() const final { + bool wantsGlobalLuminosityBlocks() const noexcept final { return T::HasAbility::kLuminosityBlockCache or T::HasAbility::kLuminosityBlockSummaryCache or T::HasAbility::kBeginLuminosityBlockProducer or T::HasAbility::kEndLuminosityBlockProducer; } - bool wantsStreamLuminosityBlocks() const final { return T::HasAbility::kWatchLuminosityBlocks; } + bool wantsStreamLuminosityBlocks() const noexcept final { return T::HasAbility::kWatchLuminosityBlocks; } - bool hasAcquire() const final { return T::HasAbility::kExternalWork; } + bool hasAcquire() const noexcept final { return T::HasAbility::kExternalWork; } - bool hasAccumulator() const final { return T::HasAbility::kAccumulator; } + bool hasAccumulator() const noexcept final { return T::HasAbility::kAccumulator; } private: using MyGlobal = CallGlobal; diff --git a/FWCore/Framework/interface/stream/ProducingModuleAdaptorBase.h b/FWCore/Framework/interface/stream/ProducingModuleAdaptorBase.h index 99c2581fbf288..3c72dc17be85f 100644 --- a/FWCore/Framework/interface/stream/ProducingModuleAdaptorBase.h +++ b/FWCore/Framework/interface/stream/ProducingModuleAdaptorBase.h @@ -85,16 +85,16 @@ namespace edm { // ---------- static member functions -------------------- // ---------- member functions --------------------------- - const ModuleDescription& moduleDescription() const { return moduleDescription_; } + const ModuleDescription& moduleDescription() const noexcept { return moduleDescription_; } - virtual bool wantsProcessBlocks() const = 0; - virtual bool wantsInputProcessBlocks() const = 0; - virtual bool wantsGlobalRuns() const = 0; - virtual bool wantsGlobalLuminosityBlocks() const = 0; - virtual bool hasAcquire() const = 0; - virtual bool hasAccumulator() const = 0; - virtual bool wantsStreamRuns() const = 0; - virtual bool wantsStreamLuminosityBlocks() const = 0; + virtual bool wantsProcessBlocks() const noexcept = 0; + virtual bool wantsInputProcessBlocks() const noexcept = 0; + virtual bool wantsGlobalRuns() const noexcept = 0; + virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0; + virtual bool hasAcquire() const noexcept = 0; + virtual bool hasAccumulator() const noexcept = 0; + virtual bool wantsStreamRuns() const noexcept = 0; + virtual bool wantsStreamLuminosityBlocks() const noexcept = 0; void registerProductsAndCallbacks(ProducingModuleAdaptorBase const*, ProductRegistry* reg); @@ -128,14 +128,14 @@ namespace edm { std::vector const& indiciesForPutProducts(BranchType iBranchType) const; - ProductResolverIndex transformPrefetch_(size_t iTransformIndex) const; - size_t transformIndex_(edm::BranchDescription const& iBranch) const; + ProductResolverIndex transformPrefetch_(size_t iTransformIndex) const noexcept; + size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept; void doTransformAsync(WaitingTaskHolder iTask, size_t iTransformIndex, EventPrincipal const& iEvent, ActivityRegistry*, ModuleCallingContext, - ServiceWeakToken const&); + ServiceWeakToken const&) noexcept; protected: template diff --git a/FWCore/Framework/interface/stream/implementors.h b/FWCore/Framework/interface/stream/implementors.h index 64ffe5acc87cc..f2c93d3d9a487 100644 --- a/FWCore/Framework/interface/stream/implementors.h +++ b/FWCore/Framework/interface/stream/implementors.h @@ -365,17 +365,17 @@ namespace edm { } private: - size_t transformIndex_(edm::BranchDescription const& iBranch) const final { + size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept final { return TransformerBase::findMatchingIndex(*this, iBranch); } - ProductResolverIndex transformPrefetch_(std::size_t iIndex) const final { + ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept final { return TransformerBase::prefetchImp(iIndex); } void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const final { + ServiceWeakToken const& iToken) const noexcept final { return TransformerBase::transformImpAsync(std::move(iTask), iIndex, iAct, *this, iEvent); } void extendUpdateLookup(BranchType iBranchType, ProductResolverIndexHelper const& iHelper) override { diff --git a/FWCore/Framework/src/EDLooperBase.cc b/FWCore/Framework/src/EDLooperBase.cc index 7e252e25f9261..940aeede76b99 100644 --- a/FWCore/Framework/src/EDLooperBase.cc +++ b/FWCore/Framework/src/EDLooperBase.cc @@ -186,14 +186,14 @@ namespace edm { ServiceToken const& token, Transition iTrans, Principal const& iPrincipal, - EventSetupImpl const& iImpl) const { + EventSetupImpl const& iImpl) const noexcept { esPrefetchAsync(iTask, iImpl, iTrans, token); edPrefetchAsync(std::move(iTask), token, iPrincipal); } void EDLooperBase::edPrefetchAsync(WaitingTaskHolder iTask, ServiceToken const& token, - Principal const& iPrincipal) const { + Principal const& iPrincipal) const noexcept { //Based on Worker edPrefetchAsync // Prefetch products the module declares it consumes @@ -211,7 +211,7 @@ namespace edm { void EDLooperBase::esPrefetchAsync(WaitingTaskHolder iTask, EventSetupImpl const& iImpl, Transition iTrans, - ServiceToken const& iToken) const { + ServiceToken const& iToken) const noexcept { //Based on Worker::esPrefetchAsync if (iTrans >= edm::Transition::NumberOfEventSetupTransitions) { return; diff --git a/FWCore/Framework/src/ESProductResolver.cc b/FWCore/Framework/src/ESProductResolver.cc index e5b9a69cc2d9c..31e93de0c0e79 100644 --- a/FWCore/Framework/src/ESProductResolver.cc +++ b/FWCore/Framework/src/ESProductResolver.cc @@ -59,7 +59,7 @@ namespace edm { DataKey const& iKey, EventSetupImpl const* iEventSetupImpl, ServiceToken const& iToken, - ESParentContext const& iParent) const { + ESParentContext const& iParent) const noexcept { const_cast(this)->prefetchAsyncImpl(iTask, iRecord, iKey, iEventSetupImpl, iToken, iParent); } diff --git a/FWCore/Framework/src/ESSourceProductResolverConcurrentBase.cc b/FWCore/Framework/src/ESSourceProductResolverConcurrentBase.cc index 39da366f1239f..b2df95f2301c3 100644 --- a/FWCore/Framework/src/ESSourceProductResolverConcurrentBase.cc +++ b/FWCore/Framework/src/ESSourceProductResolverConcurrentBase.cc @@ -25,7 +25,7 @@ void edm::eventsetup::ESSourceProductResolverConcurrentBase::prefetchAsyncImpl( edm::eventsetup::DataKey const& iKey, edm::EventSetupImpl const*, edm::ServiceToken const&, - edm::ESParentContext const& iParent) { + edm::ESParentContext const& iParent) noexcept { prefetchAsyncImplTemplate([](auto& iGroup, auto iActivity) { iGroup.run(std::move(iActivity)); }, []() { return true; }, std::move(iTask), diff --git a/FWCore/Framework/src/ESSourceProductResolverNonConcurrentBase.cc b/FWCore/Framework/src/ESSourceProductResolverNonConcurrentBase.cc index 3635cb5361c5c..a2f5a0ea32a46 100644 --- a/FWCore/Framework/src/ESSourceProductResolverNonConcurrentBase.cc +++ b/FWCore/Framework/src/ESSourceProductResolverNonConcurrentBase.cc @@ -25,7 +25,7 @@ void edm::eventsetup::ESSourceProductResolverNonConcurrentBase::prefetchAsyncImp edm::eventsetup::DataKey const& iKey, edm::EventSetupImpl const*, edm::ServiceToken const&, - edm::ESParentContext const& iParent) { + edm::ESParentContext const& iParent) noexcept { prefetchAsyncImplTemplate([this](auto& iGroup, auto iActivity) { m_queue->push(iGroup, std::move(iActivity)); }, [mutex = m_mutex]() { return std::lock_guard(*mutex); }, std::move(iTask), diff --git a/FWCore/Framework/src/EventForTransformer.cc b/FWCore/Framework/src/EventForTransformer.cc index fcdb6f621e177..ca836f9d01fe1 100644 --- a/FWCore/Framework/src/EventForTransformer.cc +++ b/FWCore/Framework/src/EventForTransformer.cc @@ -11,7 +11,7 @@ namespace edm { - EventForTransformer::EventForTransformer(EventPrincipal const& ep, ModuleCallingContext moduleCallingContext) + EventForTransformer::EventForTransformer(EventPrincipal const& ep, ModuleCallingContext moduleCallingContext) noexcept : eventPrincipal_{ep}, mcc_{moduleCallingContext} {} BasicHandle EventForTransformer::get(edm::TypeID const& iTypeID, ProductResolverIndex iIndex) const { diff --git a/FWCore/Framework/src/EventSetupRecordImpl.cc b/FWCore/Framework/src/EventSetupRecordImpl.cc index d55a7d34296fe..b6209534afc27 100644 --- a/FWCore/Framework/src/EventSetupRecordImpl.cc +++ b/FWCore/Framework/src/EventSetupRecordImpl.cc @@ -214,7 +214,7 @@ namespace edm { ESResolverIndex iResolverIndex, EventSetupImpl const* iEventSetupImpl, ServiceToken const& iToken, - ESParentContext iParent) const { + ESParentContext iParent) const noexcept { if UNLIKELY (iResolverIndex.value() == std::numeric_limits::max()) { return; } diff --git a/FWCore/Framework/src/OutputModuleCommunicatorT.cc b/FWCore/Framework/src/OutputModuleCommunicatorT.cc index 8fac14ce9c4fb..8ebf39370b71e 100644 --- a/FWCore/Framework/src/OutputModuleCommunicatorT.cc +++ b/FWCore/Framework/src/OutputModuleCommunicatorT.cc @@ -66,7 +66,7 @@ namespace edm { void OutputModuleCommunicatorT::writeProcessBlockAsync(WaitingTaskHolder iTask, ProcessBlockPrincipal const& processBlockPrincipal, ProcessContext const* processContext, - ActivityRegistry* activityRegistry) { + ActivityRegistry* activityRegistry) noexcept { auto token = ServiceRegistry::instance().presentToken(); GlobalContext globalContext(GlobalContext::Transition::kWriteProcessBlock, LuminosityBlockID(), @@ -102,11 +102,12 @@ namespace edm { } template - void OutputModuleCommunicatorT::writeRunAsync(WaitingTaskHolder iTask, - edm::RunPrincipal const& rp, - ProcessContext const* processContext, - ActivityRegistry* activityRegistry, - MergeableRunProductMetadata const* mergeableRunProductMetadata) { + void OutputModuleCommunicatorT::writeRunAsync( + WaitingTaskHolder iTask, + edm::RunPrincipal const& rp, + ProcessContext const* processContext, + ActivityRegistry* activityRegistry, + MergeableRunProductMetadata const* mergeableRunProductMetadata) noexcept { auto token = ServiceRegistry::instance().presentToken(); GlobalContext globalContext(GlobalContext::Transition::kWriteRun, LuminosityBlockID(rp.run(), 0), @@ -146,7 +147,7 @@ namespace edm { void OutputModuleCommunicatorT::writeLumiAsync(WaitingTaskHolder iTask, edm::LuminosityBlockPrincipal const& lbp, ProcessContext const* processContext, - ActivityRegistry* activityRegistry) { + ActivityRegistry* activityRegistry) noexcept { auto token = ServiceRegistry::instance().presentToken(); GlobalContext globalContext(GlobalContext::Transition::kWriteLuminosityBlock, lbp.id(), diff --git a/FWCore/Framework/src/OutputModuleCore.cc b/FWCore/Framework/src/OutputModuleCore.cc index a72d8f00738af..f8fd3d32f71d2 100644 --- a/FWCore/Framework/src/OutputModuleCore.cc +++ b/FWCore/Framework/src/OutputModuleCore.cc @@ -266,9 +266,9 @@ namespace edm { } } - bool OutputModuleCore::needToRunSelection() const { return !wantAllEvents_; } + bool OutputModuleCore::needToRunSelection() const noexcept { return !wantAllEvents_; } - std::vector OutputModuleCore::productsUsedBySelection() const { + std::vector OutputModuleCore::productsUsedBySelection() const noexcept { std::vector returnValue; auto const& s = selectors_[0]; auto const n = s.numberOfTokens(); diff --git a/FWCore/Framework/src/ProductProvenanceRetriever.cc b/FWCore/Framework/src/ProductProvenanceRetriever.cc index e59591779148e..db4748474e556 100644 --- a/FWCore/Framework/src/ProductProvenanceRetriever.cc +++ b/FWCore/Framework/src/ProductProvenanceRetriever.cc @@ -33,8 +33,8 @@ namespace edm { return temp; } - void ProductProvenanceRetriever::readProvenanceAsync(WaitingTaskHolder task, - ModuleCallingContext const* moduleCallingContext) const { + void ProductProvenanceRetriever::readProvenanceAsync( + WaitingTaskHolder task, ModuleCallingContext const* moduleCallingContext) const noexcept { if (provenanceReader_ and nullptr == readEntryInfoSet_.load()) { provenanceReader_->readProvenanceAsync(task, moduleCallingContext, transitionIndex_, readEntryInfoSet_); } diff --git a/FWCore/Framework/src/ProductResolvers.cc b/FWCore/Framework/src/ProductResolvers.cc index 0346563353373..b00b2d2412c8b 100644 --- a/FWCore/Framework/src/ProductResolvers.cc +++ b/FWCore/Framework/src/ProductResolvers.cc @@ -273,7 +273,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const { + ModuleCallingContext const* mcc) const noexcept { //need to try changing m_prefetchRequested before adding to m_waitingTasks bool expected = false; bool prefetchRequested = m_prefetchRequested.compare_exchange_strong(expected, true); @@ -373,7 +373,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const {} + ModuleCallingContext const* mcc) const noexcept {} void PutOnReadInputProductResolver::putOrMergeProduct(std::unique_ptr edp) const { setOrMergeProduct(std::move(edp), nullptr); @@ -395,7 +395,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const { + ModuleCallingContext const* mcc) const noexcept { if (not skipCurrentProcess) { if (branchDescription().branchType() == InProcess && mcc->parent().globalContext()->transition() == GlobalContext::Transition::kAccessInputProcessBlock) { @@ -447,14 +447,11 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const { + ModuleCallingContext const* mcc) const noexcept { if (skipCurrentProcess) { return; } - if (worker_ == nullptr) { - throw cms::Exception("LogicError") << "UnscheduledProductResolver::prefetchAsync_() called with null worker_. " - "This should not happen, please contact framework developers."; - } + assert(worker_); //need to try changing prefetchRequested_ before adding to waitingTasks_ bool expected = false; bool prefetchRequested = prefetchRequested_.compare_exchange_strong(expected, true); @@ -535,14 +532,11 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const { + ModuleCallingContext const* mcc) const noexcept { if (skipCurrentProcess) { return; } - if (worker_ == nullptr) { - throw cms::Exception("LogicError") << "TransformingProductResolver::prefetchAsync_() called with null worker_. " - "This should not happen, please contact framework developers."; - } + assert(worker_ != nullptr); //need to try changing prefetchRequested_ before adding to waitingTasks_ bool expected = false; bool prefetchRequested = prefetchRequested_.compare_exchange_strong(expected, true); @@ -786,7 +780,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const { + ModuleCallingContext const* mcc) const noexcept { if (skipCurrentProcess) { return; } @@ -859,7 +853,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const { + ModuleCallingContext const* mcc) const noexcept { if (skipCurrentProcess) { return; } @@ -996,7 +990,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const { + ModuleCallingContext const* mcc) const noexcept { bool timeToMakeAtEnd = true; if (madeAtEnd_ and mcc) { timeToMakeAtEnd = mcc->parent().isAtEndTransition(); @@ -1109,7 +1103,7 @@ namespace edm { SharedResourcesAcquirer* sra, ModuleCallingContext const* mcc, ServiceToken token, - oneapi::tbb::task_group* group) const { + oneapi::tbb::task_group* group) const noexcept { std::vector const& lookupProcessOrder = principal.lookupProcessOrder(); auto index = iProcessingIndex; @@ -1238,7 +1232,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const { + ModuleCallingContext const* mcc) const noexcept { principal.getProductResolverByIndex(realResolverIndex_) ->prefetchAsync(waitTask, principal, skipCurrentProcess, token, sra, mcc); } diff --git a/FWCore/Framework/src/ProductResolvers.h b/FWCore/Framework/src/ProductResolvers.h index 8df0278d4b8a8..e8caaa1f754e2 100644 --- a/FWCore/Framework/src/ProductResolvers.h +++ b/FWCore/Framework/src/ProductResolvers.h @@ -138,7 +138,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const override; + ModuleCallingContext const* mcc) const noexcept override; void retrieveAndMerge_(Principal const& principal, MergeableRunProductMetadata const* mergeableRunProductMetadata) const override; @@ -177,7 +177,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const final; + ModuleCallingContext const* mcc) const noexcept final; bool unscheduledWasNotRun_() const final { return false; } private: @@ -215,7 +215,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const override; + ModuleCallingContext const* mcc) const noexcept override; bool unscheduledWasNotRun_() const override { return false; } // The WaitingTaskList below is the one from the worker, if one @@ -243,7 +243,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const override; + ModuleCallingContext const* mcc) const noexcept override; bool unscheduledWasNotRun_() const override { return status() == ProductStatus::ResolveNotRun; } void resetProductData_(bool deleteEarly) override; @@ -272,7 +272,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const override; + ModuleCallingContext const* mcc) const noexcept override; bool unscheduledWasNotRun_() const override { return status() == ProductStatus::ResolveNotRun; } void resetProductData_(bool deleteEarly) override; @@ -308,7 +308,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const override { + ModuleCallingContext const* mcc) const noexcept override { realProduct_.prefetchAsync(waitTask, principal, skipCurrentProcess, token, sra, mcc); } bool unscheduledWasNotRun_() const override { return realProduct_.unscheduledWasNotRun(); } @@ -402,7 +402,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const final; + ModuleCallingContext const* mcc) const noexcept final; void putProduct(std::unique_ptr edp) const final; bool unscheduledWasNotRun_() const final { return false; } bool productUnavailable_() const final; @@ -433,7 +433,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const final; + ModuleCallingContext const* mcc) const noexcept final; bool unscheduledWasNotRun_() const final { return realProduct().unscheduledWasNotRun(); } bool productUnavailable_() const final { return realProduct().productUnavailable(); } }; @@ -468,7 +468,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const override { + ModuleCallingContext const* mcc) const noexcept override { if (principal.branchType() == InProcess && (mcc->parent().globalContext()->transition() == GlobalContext::Transition::kBeginProcessBlock || mcc->parent().globalContext()->transition() == GlobalContext::Transition::kEndProcessBlock)) { @@ -524,7 +524,7 @@ namespace edm { SharedResourcesAcquirer* sra, ModuleCallingContext const* mcc, ServiceToken token, - oneapi::tbb::task_group*) const; + oneapi::tbb::task_group*) const noexcept; bool dataValidFromResolver(unsigned int iProcessingIndex, Principal const& principal, @@ -546,7 +546,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const override; + ModuleCallingContext const* mcc) const noexcept override; bool unscheduledWasNotRun_() const override; bool productUnavailable_() const override; bool productWasDeleted_() const override; @@ -601,7 +601,7 @@ namespace edm { bool skipCurrentProcess, ServiceToken const& token, SharedResourcesAcquirer* sra, - ModuleCallingContext const* mcc) const override; + ModuleCallingContext const* mcc) const noexcept override; bool unscheduledWasNotRun_() const override; bool productUnavailable_() const override; bool productWasDeleted_() const override; diff --git a/FWCore/Framework/src/TransformerBase.cc b/FWCore/Framework/src/TransformerBase.cc index 8e5e9e20a5f69..b091b968f3ac0 100644 --- a/FWCore/Framework/src/TransformerBase.cc +++ b/FWCore/Framework/src/TransformerBase.cc @@ -71,7 +71,7 @@ namespace edm { } std::size_t TransformerBase::findMatchingIndex(ProducerBase const& iBase, - edm::BranchDescription const& iBranch) const { + edm::BranchDescription const& iBranch) const noexcept { auto const& list = iBase.typeLabelList(); std::size_t index = 0; @@ -110,7 +110,7 @@ namespace edm { std::size_t iIndex, edm::ActivityRegistry* iAct, ProducerBase const& iBase, - edm::EventForTransformer& iEvent) const { + edm::EventForTransformer& iEvent) const noexcept { auto const& mcc = iEvent.moduleCallingContext(); if (transformInfo_.get(iIndex)) { std::optional(iIndex), transformInfo_.get(iIndex)))> diff --git a/FWCore/Framework/src/Worker.cc b/FWCore/Framework/src/Worker.cc index 0720d66f44000..f6e3328ad4f0a 100644 --- a/FWCore/Framework/src/Worker.cc +++ b/FWCore/Framework/src/Worker.cc @@ -120,7 +120,7 @@ namespace edm { bool Worker::shouldRethrowException(std::exception_ptr iPtr, ParentContext const& parentContext, bool isEvent, - bool shouldTryToContinue) const { + bool shouldTryToContinue) const noexcept { // NOTE: the warning printed as a result of ignoring or failing // a module will only be printed during the full true processing // pass of this module @@ -156,7 +156,7 @@ namespace edm { WaitingTask* successTask, ServiceToken const& token, StreamID id, - EventPrincipal const* iPrincipal) { + EventPrincipal const* iPrincipal) noexcept { successTask->increment_ref_count(); ServiceWeakToken weakToken = token; @@ -227,7 +227,7 @@ namespace edm { void Worker::esPrefetchAsync(WaitingTaskHolder iTask, EventSetupImpl const& iImpl, Transition iTrans, - ServiceToken const& iToken) { + ServiceToken const& iToken) noexcept { if (iTrans >= edm::Transition::NumberOfEventSetupTransitions) { return; } @@ -249,7 +249,9 @@ namespace edm { } } - void Worker::edPrefetchAsync(WaitingTaskHolder iTask, ServiceToken const& token, Principal const& iPrincipal) const { + void Worker::edPrefetchAsync(WaitingTaskHolder iTask, + ServiceToken const& token, + Principal const& iPrincipal) const noexcept { // Prefetch products the module declares it consumes std::vector const& items = itemsToGetFrom(iPrincipal.branchType()); @@ -264,14 +266,14 @@ namespace edm { void Worker::setEarlyDeleteHelper(EarlyDeleteHelper* iHelper) { earlyDeleteHelper_ = iHelper; } - size_t Worker::transformIndex(edm::BranchDescription const&) const { return -1; } + size_t Worker::transformIndex(edm::BranchDescription const&) const noexcept { return -1; } void Worker::doTransformAsync(WaitingTaskHolder iTask, size_t iTransformIndex, EventPrincipal const& iPrincipal, ServiceToken const& iToken, StreamID, ModuleCallingContext const& mcc, - StreamContext const*) { + StreamContext const*) noexcept { ServiceWeakToken weakToken = iToken; //Need to make the services available early so other services can see them @@ -426,7 +428,7 @@ namespace edm { void Worker::runAcquireAfterAsyncPrefetch(std::exception_ptr iEPtr, EventTransitionInfo const& eventTransitionInfo, ParentContext const& parentContext, - WaitingTaskWithArenaHolder holder) { + WaitingTaskWithArenaHolder holder) noexcept { ranAcquireWithoutException_ = false; std::exception_ptr exceptionPtr; if (iEPtr) { @@ -447,7 +449,8 @@ namespace edm { holder.doneWaiting(exceptionPtr); } - std::exception_ptr Worker::handleExternalWorkException(std::exception_ptr iEPtr, ParentContext const& parentContext) { + std::exception_ptr Worker::handleExternalWorkException(std::exception_ptr iEPtr, + ParentContext const& parentContext) noexcept { if (ranAcquireWithoutException_) { try { convertException::wrap([iEPtr]() { std::rethrow_exception(iEPtr); }); @@ -463,7 +466,7 @@ namespace edm { Worker::HandleExternalWorkExceptionTask::HandleExternalWorkExceptionTask(Worker* worker, oneapi::tbb::task_group* group, WaitingTask* runModuleTask, - ParentContext const& parentContext) + ParentContext const& parentContext) noexcept : m_worker(worker), m_runModuleTask(runModuleTask), m_group(group), m_parentContext(parentContext) {} void Worker::HandleExternalWorkExceptionTask::execute() { diff --git a/FWCore/Framework/src/WorkerT.cc b/FWCore/Framework/src/WorkerT.cc index 3c4fb9ee238d6..f18335f54268d 100644 --- a/FWCore/Framework/src/WorkerT.cc +++ b/FWCore/Framework/src/WorkerT.cc @@ -123,32 +123,32 @@ namespace edm { WorkerT::~WorkerT() {} template - bool WorkerT::wantsProcessBlocks() const { + bool WorkerT::wantsProcessBlocks() const noexcept { return module_->wantsProcessBlocks(); } template - bool WorkerT::wantsInputProcessBlocks() const { + bool WorkerT::wantsInputProcessBlocks() const noexcept { return module_->wantsInputProcessBlocks(); } template - bool WorkerT::wantsGlobalRuns() const { + bool WorkerT::wantsGlobalRuns() const noexcept { return module_->wantsGlobalRuns(); } template - bool WorkerT::wantsGlobalLuminosityBlocks() const { + bool WorkerT::wantsGlobalLuminosityBlocks() const noexcept { return module_->wantsGlobalLuminosityBlocks(); } template - bool WorkerT::wantsStreamRuns() const { + bool WorkerT::wantsStreamRuns() const noexcept { return module_->wantsStreamRuns(); } template - bool WorkerT::wantsStreamLuminosityBlocks() const { + bool WorkerT::wantsStreamLuminosityBlocks() const noexcept { return module_->wantsStreamLuminosityBlocks(); } @@ -247,7 +247,7 @@ namespace edm { size_t iTransformIndex, EventPrincipal const& iEvent, ParentContext const& iParent, - ServiceWeakToken const& weakToken) { + ServiceWeakToken const& weakToken) noexcept { CMS_SA_ALLOW try { ServiceRegistry::Operate guard(weakToken.lock()); @@ -266,113 +266,120 @@ namespace edm { size_t iTransformIndex, EventPrincipal const& iEvent, ParentContext const& iParent, - ServiceWeakToken const& weakToken) {} + ServiceWeakToken const& weakToken) noexcept {} template <> inline void WorkerT::implDoTransformAsync(WaitingTaskHolder task, size_t iTransformIndex, EventPrincipal const& iEvent, ParentContext const& iParent, - ServiceWeakToken const& weakToken) {} + ServiceWeakToken const& weakToken) noexcept {} template <> inline void WorkerT::implDoTransformAsync(WaitingTaskHolder task, size_t iTransformIndex, EventPrincipal const& iEvent, ParentContext const& iParent, - ServiceWeakToken const& weakToken) {} + ServiceWeakToken const& weakToken) noexcept {} template <> inline void WorkerT::implDoTransformAsync(WaitingTaskHolder task, size_t iTransformIndex, EventPrincipal const& iEvent, ParentContext const& iParent, - ServiceWeakToken const& weakToken) {} + ServiceWeakToken const& weakToken) noexcept {} template <> inline void WorkerT::implDoTransformAsync(WaitingTaskHolder task, size_t iTransformIndex, EventPrincipal const& iEvent, ParentContext const& iParent, - ServiceWeakToken const& weakToken) {} + ServiceWeakToken const& weakToken) noexcept {} template <> inline void WorkerT::implDoTransformAsync(WaitingTaskHolder task, size_t iTransformIndex, EventPrincipal const& iEvent, ParentContext const& iParent, - ServiceWeakToken const& weakToken) {} + ServiceWeakToken const& weakToken) noexcept {} template <> inline void WorkerT::implDoTransformAsync(WaitingTaskHolder task, size_t iTransformIndex, EventPrincipal const& iEvent, ParentContext const& iParent, - ServiceWeakToken const& weakToken) {} + ServiceWeakToken const& weakToken) noexcept { + } template - inline size_t WorkerT::transformIndex(edm::BranchDescription const&) const { + inline size_t WorkerT::transformIndex(edm::BranchDescription const&) const noexcept { return -1; } template <> - inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const { + inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const noexcept { return module_->transformIndex_(iBranch); } template <> - inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const { + inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const noexcept { return module_->transformIndex_(iBranch); } template <> - inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const { + inline size_t WorkerT::transformIndex( + edm::BranchDescription const& iBranch) const noexcept { return module_->transformIndex_(iBranch); } template <> - inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const { + inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const noexcept { return module_->transformIndex_(iBranch); } template <> - inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const { + inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const noexcept { return module_->transformIndex_(iBranch); } template <> - inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const { + inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const noexcept { return module_->transformIndex_(iBranch); } template <> - inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const { + inline size_t WorkerT::transformIndex(edm::BranchDescription const& iBranch) const noexcept { return module_->transformIndex_(iBranch); } template - inline ProductResolverIndex WorkerT::itemToGetForTransform(size_t iTransformIndex) const { + inline ProductResolverIndex WorkerT::itemToGetForTransform(size_t iTransformIndex) const noexcept { return -1; } template <> - inline ProductResolverIndex WorkerT::itemToGetForTransform(size_t iTransformIndex) const { + inline ProductResolverIndex WorkerT::itemToGetForTransform( + size_t iTransformIndex) const noexcept { return module_->transformPrefetch_(iTransformIndex); } template <> - inline ProductResolverIndex WorkerT::itemToGetForTransform(size_t iTransformIndex) const { + inline ProductResolverIndex WorkerT::itemToGetForTransform( + size_t iTransformIndex) const noexcept { return module_->transformPrefetch_(iTransformIndex); } template <> inline ProductResolverIndex WorkerT::itemToGetForTransform( - size_t iTransformIndex) const { + size_t iTransformIndex) const noexcept { return module_->transformPrefetch_(iTransformIndex); } template <> - inline ProductResolverIndex WorkerT::itemToGetForTransform(size_t iTransformIndex) const { + inline ProductResolverIndex WorkerT::itemToGetForTransform( + size_t iTransformIndex) const noexcept { return module_->transformPrefetch_(iTransformIndex); } template <> - inline ProductResolverIndex WorkerT::itemToGetForTransform(size_t iTransformIndex) const { + inline ProductResolverIndex WorkerT::itemToGetForTransform( + size_t iTransformIndex) const noexcept { return module_->transformPrefetch_(iTransformIndex); } template <> - inline ProductResolverIndex WorkerT::itemToGetForTransform(size_t iTransformIndex) const { + inline ProductResolverIndex WorkerT::itemToGetForTransform(size_t iTransformIndex) const noexcept { return module_->transformPrefetch_(iTransformIndex); } template <> - inline ProductResolverIndex WorkerT::itemToGetForTransform(size_t iTransformIndex) const { + inline ProductResolverIndex WorkerT::itemToGetForTransform( + size_t iTransformIndex) const noexcept { return module_->transformPrefetch_(iTransformIndex); } template - inline bool WorkerT::implNeedToRunSelection() const { + inline bool WorkerT::implNeedToRunSelection() const noexcept { return false; } @@ -386,7 +393,7 @@ namespace edm { inline void WorkerT::itemsToGetForSelection(std::vector&) const {} template <> - inline bool WorkerT::implNeedToRunSelection() const { + inline bool WorkerT::implNeedToRunSelection() const noexcept { return true; } @@ -403,7 +410,7 @@ namespace edm { } template <> - inline bool WorkerT::implNeedToRunSelection() const { + inline bool WorkerT::implNeedToRunSelection() const noexcept { return true; } template <> @@ -419,7 +426,7 @@ namespace edm { } template <> - inline bool WorkerT::implNeedToRunSelection() const { + inline bool WorkerT::implNeedToRunSelection() const noexcept { return true; } template <> diff --git a/FWCore/Framework/src/global/EDFilterBase.cc b/FWCore/Framework/src/global/EDFilterBase.cc index fa2c23a87c149..4d7126925de1d 100644 --- a/FWCore/Framework/src/global/EDFilterBase.cc +++ b/FWCore/Framework/src/global/EDFilterBase.cc @@ -89,18 +89,18 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry* iAct, ModuleCallingContext iMCC, - ServiceWeakToken const& iToken) { + ServiceWeakToken const& iToken) noexcept { EventForTransformer ev(iEvent, iMCC); transformAsync_(iTask, iTransformIndex, ev, iAct, iToken); } - size_t EDFilterBase::transformIndex_(edm::BranchDescription const& iBranch) const { return -1; } - ProductResolverIndex EDFilterBase::transformPrefetch_(std::size_t iIndex) const { return 0; } + size_t EDFilterBase::transformIndex_(edm::BranchDescription const& iBranch) const noexcept { return -1; } + ProductResolverIndex EDFilterBase::transformPrefetch_(std::size_t iIndex) const noexcept { return 0; } void EDFilterBase::transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const {} + ServiceWeakToken const& iToken) const noexcept {} void EDFilterBase::doPreallocate(PreallocationConfiguration const& iPrealloc) { const auto nStreams = iPrealloc.numberOfStreams(); diff --git a/FWCore/Framework/src/global/EDProducerBase.cc b/FWCore/Framework/src/global/EDProducerBase.cc index 1cbc8285383c1..e52e5c3fb86a3 100644 --- a/FWCore/Framework/src/global/EDProducerBase.cc +++ b/FWCore/Framework/src/global/EDProducerBase.cc @@ -95,18 +95,18 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry* iAct, ModuleCallingContext iMCC, - ServiceWeakToken const& iToken) { + ServiceWeakToken const& iToken) noexcept { EventForTransformer ev(iEvent, iMCC); transformAsync_(iTask, iTransformIndex, ev, iAct, iToken); } - size_t EDProducerBase::transformIndex_(edm::BranchDescription const& iBranch) const { return -1; } - ProductResolverIndex EDProducerBase::transformPrefetch_(std::size_t iIndex) const { return 0; } + size_t EDProducerBase::transformIndex_(edm::BranchDescription const& iBranch) const noexcept { return -1; } + ProductResolverIndex EDProducerBase::transformPrefetch_(std::size_t iIndex) const noexcept { return 0; } void EDProducerBase::transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const {} + ServiceWeakToken const& iToken) const noexcept {} void EDProducerBase::doPreallocate(PreallocationConfiguration const& iPrealloc) { auto const nStreams = iPrealloc.numberOfStreams(); diff --git a/FWCore/Framework/src/limited/EDFilterBase.cc b/FWCore/Framework/src/limited/EDFilterBase.cc index 738c85d5435da..e72d4fd449087 100644 --- a/FWCore/Framework/src/limited/EDFilterBase.cc +++ b/FWCore/Framework/src/limited/EDFilterBase.cc @@ -73,18 +73,18 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry* iAct, ModuleCallingContext iMCC, - ServiceWeakToken const& iToken) { + ServiceWeakToken const& iToken) noexcept { EventForTransformer ev(iEvent, iMCC); transformAsync_(iTask, iTransformIndex, ev, iAct, iToken); } - size_t EDFilterBase::transformIndex_(edm::BranchDescription const& iBranch) const { return -1; } - ProductResolverIndex EDFilterBase::transformPrefetch_(std::size_t iIndex) const { return 0; } + size_t EDFilterBase::transformIndex_(edm::BranchDescription const& iBranch) const noexcept { return -1; } + ProductResolverIndex EDFilterBase::transformPrefetch_(std::size_t iIndex) const noexcept { return 0; } void EDFilterBase::transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const {} + ServiceWeakToken const& iToken) const noexcept {} void EDFilterBase::doPreallocate(PreallocationConfiguration const& iPrealloc) { const auto nStreams = iPrealloc.numberOfStreams(); diff --git a/FWCore/Framework/src/limited/EDProducerBase.cc b/FWCore/Framework/src/limited/EDProducerBase.cc index 251310b24af87..9b25b37942535 100644 --- a/FWCore/Framework/src/limited/EDProducerBase.cc +++ b/FWCore/Framework/src/limited/EDProducerBase.cc @@ -73,18 +73,18 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry* iAct, ModuleCallingContext iMCC, - ServiceWeakToken const& iToken) { + ServiceWeakToken const& iToken) noexcept { EventForTransformer ev(iEvent, iMCC); transformAsync_(iTask, iTransformIndex, ev, iAct, iToken); } - size_t EDProducerBase::transformIndex_(edm::BranchDescription const& iBranch) const { return -1; } - ProductResolverIndex EDProducerBase::transformPrefetch_(std::size_t iIndex) const { return 0; } + size_t EDProducerBase::transformIndex_(edm::BranchDescription const& iBranch) const noexcept { return -1; } + ProductResolverIndex EDProducerBase::transformPrefetch_(std::size_t iIndex) const noexcept { return 0; } void EDProducerBase::transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const {} + ServiceWeakToken const& iToken) const noexcept {} void EDProducerBase::doPreallocate(PreallocationConfiguration const& iPrealloc) { auto const nStreams = iPrealloc.numberOfStreams(); diff --git a/FWCore/Framework/src/one/EDFilterBase.cc b/FWCore/Framework/src/one/EDFilterBase.cc index c10120425a0fd..8217902f47643 100644 --- a/FWCore/Framework/src/one/EDFilterBase.cc +++ b/FWCore/Framework/src/one/EDFilterBase.cc @@ -85,18 +85,18 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry* iAct, ModuleCallingContext iMCC, - ServiceWeakToken const& iToken) { + ServiceWeakToken const& iToken) noexcept { EventForTransformer ev(iEvent, iMCC); transformAsync_(iTask, iTransformIndex, ev, iAct, iToken); } - size_t EDFilterBase::transformIndex_(edm::BranchDescription const& iBranch) const { return -1; } - ProductResolverIndex EDFilterBase::transformPrefetch_(std::size_t iIndex) const { return 0; } + size_t EDFilterBase::transformIndex_(edm::BranchDescription const& iBranch) const noexcept { return -1; } + ProductResolverIndex EDFilterBase::transformPrefetch_(std::size_t iIndex) const noexcept { return 0; } void EDFilterBase::transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const {} + ServiceWeakToken const& iToken) const noexcept {} void EDFilterBase::doPreallocate(PreallocationConfiguration const& iPrealloc) { auto const nThreads = iPrealloc.numberOfThreads(); diff --git a/FWCore/Framework/src/one/EDProducerBase.cc b/FWCore/Framework/src/one/EDProducerBase.cc index 3a3654bc2ca2b..fe6756e4e3f20 100644 --- a/FWCore/Framework/src/one/EDProducerBase.cc +++ b/FWCore/Framework/src/one/EDProducerBase.cc @@ -76,18 +76,18 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry* iAct, ModuleCallingContext iMCC, - ServiceWeakToken const& iToken) { + ServiceWeakToken const& iToken) noexcept { EventForTransformer ev(iEvent, iMCC); transformAsync_(iTask, iTransformIndex, ev, iAct, iToken); } - size_t EDProducerBase::transformIndex_(edm::BranchDescription const& iBranch) const { return -1; } - ProductResolverIndex EDProducerBase::transformPrefetch_(std::size_t iIndex) const { return 0; } + size_t EDProducerBase::transformIndex_(edm::BranchDescription const& iBranch) const noexcept { return -1; } + ProductResolverIndex EDProducerBase::transformPrefetch_(std::size_t iIndex) const noexcept { return 0; } void EDProducerBase::transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const {} + ServiceWeakToken const& iToken) const noexcept {} void EDProducerBase::doBeginJob() { resourcesAcquirer_ = createAcquirer(); diff --git a/FWCore/Framework/src/stream/EDProducerAdaptorBase.cc b/FWCore/Framework/src/stream/EDProducerAdaptorBase.cc index 2ddba34bfa4e6..a292e576c5b88 100644 --- a/FWCore/Framework/src/stream/EDProducerAdaptorBase.cc +++ b/FWCore/Framework/src/stream/EDProducerAdaptorBase.cc @@ -34,21 +34,22 @@ namespace edm { template <> ProductResolverIndex ProducingModuleAdaptorBase::transformPrefetch_( - size_t iTransformIndex) const { + size_t iTransformIndex) const noexcept { return m_streamModules[0]->transformPrefetch_(iTransformIndex); } template <> size_t ProducingModuleAdaptorBase::transformIndex_( - edm::BranchDescription const& iBranch) const { + edm::BranchDescription const& iBranch) const noexcept { return m_streamModules[0]->transformIndex_(iBranch); } template <> - void ProducingModuleAdaptorBase::doTransformAsync(WaitingTaskHolder iTask, - size_t iTransformIndex, - EventPrincipal const& iEvent, - ActivityRegistry* iAct, - ModuleCallingContext iMCC, - ServiceWeakToken const& iToken) { + void ProducingModuleAdaptorBase::doTransformAsync( + WaitingTaskHolder iTask, + size_t iTransformIndex, + EventPrincipal const& iEvent, + ActivityRegistry* iAct, + ModuleCallingContext iMCC, + ServiceWeakToken const& iToken) noexcept { EventForTransformer ev(iEvent, iMCC); m_streamModules[iEvent.streamID()]->transformAsync_(iTask, iTransformIndex, ev, iAct, iToken); } diff --git a/FWCore/Framework/src/stream/EDProducerBase.cc b/FWCore/Framework/src/stream/EDProducerBase.cc index 90eb17f274c6f..6df7cb682a7ea 100644 --- a/FWCore/Framework/src/stream/EDProducerBase.cc +++ b/FWCore/Framework/src/stream/EDProducerBase.cc @@ -69,13 +69,13 @@ void EDProducerBase::fillDescriptions(ConfigurationDescriptions& descriptions) { descriptions.addDefault(desc); } -size_t EDProducerBase::transformIndex_(edm::BranchDescription const& iBranch) const { return -1; } -edm::ProductResolverIndex EDProducerBase::transformPrefetch_(std::size_t iIndex) const { return 0; } +size_t EDProducerBase::transformIndex_(edm::BranchDescription const& iBranch) const noexcept { return -1; } +edm::ProductResolverIndex EDProducerBase::transformPrefetch_(std::size_t iIndex) const noexcept { return 0; } void EDProducerBase::transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer& iEvent, edm::ActivityRegistry* iAct, - ServiceWeakToken const& iToken) const {} + ServiceWeakToken const& iToken) const noexcept {} void EDProducerBase::prevalidate(ConfigurationDescriptions& iConfig) { edmodule_mightGet_config(iConfig); } diff --git a/FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc b/FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc index cecde033791d7..8617f86d09ebf 100644 --- a/FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc +++ b/FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc @@ -184,11 +184,11 @@ namespace edm { } template - ProductResolverIndex ProducingModuleAdaptorBase::transformPrefetch_(size_t iTransformIndex) const { + ProductResolverIndex ProducingModuleAdaptorBase::transformPrefetch_(size_t iTransformIndex) const noexcept { return 0; } template - size_t ProducingModuleAdaptorBase::transformIndex_(edm::BranchDescription const& iBranch) const { + size_t ProducingModuleAdaptorBase::transformIndex_(edm::BranchDescription const& iBranch) const noexcept { return 0; } template @@ -197,7 +197,7 @@ namespace edm { EventPrincipal const& iEvent, ActivityRegistry*, ModuleCallingContext iMCC, - ServiceWeakToken const&) {} + ServiceWeakToken const&) noexcept {} template void ProducingModuleAdaptorBase::doBeginStream(StreamID id) { diff --git a/FWCore/Framework/test/esproducer_t.cppunit.cc b/FWCore/Framework/test/esproducer_t.cppunit.cc index 2bed35b0ab444..53e19105b7a62 100644 --- a/FWCore/Framework/test/esproducer_t.cppunit.cc +++ b/FWCore/Framework/test/esproducer_t.cppunit.cc @@ -690,7 +690,7 @@ namespace { DataKey const&, edm::EventSetupImpl const*, edm::ServiceToken const&, - edm::ESParentContext const&) override {} + edm::ESParentContext const&) noexcept override {} void invalidateCache() override {} void const* getAfterPrefetchImpl() const override { return nullptr; } }; diff --git a/FWCore/Framework/test/test_catch2notTP_InputProcessBlockCacheHolder.cc b/FWCore/Framework/test/test_catch2notTP_InputProcessBlockCacheHolder.cc index 2b14a4f724e5e..8d14cfae4d5f9 100644 --- a/FWCore/Framework/test/test_catch2notTP_InputProcessBlockCacheHolder.cc +++ b/FWCore/Framework/test/test_catch2notTP_InputProcessBlockCacheHolder.cc @@ -33,24 +33,24 @@ namespace edmtest { class TestInputBlockCacheHolder0 : public edm::global::impl::InputProcessBlockCacheHolder { public: - bool wantsProcessBlocks() const override { return true; } - bool wantsInputProcessBlocks() const override { return true; } - bool wantsGlobalRuns() const override { return true; } - bool wantsGlobalLuminosityBlocks() const override { return true; } - bool wantsStreamRuns() const override { return true; } - bool wantsStreamLuminosityBlocks() const override { return true; } + bool wantsProcessBlocks() const noexcept override { return true; } + bool wantsInputProcessBlocks() const noexcept override { return true; } + bool wantsGlobalRuns() const noexcept override { return true; } + bool wantsGlobalLuminosityBlocks() const noexcept override { return true; } + bool wantsStreamRuns() const noexcept override { return true; } + bool wantsStreamLuminosityBlocks() const noexcept override { return true; } void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {} }; class TestInputBlockCacheHolder1 : public edm::global::impl::InputProcessBlockCacheHolder { public: - bool wantsProcessBlocks() const override { return true; } - bool wantsInputProcessBlocks() const override { return true; } - bool wantsGlobalRuns() const override { return true; } - bool wantsGlobalLuminosityBlocks() const override { return true; } - bool wantsStreamRuns() const override { return true; } - bool wantsStreamLuminosityBlocks() const override { return true; } + bool wantsProcessBlocks() const noexcept override { return true; } + bool wantsInputProcessBlocks() const noexcept override { return true; } + bool wantsGlobalRuns() const noexcept override { return true; } + bool wantsGlobalLuminosityBlocks() const noexcept override { return true; } + bool wantsStreamRuns() const noexcept override { return true; } + bool wantsStreamLuminosityBlocks() const noexcept override { return true; } void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {} }; @@ -58,12 +58,12 @@ namespace edmtest { TestProcessBlockCacheA, TestProcessBlockCacheB> { public: - bool wantsProcessBlocks() const override { return true; } - bool wantsInputProcessBlocks() const override { return true; } - bool wantsGlobalRuns() const override { return true; } - bool wantsGlobalLuminosityBlocks() const override { return true; } - bool wantsStreamRuns() const override { return true; } - bool wantsStreamLuminosityBlocks() const override { return true; } + bool wantsProcessBlocks() const noexcept override { return true; } + bool wantsInputProcessBlocks() const noexcept override { return true; } + bool wantsGlobalRuns() const noexcept override { return true; } + bool wantsGlobalLuminosityBlocks() const noexcept override { return true; } + bool wantsStreamRuns() const noexcept override { return true; } + bool wantsStreamLuminosityBlocks() const noexcept override { return true; } void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {} }; @@ -72,12 +72,12 @@ namespace edmtest { TestProcessBlockCacheB, TestProcessBlockCacheC> { public: - bool wantsProcessBlocks() const override { return true; } - bool wantsInputProcessBlocks() const override { return true; } - bool wantsGlobalRuns() const override { return true; } - bool wantsGlobalLuminosityBlocks() const override { return true; } - bool wantsStreamRuns() const override { return true; } - bool wantsStreamLuminosityBlocks() const override { return true; } + bool wantsProcessBlocks() const noexcept override { return true; } + bool wantsInputProcessBlocks() const noexcept override { return true; } + bool wantsGlobalRuns() const noexcept override { return true; } + bool wantsGlobalLuminosityBlocks() const noexcept override { return true; } + bool wantsStreamRuns() const noexcept override { return true; } + bool wantsStreamLuminosityBlocks() const noexcept override { return true; } void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {} }; } // namespace edmtest diff --git a/FWCore/ServiceRegistry/interface/ModuleCallingContext.h b/FWCore/ServiceRegistry/interface/ModuleCallingContext.h index dde97a0483dae..5eb58a9a23e1f 100644 --- a/FWCore/ServiceRegistry/interface/ModuleCallingContext.h +++ b/FWCore/ServiceRegistry/interface/ModuleCallingContext.h @@ -40,27 +40,27 @@ namespace edm { kInvalid }; - ModuleCallingContext(ModuleDescription const* moduleDescription); + ModuleCallingContext(ModuleDescription const* moduleDescription) noexcept; ModuleCallingContext(ModuleDescription const* moduleDescription, std::uintptr_t id, State state, ParentContext const& parent, - ModuleCallingContext const* previousOnThread); + ModuleCallingContext const* previousOnThread) noexcept; - void setContext(State state, ParentContext const& parent, ModuleCallingContext const* previousOnThread); + void setContext(State state, ParentContext const& parent, ModuleCallingContext const* previousOnThread) noexcept; - void setState(State state) { state_ = state; } + void setState(State state) noexcept { state_ = state; } - ModuleDescription const* moduleDescription() const { return moduleDescription_; } - State state() const { return state_; } - Type type() const { return parent_.type(); } + ModuleDescription const* moduleDescription() const noexcept { return moduleDescription_; } + State state() const noexcept { return state_; } + Type type() const noexcept { return parent_.type(); } /** Returns a unique id for this module to differentiate possibly concurrent calls to the module. The value returned may be large so not appropriate for an index lookup. A value of 0 denotes a call to produce, analyze or filter. Other values denote a transform. */ - std::uintptr_t callID() const { return id_; } - ParentContext const& parent() const { return parent_; } + std::uintptr_t callID() const noexcept { return id_; } + ParentContext const& parent() const noexcept { return parent_; } ModuleCallingContext const* moduleCallingContext() const { return parent_.moduleCallingContext(); } PlaceInPathContext const* placeInPathContext() const { return parent_.placeInPathContext(); } StreamContext const* streamContext() const { return parent_.streamContext(); } @@ -70,19 +70,19 @@ namespace edm { // These functions will iterate up a series of linked context objects // to find the StreamContext or GlobalContext at the top of the series. // Throws if the top context object does not have that type. - StreamContext const* getStreamContext() const; - GlobalContext const* getGlobalContext() const; + StreamContext const* getStreamContext() const noexcept(false); + GlobalContext const* getGlobalContext() const noexcept(false); // This function will iterate up a series of linked context objects to // find the highest level ModuleCallingContext. It will often return a // pointer to itself. - ModuleCallingContext const* getTopModuleCallingContext() const; + ModuleCallingContext const* getTopModuleCallingContext() const noexcept; // Returns the number of ModuleCallingContexts above this ModuleCallingContext // in the series of linked context objects. - unsigned depth() const; + unsigned depth() const noexcept; - ModuleCallingContext const* previousModuleOnThread() const { return previousModuleOnThread_; } + ModuleCallingContext const* previousModuleOnThread() const noexcept { return previousModuleOnThread_; } private: ModuleCallingContext const* previousModuleOnThread_; diff --git a/FWCore/ServiceRegistry/interface/ParentContext.h b/FWCore/ServiceRegistry/interface/ParentContext.h index f7abad1af8c57..34ce7eb63ad10 100644 --- a/FWCore/ServiceRegistry/interface/ParentContext.h +++ b/FWCore/ServiceRegistry/interface/ParentContext.h @@ -28,22 +28,22 @@ namespace edm { public: enum class Type { kGlobal, kInternal, kModule, kPlaceInPath, kStream, kInvalid }; - ParentContext(); - ParentContext(GlobalContext const*); - ParentContext(InternalContext const*); - ParentContext(ModuleCallingContext const*); - ParentContext(PlaceInPathContext const*); - ParentContext(StreamContext const*); - - Type type() const { return type_; } - - bool isAtEndTransition() const; - - GlobalContext const* globalContext() const; - InternalContext const* internalContext() const; - ModuleCallingContext const* moduleCallingContext() const; - PlaceInPathContext const* placeInPathContext() const; - StreamContext const* streamContext() const; + ParentContext() noexcept; + ParentContext(GlobalContext const*) noexcept; + ParentContext(InternalContext const*) noexcept; + ParentContext(ModuleCallingContext const*) noexcept; + ParentContext(PlaceInPathContext const*) noexcept; + ParentContext(StreamContext const*) noexcept; + + [[nodiscard]] Type type() const noexcept { return type_; } + + bool isAtEndTransition() const noexcept; + + GlobalContext const* globalContext() const noexcept(false); + InternalContext const* internalContext() const noexcept(false); + ModuleCallingContext const* moduleCallingContext() const noexcept(false); + PlaceInPathContext const* placeInPathContext() const noexcept(false); + StreamContext const* streamContext() const noexcept(false); private: Type type_; diff --git a/FWCore/ServiceRegistry/src/ModuleCallingContext.cc b/FWCore/ServiceRegistry/src/ModuleCallingContext.cc index bb9ae9bf71283..b1daf17202ac1 100644 --- a/FWCore/ServiceRegistry/src/ModuleCallingContext.cc +++ b/FWCore/ServiceRegistry/src/ModuleCallingContext.cc @@ -11,7 +11,7 @@ namespace edm { - ModuleCallingContext::ModuleCallingContext(ModuleDescription const* moduleDescription) + ModuleCallingContext::ModuleCallingContext(ModuleDescription const* moduleDescription) noexcept : previousModuleOnThread_(nullptr), moduleDescription_(moduleDescription), parent_(), @@ -22,7 +22,7 @@ namespace edm { std::uintptr_t id, State state, ParentContext const& parent, - ModuleCallingContext const* previousOnThread) + ModuleCallingContext const* previousOnThread) noexcept : previousModuleOnThread_(previousOnThread), moduleDescription_(moduleDescription), parent_(parent), @@ -31,13 +31,13 @@ namespace edm { void ModuleCallingContext::setContext(State state, ParentContext const& parent, - ModuleCallingContext const* previousOnThread) { + ModuleCallingContext const* previousOnThread) noexcept { state_ = state; parent_ = parent; previousModuleOnThread_ = previousOnThread; } - StreamContext const* ModuleCallingContext::getStreamContext() const { + StreamContext const* ModuleCallingContext::getStreamContext() const noexcept(false) { ModuleCallingContext const* mcc = getTopModuleCallingContext(); if (mcc->type() == ParentContext::Type::kPlaceInPath) { return mcc->placeInPathContext()->pathContext()->streamContext(); @@ -48,7 +48,7 @@ namespace edm { return mcc->streamContext(); } - GlobalContext const* ModuleCallingContext::getGlobalContext() const { + GlobalContext const* ModuleCallingContext::getGlobalContext() const noexcept(false) { ModuleCallingContext const* mcc = getTopModuleCallingContext(); if (mcc->type() != ParentContext::Type::kGlobal) { throw Exception(errors::LogicError) @@ -57,7 +57,7 @@ namespace edm { return mcc->globalContext(); } - ModuleCallingContext const* ModuleCallingContext::getTopModuleCallingContext() const { + ModuleCallingContext const* ModuleCallingContext::getTopModuleCallingContext() const noexcept { ModuleCallingContext const* mcc = this; while (mcc->type() == ParentContext::Type::kModule) { mcc = mcc->moduleCallingContext(); @@ -71,7 +71,7 @@ namespace edm { return mcc; } - unsigned ModuleCallingContext::depth() const { + unsigned ModuleCallingContext::depth() const noexcept { unsigned depth = 0; ModuleCallingContext const* mcc = this; while (mcc->type() == ParentContext::Type::kModule) { diff --git a/FWCore/ServiceRegistry/src/ParentContext.cc b/FWCore/ServiceRegistry/src/ParentContext.cc index bffec876da911..8e38c557ca7a9 100644 --- a/FWCore/ServiceRegistry/src/ParentContext.cc +++ b/FWCore/ServiceRegistry/src/ParentContext.cc @@ -12,58 +12,60 @@ namespace edm { - ParentContext::ParentContext() : type_(Type::kInvalid) { parent_.global = nullptr; } + ParentContext::ParentContext() noexcept : type_(Type::kInvalid) { parent_.global = nullptr; } - ParentContext::ParentContext(GlobalContext const* global) : type_(Type::kGlobal) { parent_.global = global; } + ParentContext::ParentContext(GlobalContext const* global) noexcept : type_(Type::kGlobal) { parent_.global = global; } - ParentContext::ParentContext(InternalContext const* internal) : type_(Type::kInternal) { + ParentContext::ParentContext(InternalContext const* internal) noexcept : type_(Type::kInternal) { parent_.internal = internal; } - ParentContext::ParentContext(ModuleCallingContext const* module) : type_(Type::kModule) { parent_.module = module; } + ParentContext::ParentContext(ModuleCallingContext const* module) noexcept : type_(Type::kModule) { + parent_.module = module; + } - ParentContext::ParentContext(PlaceInPathContext const* placeInPath) : type_(Type::kPlaceInPath) { + ParentContext::ParentContext(PlaceInPathContext const* placeInPath) noexcept : type_(Type::kPlaceInPath) { parent_.placeInPath = placeInPath; } - ParentContext::ParentContext(StreamContext const* stream) : type_(Type::kStream) { parent_.stream = stream; } + ParentContext::ParentContext(StreamContext const* stream) noexcept : type_(Type::kStream) { parent_.stream = stream; } - ModuleCallingContext const* ParentContext::moduleCallingContext() const { + ModuleCallingContext const* ParentContext::moduleCallingContext() const noexcept(false) { if (type_ != Type::kModule) { throw Exception(errors::LogicError) << "ParentContext::moduleCallingContext called for incorrect type of context"; } return parent_.module; } - PlaceInPathContext const* ParentContext::placeInPathContext() const { + PlaceInPathContext const* ParentContext::placeInPathContext() const noexcept(false) { if (type_ != Type::kPlaceInPath) { throw Exception(errors::LogicError) << "ParentContext::placeInPathContext called for incorrect type of context"; } return parent_.placeInPath; } - StreamContext const* ParentContext::streamContext() const { + StreamContext const* ParentContext::streamContext() const noexcept(false) { if (type_ != Type::kStream) { throw Exception(errors::LogicError) << "ParentContext::streamContext called for incorrect type of context"; } return parent_.stream; } - GlobalContext const* ParentContext::globalContext() const { + GlobalContext const* ParentContext::globalContext() const noexcept(false) { if (type_ != Type::kGlobal) { throw Exception(errors::LogicError) << "ParentContext::globalContext called for incorrect type of context"; } return parent_.global; } - InternalContext const* ParentContext::internalContext() const { + InternalContext const* ParentContext::internalContext() const noexcept(false) { if (type_ != Type::kInternal) { throw Exception(errors::LogicError) << "ParentContext::internalContext called for incorrect type of context"; } return parent_.internal; } - bool ParentContext::isAtEndTransition() const { + bool ParentContext::isAtEndTransition() const noexcept { switch (type_) { case Type::kGlobal: { return parent_.global->isAtEndTransition(); diff --git a/FWCore/TestProcessor/interface/TestESProductResolver.h b/FWCore/TestProcessor/interface/TestESProductResolver.h index f694740c4735d..5d2cce015bac3 100644 --- a/FWCore/TestProcessor/interface/TestESProductResolver.h +++ b/FWCore/TestProcessor/interface/TestESProductResolver.h @@ -42,7 +42,7 @@ namespace edm { eventsetup::DataKey const&, EventSetupImpl const*, ServiceToken const&, - ESParentContext const&) final { + ESParentContext const&) noexcept final { return; } diff --git a/IOPool/Input/src/RootFile.cc b/IOPool/Input/src/RootFile.cc index 2e90fef497cc6..f41c45b6ca2e7 100644 --- a/IOPool/Input/src/RootFile.cc +++ b/IOPool/Input/src/RootFile.cc @@ -2216,7 +2216,7 @@ namespace edm { void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const* moduleCallingContext, unsigned int transitionIndex, - std::atomic*>& writeTo) const override; + std::atomic*>& writeTo) const noexcept override; edm::propagate_const rootTree_; edm::propagate_const provBranch_; @@ -2302,10 +2302,11 @@ namespace edm { } } // namespace - void ReducedProvenanceReader::readProvenanceAsync(WaitingTaskHolder task, - ModuleCallingContext const* moduleCallingContext, - unsigned int transitionIndex, - std::atomic*>& writeTo) const { + void ReducedProvenanceReader::readProvenanceAsync( + WaitingTaskHolder task, + ModuleCallingContext const* moduleCallingContext, + unsigned int transitionIndex, + std::atomic*>& writeTo) const noexcept { readProvenanceAsyncImpl(this, acquirer_.serialQueueChain(), task, @@ -2356,7 +2357,7 @@ namespace edm { void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const* moduleCallingContext, unsigned int transitionIndex, - std::atomic*>& writeTo) const override; + std::atomic*>& writeTo) const noexcept override; RootTree* rootTree_; ProductProvenanceVector infoVector_; @@ -2376,10 +2377,11 @@ namespace edm { mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second), acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {} - void FullProvenanceReader::readProvenanceAsync(WaitingTaskHolder task, - ModuleCallingContext const* moduleCallingContext, - unsigned int transitionIndex, - std::atomic*>& writeTo) const { + void FullProvenanceReader::readProvenanceAsync( + WaitingTaskHolder task, + ModuleCallingContext const* moduleCallingContext, + unsigned int transitionIndex, + std::atomic*>& writeTo) const noexcept { readProvenanceAsyncImpl(this, acquirer_.serialQueueChain(), task, @@ -2422,7 +2424,7 @@ namespace edm { void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const* moduleCallingContext, unsigned int transitionIndex, - std::atomic*>& writeTo) const override; + std::atomic*>& writeTo) const noexcept override; edm::propagate_const rootTree_; std::vector infoVector_; @@ -2446,10 +2448,11 @@ namespace edm { mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second), acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {} - void OldProvenanceReader::readProvenanceAsync(WaitingTaskHolder task, - ModuleCallingContext const* moduleCallingContext, - unsigned int transitionIndex, - std::atomic*>& writeTo) const { + void OldProvenanceReader::readProvenanceAsync( + WaitingTaskHolder task, + ModuleCallingContext const* moduleCallingContext, + unsigned int transitionIndex, + std::atomic*>& writeTo) const noexcept { readProvenanceAsyncImpl(this, acquirer_.serialQueueChain(), task, @@ -2491,7 +2494,7 @@ namespace edm { void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const* moduleCallingContext, unsigned int transitionIndex, - std::atomic*>& writeTo) const override; + std::atomic*>& writeTo) const noexcept override; }; DummyProvenanceReader::DummyProvenanceReader() : ProvenanceReaderBase() {} @@ -2500,10 +2503,11 @@ namespace edm { // Not providing parentage!!! return std::set{}; } - void DummyProvenanceReader::readProvenanceAsync(WaitingTaskHolder task, - ModuleCallingContext const* moduleCallingContext, - unsigned int transitionIndex, - std::atomic*>& writeTo) const { + void DummyProvenanceReader::readProvenanceAsync( + WaitingTaskHolder task, + ModuleCallingContext const* moduleCallingContext, + unsigned int transitionIndex, + std::atomic*>& writeTo) const noexcept { if (nullptr == writeTo.load()) { auto emptyProv = std::make_unique>(); const std::set* expected = nullptr; diff --git a/IOPool/Output/interface/PoolOutputModule.h b/IOPool/Output/interface/PoolOutputModule.h index d282d270ae05c..07fc2104073d4 100644 --- a/IOPool/Output/interface/PoolOutputModule.h +++ b/IOPool/Output/interface/PoolOutputModule.h @@ -144,7 +144,7 @@ namespace edm { private: void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& iModuleCallingContext, - Principal const& iPrincipal) const override; + Principal const& iPrincipal) const noexcept override; void openFile(FileBlock const& fb) override; void respondToOpenInputFile(FileBlock const& fb) override; diff --git a/IOPool/Output/src/PoolOutputModule.cc b/IOPool/Output/src/PoolOutputModule.cc index ccfd731b94136..1b1b74605a952 100644 --- a/IOPool/Output/src/PoolOutputModule.cc +++ b/IOPool/Output/src/PoolOutputModule.cc @@ -424,7 +424,7 @@ namespace edm { void PoolOutputModule::preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const& iModuleCallingContext, - Principal const& iPrincipal) const { + Principal const& iPrincipal) const noexcept { if (DropAll != dropMetaData_) { auto const* ep = dynamic_cast(&iPrincipal); if (ep) {