Class SendEndpointBuffered

Class Documentation

class SendEndpointBuffered

Represents an endpoint with buffered send capabilities.

This class provides functionality for sending data over the network using a set of buffers. The number of size and buffers are configured through the connection parameters. Buffers can be requested using the get_buffer function and sent using the send_buffer function.

The key that is returned to the user on the on_send_complete callback corresponds to the ID of the buffer.

Buffers are either allocated for the endpoint or shared buffers from the domain manager are used.

Public Functions

SendEndpointBuffered(ActiveEndpoint &endpoint, const ConnectionParametersSendBuffered &connection_params, std::optional<SendBufferManager> &shared_buffer_manager, DomainManager &domain_manager)

Constructs a SendEndpointBuffered object.

The constructor takes a reference to an ActiveEndpoint object and allocates and registers the send buffers as memory regions.

Throws:
  • FailedOpenActiveEndpoint – in case of a libfabric error

  • std::logic_error – if no buffers are provided

Parameters:
  • endpoint – The active endpoint object handling the connection

  • connection_params – The connection parameters used to configure the buffers

  • shared_buffer_manager – An optional shared buffer manager to use for shared buffers

  • domain_manager – The domain manager

inline auto operator<=>(const SendEndpointBuffered &other) const
inline const ActiveEndpoint &get_active_endpoint() const

Get the active endpoint object.

Returns:

A const reference for const objects, non const for non const objects

inline ActiveEndpoint &get_active_endpoint()
inline NetworkBuffer *get_buffer()

Retrieves a network buffer.

If no buffers are available, returns nullptr.

@important Check that returned buffer is not null.

Throws:

NoBuffersAllocated – if no buffers were allocated

Returns:

A pointer to the network buffer (or null of none available)

inline NetioStatus send_buffer(Buffer *buffer, std::size_t size, fi_addr_t addr = 0) const

Sends the provided buffer

Buffer needs to be a registered memory region that was obtained from get_buffer. The return value indicates whether the send operation was successful. The maximum of concurrent send operations is defined by the number of allocated buffers.

Parameters:
  • buffer – The buffer to send

  • size – The size of the buffer

  • addr – The address of the remote peer (for connectionless endpoints)

Returns:

The status of the send operation

inline std::uint64_t release_buffer(std::uint64_t bufnum)

Marks the buffer with the specified buffer number as available for reuse.

Parameters:

bufnum – The buffer number to release

Returns:

The key (is equal to buffer number for buffered sending)

std::size_t get_num_available_buffers()

Retrieves the number of available buffers.

Returns the mininum number of available buffers since the last call to this function.

Returns:

The number of available buffers

inline std::vector<std::uint64_t> get_pending_sends() const

Returns an empty vector (only needed for zero-copy sending)

Returns:

Empty vector