CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
edm::SwitchAliasProductResolver Class Reference

#include <ProductResolvers.h>

Inheritance diagram for edm::SwitchAliasProductResolver:
edm::SwitchBaseProductResolver edm::DataManagingOrAliasProductResolver edm::ProductResolverBase

Public Member Functions

 SwitchAliasProductResolver (std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
 
- Public Member Functions inherited from edm::SwitchBaseProductResolver
void connectTo (ProductResolverBase const &iOther, Principal const *iParentPrincipal) final
 
void setupUnscheduled (UnscheduledConfigurator const &iConfigure) final
 
 SwitchBaseProductResolver (std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
 
- Public Member Functions inherited from edm::DataManagingOrAliasProductResolver
 DataManagingOrAliasProductResolver ()
 
- Public Member Functions inherited from edm::ProductResolverBase
BranchDescription const & branchDescription () const
 
std::string const & moduleLabel () const
 
ProductResolverBaseoperator= (ProductResolverBase const &)=delete
 
void prefetchAsync (WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
std::string const & processName () const
 
ProductID const & productID () const
 
std::string const & productInstanceName () const
 
ProductProvenance const * productProvenancePtr () const
 
bool productResolved () const
 
 ProductResolverBase ()
 
 ProductResolverBase (ProductResolverBase const &)=delete
 
TypeID productType () const
 
bool productUnavailable () const
 
bool productWasDeleted () const
 
bool productWasFetchedAndIsValid (bool iSkipCurrentProcess) const
 
Provenance const * provenance () const
 
bool provenanceAvailable () const
 
void resetBranchDescription (std::shared_ptr< BranchDescription const > bd)
 
void resetProductData ()
 
std::string const & resolvedModuleLabel () const
 
Resolution resolveProduct (Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
void retrieveAndMerge (Principal const &principal, MergeableRunProductMetadata const *mergeableRunProductMetadata) const
 
void setMergeableRunProductMetadata (MergeableRunProductMetadata const *mrpm)
 
void setProductID (ProductID const &pid)
 
void setProductProvenanceRetriever (ProductProvenanceRetriever const *provRetriever)
 
bool singleProduct () const
 
StableProvenance const * stableProvenance () const
 
void unsafe_deleteProduct () const
 
bool unscheduledWasNotRun () const
 
void write (std::ostream &os) const
 
virtual ~ProductResolverBase ()
 

Private Member Functions

void prefetchAsync_ (WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const final
 
bool productUnavailable_ () const final
 
Resolution resolveProduct_ (Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const final
 
bool unscheduledWasNotRun_ () const final
 

Additional Inherited Members

- Public Types inherited from edm::SwitchBaseProductResolver
using ProductStatus = DataManagingProductResolver::ProductStatus
 
- Protected Member Functions inherited from edm::SwitchBaseProductResolver
std::atomic< bool > & prefetchRequested () const
 
DataManagingOrAliasProductResolver const & realProduct () const
 
void resetProductData_ (bool deleteEarly) override
 
Resolution resolveProductImpl (Resolution) const
 
void unsafe_setWrapperAndProvenance () const
 
WaitingTaskListwaitingTasks () const
 
Workerworker () const
 

Detailed Description

Definition at line 389 of file ProductResolvers.h.

Constructor & Destructor Documentation

◆ SwitchAliasProductResolver()

edm::SwitchAliasProductResolver::SwitchAliasProductResolver ( std::shared_ptr< BranchDescription const >  bd,
DataManagingOrAliasProductResolver realProduct 
)
inline

Definition at line 391 of file ProductResolvers.h.

SwitchBaseProductResolver(std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
DataManagingOrAliasProductResolver const & realProduct() const
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

◆ prefetchAsync_()

void edm::SwitchAliasProductResolver::prefetchAsync_ ( WaitingTaskHolder  waitTask,
Principal const &  principal,
bool  skipCurrentProcess,
ServiceToken const &  token,
SharedResourcesAcquirer sra,
ModuleCallingContext const *  mcc 
) const
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 762 of file ProductResolvers.cc.

References edm::WaitingTaskList::add(), edm::WaitingTaskList::doneWaiting(), edm::WaitingTaskHolder::group(), edm::make_waiting_task(), edm::ProductResolverBase::prefetchAsync(), edm::SwitchBaseProductResolver::prefetchRequested(), edm::SwitchBaseProductResolver::realProduct(), unpackBuffers-CaloStage2::token, edm::SwitchBaseProductResolver::unsafe_setWrapperAndProvenance(), and edm::SwitchBaseProductResolver::waitingTasks().

767  {
768  if (skipCurrentProcess) {
769  return;
770  }
771 
772  //need to try changing prefetchRequested_ before adding to waitingTasks_
773  bool expected = false;
774  bool doPrefetchRequested = prefetchRequested().compare_exchange_strong(expected, true);
775  waitingTasks().add(waitTask);
776 
777  if (doPrefetchRequested) {
778  //using a waiting task to do a callback guarantees that
779  // the waitingTasks() list will be released from waiting even
780  // if the module does not put this data product or the
781  // module has an exception while running
782  auto waiting = make_waiting_task([this](std::exception_ptr const* iException) {
783  if (nullptr != iException) {
784  waitingTasks().doneWaiting(*iException);
785  } else {
787  waitingTasks().doneWaiting(std::exception_ptr());
788  }
789  });
791  WaitingTaskHolder(*waitTask.group(), waiting), principal, skipCurrentProcess, token, sra, mcc);
792  }
793  }
WaitingTaskList & waitingTasks() const
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
DataManagingOrAliasProductResolver const & realProduct() const
void add(oneapi::tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
void prefetchAsync(WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
std::atomic< bool > & prefetchRequested() const

◆ productUnavailable_()

bool edm::SwitchAliasProductResolver::productUnavailable_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 407 of file ProductResolvers.h.

References edm::ProductResolverBase::productUnavailable().

407 { return realProduct().productUnavailable(); }
DataManagingOrAliasProductResolver const & realProduct() const

◆ resolveProduct_()

ProductResolverBase::Resolution edm::SwitchAliasProductResolver::resolveProduct_ ( Principal const &  principal,
bool  skipCurrentProcess,
SharedResourcesAcquirer sra,
ModuleCallingContext const *  mcc 
) const
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 755 of file ProductResolvers.cc.

References edm::SwitchBaseProductResolver::realProduct(), edm::ProductResolverBase::resolveProduct(), and edm::SwitchBaseProductResolver::resolveProductImpl().

758  {
759  return resolveProductImpl(realProduct().resolveProduct(principal, skipCurrentProcess, sra, mcc));
760  }
Resolution resolveProduct(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
DataManagingOrAliasProductResolver const & realProduct() const
Resolution resolveProductImpl(Resolution) const

◆ unscheduledWasNotRun_()

bool edm::SwitchAliasProductResolver::unscheduledWasNotRun_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 406 of file ProductResolvers.h.

References edm::ProductResolverBase::unscheduledWasNotRun().

406 { return realProduct().unscheduledWasNotRun(); }
DataManagingOrAliasProductResolver const & realProduct() const