artdaq  v3_00_03
artdaq::MPITransfer Class Reference

MPITransfer is a TransferInterface implementation plugin that transfers data using MPI. More...

#include <artdaq/TransferPlugins/MPITransfer.hh>

Inheritance diagram for artdaq::MPITransfer:
artdaq::TransferInterface

Public Member Functions

 MPITransfer (fhicl::ParameterSet pset, Role role)
 MPITransfer Constructor. More...
 
 MPITransfer (const MPITransfer &)=delete
 Copy Constructor is deleted.
 
MPITransferoperator= (const MPITransfer &)=delete
 Copy Assignment operator is deleted. More...
 
virtual ~MPITransfer ()
 MPITransfer Destructor.
 
CopyStatus copyFragment (Fragment &frag, size_t timeout_usec=std::numeric_limits< size_t >::max()) override
 Copy a Fragment to the destination. Forces asynchronous send. More...
 
CopyStatus moveFragment (Fragment &&frag, size_t timeout_usec=std::numeric_limits< size_t >::max()) override
 Move a Fragment to the destination. More...
 
int receiveFragmentHeader (detail::RawFragmentHeader &header, size_t receiveTimeout) override
 Receive a Fragment Header from the transport mechanism. More...
 
int receiveFragmentData (RawDataType *destination, size_t wordCount) override
 Receive the body of a Fragment to the given destination pointer. More...
 
- Public Member Functions inherited from artdaq::TransferInterface
 TransferInterface (const fhicl::ParameterSet &ps, Role role)
 TransferInterface Constructor. More...
 
 TransferInterface (const TransferInterface &)=delete
 Copy Constructor is deleted.
 
TransferInterfaceoperator= (const TransferInterface &)=delete
 Copy Assignment operator is deleted. More...
 
virtual ~TransferInterface ()=default
 Default virtual Destructor.
 
virtual int receiveFragment (artdaq::Fragment &fragment, size_t receiveTimeout)
 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...
 
virtual int source_rank () const
 Get the source rank for this TransferInterface instance. More...
 
virtual int destination_rank () const
 Get the destination rank for this TransferInterface instance. More...
 

Additional Inherited Members

- Public Types inherited from artdaq::TransferInterface
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 Public Attributes inherited from artdaq::TransferInterface
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.
 
- Protected Member Functions inherited from artdaq::TransferInterface
Role role () const
 Get the TransferInterface::Role of this TransferInterface. More...
 
- Protected Attributes inherited from artdaq::TransferInterface
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.
 

Detailed Description

MPITransfer is a TransferInterface implementation plugin that transfers data using MPI.

Definition at line 24 of file MPITransfer.hh.

Constructor & Destructor Documentation

artdaq::MPITransfer::MPITransfer ( fhicl::ParameterSet  pset,
TransferInterface::Role  role 
)

MPITransfer Constructor.

Parameters
psetParameterSet used to configure MPITransfer
roleRole of this MPITransfer instance (kSend or kReceive)
* MPITransfer accepts the following Parameters:
* "synchronous_sends" (Default: true): When false, use MPI_ISend, otherwise, use MPI_SSend
* 

MPITransfer also requires all Parameters for configuring a TransferInterface

Definition at line 26 of file MPI_transfer.cc.

Member Function Documentation

artdaq::TransferInterface::CopyStatus artdaq::MPITransfer::copyFragment ( Fragment &  frag,
size_t  timeout_usec = std::numeric_limits<size_t>::max() 
)
override

Copy a Fragment to the destination. Forces asynchronous send.

Parameters
fragFragment to copy
timeout_usecTimeout for send, in microseconds
Returns
CopyStatus detailing result of copy

Definition at line 71 of file MPI_transfer.cc.

artdaq::TransferInterface::CopyStatus artdaq::MPITransfer::moveFragment ( Fragment &&  frag,
size_t  timeout_usec = std::numeric_limits<size_t>::max() 
)
override

Move a Fragment to the destination.

Parameters
fragFragment to move
timeout_usecTimeout for send, in microseconds
Returns
CopyStatus detailing result of copy

Definition at line 78 of file MPI_transfer.cc.

MPITransfer& artdaq::MPITransfer::operator= ( const MPITransfer )
delete

Copy Assignment operator is deleted.

Returns
MPITransfer reference
int artdaq::MPITransfer::receiveFragmentData ( RawDataType *  destination,
size_t  wordCount 
)
overridevirtual

Receive the body of a Fragment to the given destination pointer.

Parameters
destinationPointer to memory region where Fragment data should be stored
wordCountNumber of words of Fragment data to receive
Returns
The rank the Fragment was received from (should be source_rank), or RECV_TIMEOUT

Implements artdaq::TransferInterface.

Definition at line 202 of file MPI_transfer.cc.

int artdaq::MPITransfer::receiveFragmentHeader ( detail::RawFragmentHeader &  header,
size_t  receiveTimeout 
)
overridevirtual

Receive a Fragment Header from the transport mechanism.

Parameters
[out]headerReceived Fragment Header
receiveTimeoutTimeout for receive
Returns
The rank the Fragment was received from (should be source_rank), or RECV_TIMEOUT

Implements artdaq::TransferInterface.

Definition at line 139 of file MPI_transfer.cc.


The documentation for this class was generated from the following files: