#include <EDMetadata.h>
Public Member Functions | |
Device | device () const |
void | discardEvent () |
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 > | eventComplete_ = false |
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 10 of file EDMetadata.cc.
References CMS_SA_ALLOW, event_, eventComplete_, mayReuseQueue_, and SequenceTypes::wait().
|
inline |
Definition at line 67 of file EDMetadata.h.
References queue_.
|
inline |
Definition at line 76 of file EDMetadata.h.
References event_.
void ALPAKA_ACCELERATOR_NAMESPACE::EDMetadata::enqueueCallback | ( | edm::WaitingTaskWithArenaHolder | holder | ) |
Definition at line 34 of file EDMetadata.cc.
References EDM_STRINGIZE, event_, eostools::move(), recordEvent(), edm::Async::runAsync(), and SequenceTypes::wait().
|
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_.
Referenced by enqueueCallback().
void ALPAKA_ACCELERATOR_NAMESPACE::EDMetadata::synchronize | ( | EDMetadata & | consumer, |
bool | tryReuseQueue | ||
) | const |
Synchronizes 'consumer' metadata wrt. 'this' in the event product
Definition at line 43 of file EDMetadata.cc.
References OfflineOutput_cfi::consumer, event_, eventComplete_, 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 83 of file EDMetadata.cc.
References mayReuseQueue_, and queue_.
Referenced by synchronize().
|
private |
Definition at line 91 of file EDMetadata.h.
Referenced by discardEvent(), enqueueCallback(), recordEvent(), synchronize(), and ~EDMetadata().
|
mutableprivate |
Definition at line 97 of file EDMetadata.h.
Referenced by synchronize(), and ~EDMetadata().
|
mutableprivate |
Definition at line 95 of file EDMetadata.h.
Referenced by tryReuseQueue_(), and ~EDMetadata().
|
private |
Definition at line 90 of file EDMetadata.h.
Referenced by device(), queue(), recordEvent(), synchronize(), and tryReuseQueue_().