Class ConnectionlessEndpointManager

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< ConnectionlessEndpointManager >

Class Documentation

class ConnectionlessEndpointManager : public std::enable_shared_from_this<ConnectionlessEndpointManager>

The libfabric backend for netio3.

The libfabric backend allows sending data using the libfabric library. It allows using high-performance RDMA operations. The config object passed into the constructor is used to set the mode (TCP or RDMA, RDMA is strongly recommended, for TCP use BackendTcp).

Public Functions

ConnectionlessEndpointManager(NetworkConfig config, const EndPointAddress &address, BaseEventLoop *evloop, std::uint64_t flags)

Constructs a ConnectionlessEndpointManager object with the specified network configuration and event loop.

This constructor is called on the first request to open a connection and initializes the fabric. The provided endpoint is either a local one (with flags = FI_SOURCE) or a remote one.

Note

Do not call directly, use create() instead.

Parameters:
  • config – The network configuration

  • address – The address of an endpoint

  • flags – The flags to use for initialization (nothing or FI_SOURCE)

  • evloop – The event loop to use for network operations

void open_send_endpoint(const EndPointAddress &address, const ConnectionParameters &connection_params)

Checks and initializes the endpoint for the specified address and connection parameters.

This function registers the endpoint in the address vector and allocates resources depending on the requested capabilities.

Throws:
  • InvalidEndpointAddress – if the endpoint address is invalid

  • FailedOpenActiveEndpoint – if the active endpoint could not be opened

Parameters:
  • address – The address of the endpoint to open

  • connection_params – The connection parameters for the endpoint

void open_receive_endpoint(const EndPointAddress &address, const ConnectionParameters &connection_params)

Opens a receive endpoint for the specified address.

Parameters:
  • address – The address of the endpoint to open

  • connection_params – The connection parameters for the endpoint

void close_send_endpoint(const EndPointAddress &address)

Closes the endpoint for the specified address.

Removes the entry from the address vector and closes the endpoint.

void close_receive_endpoint(const EndPointAddress &address)

Closes the receive endpoint for the specified address.

Parameters:

address – The address of the endpoint to close

std::size_t get_num_available_buffers(const EndPointAddress &address)

Retrieves the number of available buffers for the specified endpoint address.

Returns the number of availble buffers for buffered sending and the number of available header slots for zero-copy sending. Returns the mininum number of available buffers since the last call to this function.

Throws:

UnknownActiveEndpoint – if the active endpoint does not exist or has no send capabilities

Parameters:

address – The address of the endpoint to retrieve the buffer count for

Returns:

The number of available buffers

inline auto apply_to_send_endpoint_buffered(const EndPointAddress &address, const std::invocable<SendEndpointBuffered&, fi_addr_t> auto &func) -> decltype(func(std::declval<SendEndpointBuffered&>(), std::declval<fi_addr_t>()))

Call a function on the SendEndpointBuffered object associated with the specified address.

If the backend is configured to be thread safe the function is called in a thread safe context.

Throws:

UnknownActiveEndpoint – if the endpoint does not exist or has no buffered send capabilities

Parameters:
  • address – Address of the desired endpoint

  • func – Function to apply

Returns:

The return value of the function

inline auto apply_to_send_endpoint_zero_copy(const EndPointAddress &address, const std::invocable<SendEndpointZeroCopy&, fi_addr_t> auto &func) -> decltype(func(std::declval<SendEndpointZeroCopy&>(), std::declval<fi_addr_t>()))

Call a function on the SendEndpointZeroCopy object associated with the specified address.

If the backend is configured to be thread safe the function is called in a thread safe context.

Throws:

UnknownActiveEndpoint – if the endpoint does not exist or has no zero-copy send capabilities

Parameters:
  • address – Address of the desired send endpoint

  • func – Function to apply

Returns:

The return value of the function

Public Static Functions

static std::shared_ptr<ConnectionlessEndpointManager> create(const NetworkConfig &config, EndPointAddress address, BaseEventLoop *evloop, std::uint64_t flags)

Creates a ConnectionlessEndpointManager object.

Constructs and initializes a ConnectionlessEndpointManager object.

Parameters:
  • config – The network configuration

  • address – The address of the endpoint

  • flags – The flags to use for initialization (nothing or FI_SOURCE)

  • evloop – The event loop to use for network operations

Returns:

A shared pointer to the ConnectionlessEndpointManager object