lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::Fabrics::Fabric Class Reference

Opens a libfabric fabric and domain for a node and service, and keeps the list of memory regions registered in that domain. More...

#include <Endpoint.hh>

Inherits Pds::Fabrics::ErrorHandler.

Public Member Functions

 Fabric (const char *node, const char *service, uint64_t flags=0, Info *hints=0)
 Resolve node and service with getaddrinfo() and fi_getinfo(), then open the fabric and domain; up() reports success.
 
 ~Fabric ()
 If up(), delete all registered memory regions, close the domain and fabric, and free the fi_info (and the hints if owned).
 
MemoryRegion * register_memory (void *start, size_t len)
 Register len bytes at start for remote read/write, send and receive, then record and return the new MemoryRegion.
 
MemoryRegion * register_memory (LocalAddress *laddr)
 Register the buffer of laddr like register_memory(void*, size_t) and also store the new MemoryRegion in laddr; returns NULL on failure.
 
bool deregister_memory (MemoryRegion *mr)
 Remove mr from the list of registered regions and delete it (which closes it); returns false if mr is not in the list.
 
void list_memory () const
 Print the registered memory regions (pointer, start, length) to stderr.
 
MemoryRegion * lookup_memory (const void *start, size_t len) const
 Return the first registered region that contains [start, start + len), or NULL.
 
MemoryRegion * lookup_memory (LocalAddress *laddr) const
 Return the first registered region that contains the buffer of laddr, or NULL (also when laddr is NULL).
 
bool lookup_memory_iovec (LocalIOVec *iov) const
 For each entry of iov that has no descriptor, set one from a registered region containing it; return iov->check_mr().
 
bool up () const
 Return true if initialization succeeded and shutdown has not run.
 
bool has_rma_event_support () const
 Return true if the selected fi_info has the FI_RMA_EVENT capability.
 
const char * domain_name () const
 Return the domain name from the selected fi_info, or NULL if there is none.
 
const char * fabric_name () const
 Return the fabric name from the selected fi_info, or NULL if there is none.
 
const char * provider () const
 Return the provider name from the selected fi_info, or NULL if there is none.
 
uint32_t version () const
 Return the provider version from the selected fi_info, or 0 if there is none.
 
struct addrinfo * addrInfo () const
 Return the addrinfo list produced by getaddrinfo() during initialization.
 
struct fi_info * info () const
 Return the fi_info selected by fi_getinfo().
 
struct fid_fabric * fabric () const
 Return the opened fid_fabric.
 
struct fid_domain * domain () const
 Return the opened fid_domain.
 
- Public Member Functions inherited from Pds::Fabrics::ErrorHandler
 ErrorHandler ()
 Allocate the message buffer and start with no error (FI_SUCCESS and a message built from the text None).
 
virtual ~ErrorHandler ()
 Free the message buffer.
 
int error_num () const
 Return the last recorded error number (FI_SUCCESS if none).
 
const char * error () const
 Return the last recorded error message.
 
void clear_error ()
 Reset the error number to FI_SUCCESS and the message to the no-error text.
 

Additional Inherited Members

- Protected Member Functions inherited from Pds::Fabrics::ErrorHandler
void set_custom_error (const char *fmt,...)
 
void set_error (const char *error_desc)
 
- Protected Attributes inherited from Pds::Fabrics::ErrorHandler
int _errno
 
char * _error
 

Detailed Description

Opens a libfabric fabric and domain for a node and service, and keeps the list of memory regions registered in that domain.

Constructor & Destructor Documentation

◆ Fabric()

Pds::Fabrics::Fabric::Fabric ( const char *  node,
const char *  service,
uint64_t  flags = 0,
Info *  hints = 0 
)

Resolve node and service with getaddrinfo() and fi_getinfo(), then open the fabric and domain; up() reports success.

If hints is null, a default Info is created and its hints are owned (and later freed) by this object.

◆ ~Fabric()

Pds::Fabrics::Fabric::~Fabric ( )

If up(), delete all registered memory regions, close the domain and fabric, and free the fi_info (and the hints if owned).

Member Function Documentation

◆ addrInfo()

struct addrinfo * Pds::Fabrics::Fabric::addrInfo ( ) const

Return the addrinfo list produced by getaddrinfo() during initialization.

◆ deregister_memory()

bool Pds::Fabrics::Fabric::deregister_memory ( MemoryRegion *  mr)

Remove mr from the list of registered regions and delete it (which closes it); returns false if mr is not in the list.

◆ domain()

struct fid_domain * Pds::Fabrics::Fabric::domain ( ) const

Return the opened fid_domain.

◆ domain_name()

const char * Pds::Fabrics::Fabric::domain_name ( ) const

Return the domain name from the selected fi_info, or NULL if there is none.

◆ fabric()

struct fid_fabric * Pds::Fabrics::Fabric::fabric ( ) const

Return the opened fid_fabric.

◆ fabric_name()

const char * Pds::Fabrics::Fabric::fabric_name ( ) const

Return the fabric name from the selected fi_info, or NULL if there is none.

◆ has_rma_event_support()

bool Pds::Fabrics::Fabric::has_rma_event_support ( ) const

Return true if the selected fi_info has the FI_RMA_EVENT capability.

◆ info()

struct fi_info * Pds::Fabrics::Fabric::info ( ) const

Return the fi_info selected by fi_getinfo().

◆ list_memory()

void Pds::Fabrics::Fabric::list_memory ( ) const

Print the registered memory regions (pointer, start, length) to stderr.

◆ lookup_memory() [1/2]

MemoryRegion * Pds::Fabrics::Fabric::lookup_memory ( const void *  start,
size_t  len 
) const

Return the first registered region that contains [start, start + len), or NULL.

◆ lookup_memory() [2/2]

MemoryRegion * Pds::Fabrics::Fabric::lookup_memory ( LocalAddress *  laddr) const

Return the first registered region that contains the buffer of laddr, or NULL (also when laddr is NULL).

◆ lookup_memory_iovec()

bool Pds::Fabrics::Fabric::lookup_memory_iovec ( LocalIOVec *  iov) const

For each entry of iov that has no descriptor, set one from a registered region containing it; return iov->check_mr().

◆ provider()

const char * Pds::Fabrics::Fabric::provider ( ) const

Return the provider name from the selected fi_info, or NULL if there is none.

◆ register_memory() [1/2]

MemoryRegion * Pds::Fabrics::Fabric::register_memory ( LocalAddress *  laddr)

Register the buffer of laddr like register_memory(void*, size_t) and also store the new MemoryRegion in laddr; returns NULL on failure.

◆ register_memory() [2/2]

MemoryRegion * Pds::Fabrics::Fabric::register_memory ( void *  start,
size_t  len 
)

Register len bytes at start for remote read/write, send and receive, then record and return the new MemoryRegion.

Returns NULL if the fabric is not up or fi_mr_reg() fails (error recorded).

◆ up()

bool Pds::Fabrics::Fabric::up ( ) const

Return true if initialization succeeded and shutdown has not run.

◆ version()

uint32_t Pds::Fabrics::Fabric::version ( ) const

Return the provider version from the selected fi_info, or 0 if there is none.


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