Class ZeroCopyBufferManager
Defined in File ZeroCopyBufferManager.hpp
Class Documentation
-
class ZeroCopyBufferManager
Manages MR and header buffers for zero-copy sending.
The ZeroCopyBufferManager class is responsible for managing a set of buffers that can be used for zero-copy sending. It registers the provided memory region and allocates and registers header buffer as memory regions.
Public Functions
-
ZeroCopyBufferManager(ConnectionParametersSendZeroCopy connection_params, DomainManager &domain_manager)
Constructs a ZeroCopyBufferManager object.
- Parameters:
connection_params – The connection parameters used to configure the buffers
domain_manager – The domain manager to use for buffer registration
-
ZeroCopyBufferManager(const ZeroCopyBufferManager&) = delete
-
ZeroCopyBufferManager(ZeroCopyBufferManager&&) = delete
-
ZeroCopyBufferManager &operator=(const ZeroCopyBufferManager&) = delete
-
ZeroCopyBufferManager &operator=(ZeroCopyBufferManager&&) = delete
-
~ZeroCopyBufferManager()
Destroys the ZeroCopyBufferManager object.
Unregister the buffers.
-
inline fid_mr *get_mr() const
Retrieves the memory region for the data buffer.
- Returns:
The memory region for the data buffer
-
inline fid_mr *get_header_mr() const
Retrieves the memory region for the header buffer.
- Returns:
The memory region for the header buffer
-
HeaderBuffer::HeaderWrapper get_header(const std::span<const std::uint8_t> header_data, const std::uint64_t key)
Fills and retrieves a header buffer.
- Throws:
NoBuffersAllocated – if no buffers were allocated
- Returns:
A header buffer
-
std::uint64_t return_header(std::uint64_t bufnum)
Returns a header buffer to the pool.
- Parameters:
bufnum – The buffer number to release
- Returns:
The key
-
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
-
std::vector<std::uint64_t> get_pending_sends()
Retrieves the keys of pending send operations.
To be called when the connection is closed to notify that these sends will not complete
- Returns:
The keys of pending send operations
-
ZeroCopyBufferManager(ConnectionParametersSendZeroCopy connection_params, DomainManager &domain_manager)