artdaq
v2_02_03
|
A TransferInterface implementation plugin that transfers data using Shared Memory. More...
#include <artdaq/TransferPlugins/ShmemTransfer.hh>
Public Member Functions | |
ShmemTransfer (fhicl::ParameterSet const &pset, Role role) | |
ShmemTransfer Constructor. More... | |
virtual | ~ShmemTransfer () noexcept |
ShmemTransfer Destructor. | |
int | receiveFragment (Fragment &fragment, size_t receiveTimeout) override |
Receive a Fragment from Shared Memory. More... | |
CopyStatus | copyFragment (Fragment &fragment, size_t send_timeout_usec=std::numeric_limits< size_t >::max()) override |
Copy a Fragment to the destination. May be unreliable. More... | |
CopyStatus | moveFragment (Fragment &&fragment, size_t send_timeout_usec=std::numeric_limits< size_t >::max()) override |
Move a Fragment to the destination. More... | |
![]() | |
TransferInterface (const fhicl::ParameterSet &ps, Role role) | |
TransferInterface Constructor. More... | |
TransferInterface (const TransferInterface &)=delete | |
Copy Constructor is deleted. | |
TransferInterface & | operator= (const TransferInterface &)=delete |
Copy Assignment operator is deleted. More... | |
virtual | ~TransferInterface ()=default |
Default virtual Destructor. | |
virtual int | receiveFragment (artdaq::Fragment &fragment, size_t receiveTimeout)=0 |
Receive a Fragment from the transport mechanism. More... | |
virtual CopyStatus | copyFragment (artdaq::Fragment &fragment, size_t send_timeout_usec=std::numeric_limits< size_t >::max())=0 |
Copy a Fragment to the destination. May not necessarily be reliable. More... | |
virtual CopyStatus | moveFragment (artdaq::Fragment &&fragment, size_t send_timeout_usec=std::numeric_limits< size_t >::max())=0 |
Move a Fragment to the destination. This should be reliable, if the underlying transport mechanism supports reliable sending. More... | |
std::string | uniqueLabel () const |
Get the unique label of this TransferInterface instance. More... | |
int | source_rank () const |
Get the source rank for this TransferInterface instance. More... | |
int | destination_rank () const |
Get the destination rank for this TransferInterface instance. More... | |
Additional Inherited Members | |
![]() | |
enum | Role { Role::kSend, Role::kReceive } |
Used to determine if a TransferInterface is a Sender or Receiver. More... | |
enum | CopyStatus { CopyStatus::kSuccess, CopyStatus::kTimeout, CopyStatus::kErrorNotRequiringException } |
Returned from the send functions, this enumeration describes the possible return codes. If an exception occurs, it will be thrown and should be handled normally. More... | |
![]() | |
static const int | RECV_TIMEOUT = 0xfedcba98 |
Value to be returned upon receive timeout. Because receivers otherwise return rank, this is also the limit on the number of ranks that artdaq currently supports. | |
![]() | |
Role | role () const |
Get the TransferInterface::Role of this TransferInterface. More... | |
![]() | |
size_t | buffer_count_ |
The number of Fragment transfers the TransferInterface can handle simultaneously. | |
const size_t | max_fragment_size_words_ |
The maximum size of the transferred Fragment objects, in artdaq::Fragment::RawDataType words. | |
A TransferInterface implementation plugin that transfers data using Shared Memory.
Definition at line 19 of file ShmemTransfer.hh.
artdaq::ShmemTransfer::ShmemTransfer | ( | fhicl::ParameterSet const & | pset, |
Role | role | ||
) |
ShmemTransfer Constructor.
pset | ParameterSet used to configure ShmemTransfer |
role | Role of this ShmemTransfer instance (kSend or kReceive) |
* ShmemTransfer accepts the following Parameters: * "shm_key" (Default: hash of uniqueLabel): Key to use for shared memory segment *
ShmemTransfer also requires all Parameters for configuring a TransferInterface
Definition at line 8 of file Shmem_transfer.cc.
|
override |
Copy a Fragment to the destination. May be unreliable.
fragment | Fragment to copy |
send_timeout_usec | Timeout for send, in microseconds (default size_t::MAX_VALUE) |
Definition at line 200 of file Shmem_transfer.cc.
|
override |
Move a Fragment to the destination.
fragment | Fragment to move |
send_timeout_usec | Timeout for send, in microseconds (default size_t::MAX_VALUE) |
Definition at line 206 of file Shmem_transfer.cc.
|
override |
Receive a Fragment from Shared Memory.
[out] | fragment | Received Fragment |
receiveTimeout | Timeout for receive, in microseconds |
Definition at line 118 of file Shmem_transfer.cc.