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.

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 772 of file ProductResolvers.cc.

777  {
778  if (skipCurrentProcess) {
779  return;
780  }
781 
782  //need to try changing prefetchRequested_ before adding to waitingTasks_
783  bool expected = false;
784  bool doPrefetchRequested = prefetchRequested().compare_exchange_strong(expected, true);
785  waitingTasks().add(waitTask);
786 
787  if (doPrefetchRequested) {
788  //using a waiting task to do a callback guarantees that
789  // the waitingTasks() list will be released from waiting even
790  // if the module does not put this data product or the
791  // module has an exception while running
792  auto waiting = make_waiting_task([this](std::exception_ptr const* iException) {
793  if (nullptr != iException) {
794  waitingTasks().doneWaiting(*iException);
795  } else {
797  waitingTasks().doneWaiting(std::exception_ptr());
798  }
799  });
801  WaitingTaskHolder(*waitTask.group(), waiting), principal, skipCurrentProcess, token, sra, mcc);
802  }
803  }

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().

◆ productUnavailable_()

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

Implements edm::ProductResolverBase.

Definition at line 407 of file ProductResolvers.h.

407 { return realProduct().productUnavailable(); }

References edm::ProductResolverBase::productUnavailable().

◆ resolveProduct_()

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

◆ unscheduledWasNotRun_()

bool edm::SwitchAliasProductResolver::unscheduledWasNotRun_ ( ) const
inlinefinalprivatevirtual
deep_tau::DeepTauBase::BasicDiscriminator
BasicDiscriminator
Definition: DeepTauBase.h:115
edm::SwitchBaseProductResolver::waitingTasks
WaitingTaskList & waitingTasks() const
Definition: ProductResolvers.h:319
edm::ProductResolverBase::prefetchAsync
void prefetchAsync(WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: ProductResolverBase.h:69
edm::ProductResolverBase::productUnavailable
bool productUnavailable() const
Definition: ProductResolverBase.h:87
edm::ProductResolverBase::unscheduledWasNotRun
bool unscheduledWasNotRun() const
Definition: ProductResolverBase.h:97
edm::SwitchBaseProductResolver::resolveProductImpl
Resolution resolveProductImpl(Resolution) const
Definition: ProductResolvers.cc:646
edm::WaitingTaskList::doneWaiting
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
Definition: WaitingTaskList.cc:212
edm::SwitchBaseProductResolver::realProduct
DataManagingOrAliasProductResolver const & realProduct() const
Definition: ProductResolvers.h:321
WaitingTaskHolder
edm::ProductResolverBase::resolveProduct
Resolution resolveProduct(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: ProductResolverBase.h:60
edm::make_waiting_task
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
edm::WaitingTaskList::add
void add(tbb::task_group *, WaitingTask *)
Adds task to the waiting list.
Definition: WaitingTaskList.cc:125
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::SwitchBaseProductResolver::prefetchRequested
std::atomic< bool > & prefetchRequested() const
Definition: ProductResolvers.h:322
edm::SwitchBaseProductResolver::unsafe_setWrapperAndProvenance
void unsafe_setWrapperAndProvenance() const
Definition: ProductResolvers.cc:678
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316
edm::SwitchBaseProductResolver::SwitchBaseProductResolver
SwitchBaseProductResolver(std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
Definition: ProductResolvers.cc:626