|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Client side of an EbLfLink; writes data into the server's registered memory with RDMA. More...
#include <EbLfLink.hh>
Inherits Pds::Eb::EbLfLink.
Public Member Functions | |
| EbLfCltLink (Fabrics::Endpoint *, const unsigned rxDepth, const unsigned &verbose, volatile uint64_t &pending, volatile uint64_t &posting) | |
| Construct the base EbLfLink with rxDepth receive credits. | |
| int | exchangeId (unsigned id, const char *peer) |
| Synchronize with the server, send id, receive the server's ID (stored as id()), then synchronize again. | |
| int | prepare (void *region, size_t lclSize, size_t rmtSize, const char *peer) |
| Synchronize with the server. | |
| int | prepare (void *region, size_t size, const char *peer) |
| Call prepare(region, size, size, peer). | |
| int | setupMr (void *region, size_t size) |
| Register (or reuse) a local memory region for size bytes at region with Pds::Eb::setupMr(); returns -1 if there is no endpoint. | |
| int | post (const void *buf, size_t len, size_t offset, uint64_t immData, void *ctx=nullptr) |
| RDMA-write len bytes from buf to the server's region at offset, with immediate data immData (Endpoint::writedata()), retrying -FI_EAGAIN for up to 300 s. | |
Public Member Functions inherited from Pds::Eb::EbLfLink | |
| EbLfLink (Fabrics::Endpoint *, const unsigned depth, const unsigned &verbose, volatile uint64_t &pending, volatile uint64_t &posting) | |
| Wrap the endpoint with depth receive credits, zero the shared pending and posting words and post depth zero-length receives. | |
| ~EbLfLink () | |
| Zero the pending and posting words and print a message if fewer than depth credits are posted. | |
| int | recvU32 (uint32_t *u32, const char *peer, const char *name) |
| Wait up to 7 s for one immediate data value and store its low 32 bits in u32. | |
| int | sendU32 (uint32_t u32, const char *peer, const char *name) |
| Send u32 as immediate data with post(); returns 0, or the error after printing a message. | |
| int | sendMr (Fabrics::MemoryRegion *, const char *peer) |
| Send a RemoteAddress built from the memory region (start address, length, key) to the peer as a series of 32-bit immediate data values; returns 0 or a negative error. | |
| int | recvMr (Fabrics::RemoteAddress &, const char *peer) |
| Receive a RemoteAddress into ra as a series of 32-bit immediate data values (as sent by sendMr()), waiting up to 7 s for each; returns 0 or the poll() error. | |
| void * | lclAdx (size_t offset) const |
| Return the local address that is offset bytes from the start of the local memory region. | |
| size_t | lclOfs (const void *buffer) const |
| Return the byte offset of buffer from the start of the local memory region. | |
| uintptr_t | rmtAdx (size_t offset) const |
| Return the remote address that is offset bytes from the start of the remote region. | |
| size_t | rmtOfs (uintptr_t buffer) const |
| Return the byte offset of the remote address buffer from the start of the remote region. | |
| Fabrics::Endpoint * | endpoint () const |
| Return the libfabric endpoint. | |
| unsigned | id () const |
| Return the peer ID received in exchangeId(); (unsigned)-1 before that. | |
| const uint64_t & | tmoCnt () const |
| Return the number of timeouts counted by post() and poll(). | |
| int | post (const void *buf, size_t len, uint64_t immData) |
| Send len bytes from buf with immediate data immData using Endpoint::injectdata(), retrying -FI_EAGAIN for up to 300 s. | |
| int | post (uint64_t immData) |
| Send only the immediate data immData; same as post(nullptr, 0, immData). | |
| int | poll (uint64_t *data) |
| Check the receive completion queue once without waiting and re-post the consumed receive. | |
| int | poll (uint64_t *data, int msTmo) |
| Like poll(uint64_t*), but waits up to msTmo milliseconds for a completion. | |
| ssize_t | postCompRecv (const unsigned count) |
| Consume count receive credits, then re-post zero-length receives until depth credits are posted again (on -FI_EAGAIN, retry up to 100000 times with 10 us sleeps). | |
Additional Inherited Members | |
Public Attributes inherited from Pds::Eb::EbLfLink | |
| const unsigned | _depth |
| Number of receive buffers (credits) to keep posted. | |
| unsigned | _credits |
| Number of receive buffers currently posted. | |
Protected Types inherited from Pds::Eb::EbLfLink | |
| enum | { _BegSync = 0x11111111 , _EndSync = 0x22222222 , _SvrSync = 0x33333333 , _CltSync = 0x44444444 } |
Protected Attributes inherited from Pds::Eb::EbLfLink | |
| unsigned | _id |
| Fabrics::Endpoint * | _ep |
| Fabrics::MemoryRegion * | _mr |
| Fabrics::RemoteAddress | _ra |
| const unsigned & | _verbose |
| uint64_t | _timedOut |
| volatile uint64_t & | _pending |
| volatile uint64_t & | _posting |
| Pds::Eb::EbLfCltLink::EbLfCltLink | ( | Fabrics::Endpoint * | , |
| const unsigned | rxDepth, | ||
| const unsigned & | verbose, | ||
| volatile uint64_t & | pending, | ||
| volatile uint64_t & | posting | ||
| ) |
Construct the base EbLfLink with rxDepth receive credits.
| int Pds::Eb::EbLfCltLink::exchangeId | ( | unsigned | id, |
| const char * | peer | ||
| ) |
Synchronize with the server, send id, receive the server's ID (stored as id()), then synchronize again.
Returns 0 or the first error.
| int Pds::Eb::EbLfCltLink::post | ( | const void * | buf, |
| size_t | len, | ||
| size_t | offset, | ||
| uint64_t | immData, | ||
| void * | ctx = nullptr |
||
| ) |
RDMA-write len bytes from buf to the server's region at offset, with immediate data immData (Endpoint::writedata()), retrying -FI_EAGAIN for up to 300 s.
This peer's bit is set in the posting word while sending. Returns 0 or the last error.
| int Pds::Eb::EbLfCltLink::prepare | ( | void * | region, |
| size_t | lclSize, | ||
| size_t | rmtSize, | ||
| const char * | peer | ||
| ) |
Synchronize with the server.
If region is non-null, send rmtSize, register (or reuse) a local memory region of lclSize bytes at region and receive the server's region description. Then synchronize again. Returns 0 or the first error.
| int Pds::Eb::EbLfCltLink::prepare | ( | void * | region, |
| size_t | size, | ||
| const char * | peer | ||
| ) |
Call prepare(region, size, size, peer).
| int Pds::Eb::EbLfCltLink::setupMr | ( | void * | region, |
| size_t | size | ||
| ) |
Register (or reuse) a local memory region for size bytes at region with Pds::Eb::setupMr(); returns -1 if there is no endpoint.