MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
mxl::lib::fabrics::ofi::RemoteRegion Struct Reference

Represent a remote memory region used for data transfer. More...

#include <RemoteRegion.hpp>

Public Member Functions

bool operator== (RemoteRegion const &other) const noexcept
RemoteRegion sub (std::uint64_t offset, std::size_t length) const
 Create a sub-region of this RemoteRegion.
::fi_rma_iov toRmaIov () const noexcept
 Convert this RemoteRegion to a struct fi_rma_iov used by libfabric RMA transfer functions.

Public Attributes

std::uint64_t addr
std::size_t len
std::uint64_t rkey

Detailed Description

Represent a remote memory region used for data transfer.

This can be constructed from a RegisteredRegion.

Definition at line 20 of file RemoteRegion.hpp.

Member Function Documentation

◆ operator==()

bool mxl::lib::fabrics::ofi::RemoteRegion::operator== ( RemoteRegion const & other) const
noexcept

Definition at line 32 of file RemoteRegion.cpp.

33 {
34 return addr == other.addr && len == other.len && rkey == other.rkey;
35 }

◆ sub()

RemoteRegion mxl::lib::fabrics::ofi::RemoteRegion::sub ( std::uint64_t offset,
std::size_t length ) const
nodiscard

Create a sub-region of this RemoteRegion.

Parameters
offsetThe offset within this region where the sub-region starts.
lengthThe length of the sub-region.
Returns
A new RemoteRegion representing the specified sub-region.

Definition at line 13 of file RemoteRegion.cpp.

14 {
15 if (offset + length > len)
16 {
17 throw Exception::invalidArgument("Invalid offset and length for remote region");
18 }
19
20 return RemoteRegion{
21 .addr = addr + offset,
22 .len = length,
23 .rkey = rkey,
24 };
25 }
static Exception invalidArgument(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INVALID_ARG exception.
Definition Exception.hpp:43

◆ toRmaIov()

fi_rma_iov mxl::lib::fabrics::ofi::RemoteRegion::toRmaIov ( ) const
nodiscardnoexcept

Convert this RemoteRegion to a struct fi_rma_iov used by libfabric RMA transfer functions.

Definition at line 27 of file RemoteRegion.cpp.

28 {
29 return ::fi_rma_iov{.addr = addr, .len = len, .key = rkey};
30 }

Member Data Documentation

◆ addr

std::uint64_t mxl::lib::fabrics::ofi::RemoteRegion::addr

Definition at line 40 of file RemoteRegion.hpp.

◆ len

std::size_t mxl::lib::fabrics::ofi::RemoteRegion::len

Definition at line 41 of file RemoteRegion.hpp.

◆ rkey

std::uint64_t mxl::lib::fabrics::ofi::RemoteRegion::rkey

Definition at line 42 of file RemoteRegion.hpp.


The documentation for this struct was generated from the following files: