#include <EDMetadata.h>
Public Member Functions | |
Device | device () const |
EDMetadata (std::shared_ptr< Queue > queue, std::shared_ptr< Event > event) | |
void | enqueueCallback (edm::WaitingTaskWithArenaHolder holder) |
Queue & | queue () const |
void | recordEvent () |
void | synchronize (EDMetadata &consumer, bool tryReuseQueue) const |
~EDMetadata () | |
Private Member Functions | |
std::shared_ptr< Queue > | tryReuseQueue_ () const |
Private Attributes | |
std::shared_ptr< Event > | event_ |
std::atomic< bool > | mayReuseQueue_ = true |
std::shared_ptr< Queue > | queue_ |
The EDMetadata class provides the exact synchronization mechanisms for Event data products for backends with asynchronous Queue. These include
For synchronous backends the EDMetadata acts as an owner of the Queue object, as no further synchronization is needed.
EDMetadata is used as the Metadata class for edm::DeviceProduct<T>, and is an implementation detail (not visible to user code).
TODO: What to do with device-synchronous backends? The data product needs to be wrapped into the edm::DeviceProduct, but the EDMetadata class used there does not need anything except "dummy" implementation of synchronize(). The question is clearly solvable, so maybe leave it to the time we would actually need one?
Definition at line 61 of file EDMetadata.h.
|
inline |
Definition at line 63 of file EDMetadata.h.
ALPAKA_ACCELERATOR_NAMESPACE::EDMetadata::~EDMetadata | ( | ) |
Definition at line 8 of file EDMetadata.cc.
References CMS_SA_ALLOW, event_, and SequenceTypes::wait().
|
inline |
Definition at line 67 of file EDMetadata.h.
References queue_.
void ALPAKA_ACCELERATOR_NAMESPACE::EDMetadata::enqueueCallback | ( | edm::WaitingTaskWithArenaHolder | holder | ) |
Definition at line 25 of file EDMetadata.cc.
References eostools::move(), and queue_.
|
inline |
Definition at line 71 of file EDMetadata.h.
References queue_.
Referenced by synchronize().
|
inline |
Definition at line 75 of file EDMetadata.h.
References event_, and queue_.
void ALPAKA_ACCELERATOR_NAMESPACE::EDMetadata::synchronize | ( | EDMetadata & | consumer, |
bool | tryReuseQueue | ||
) | const |
Synchronizes 'consumer' metadata wrt. 'this' in the event product
Definition at line 33 of file EDMetadata.cc.
References OfflineOutput_cfi::consumer, event_, Exception, edm::errors::LogicError, queue(), queue_, tryReuseQueue_(), and SequenceTypes::wait().
|
private |
Returns a shared_ptr to the Queue if it can be reused, or a null shared_ptr if not
Definition at line 60 of file EDMetadata.cc.
References mayReuseQueue_, and queue_.
Referenced by synchronize().
|
private |
Definition at line 90 of file EDMetadata.h.
Referenced by recordEvent(), synchronize(), and ~EDMetadata().
|
mutableprivate |
Definition at line 94 of file EDMetadata.h.
Referenced by tryReuseQueue_().
|
private |
Definition at line 89 of file EDMetadata.h.
Referenced by device(), enqueueCallback(), queue(), recordEvent(), synchronize(), and tryReuseQueue_().