10#include <rdma/fabric.h>
34 fiCall(::fi_domain2,
"Failed to open domain",
fabric->raw(),
fabric->info().raw(), &domain, 0,
nullptr);
36 struct MakeSharedEnabler :
public Domain
38 MakeSharedEnabler(::fid_domain* domain, std::shared_ptr<Fabric>
fabric, std::vector<RegisteredRegion>
registerRegions)
43 return std::make_shared<MakeSharedEnabler>(domain, std::move(
fabric), std::vector<RegisteredRegion>{});
48 std::ranges::transform(
69 return (
_fabric->info().raw()->domain_attr->mr_mode & FI_MR_VIRT_ADDR) != 0;
74 return (
_fabric->info().raw()->rx_attr->mode & FI_RX_CQ_DATA) != 0;
93 fiCall(::fi_close,
"Failed to close domain", &
_raw->fid);
100 ,
_fabric(std::move(other._fabric))
103 other._raw =
nullptr;
111 other._raw =
nullptr;
113 _fabric = std::move(other._fabric);
std::shared_ptr< Fabric > _fabric
void registerRegion(Region const ®ion, std::uint64_t access)
Register a single memory region to this domain.
void registerRegions(std::vector< Region > const ®ions, std::uint64_t access)
Register a list of memory regions to this domain.
bool usingVirtualAddresses() const noexcept
When this returns true, a user should use virtual addresses instead of 0 based addresses when referin...
std::vector< LocalRegion > localRegions() const noexcept
Get the local regions associated to the registered regions to this domain.
std::shared_ptr< Fabric > fabric() const noexcept
Accessor for the fabric associated with this domain.
::fid_domain * raw() noexcept
Accessor for the underlying fi_domain instance.
void close()
Close this domain and release all associated resources.
std::vector< RegisteredRegion > _registeredRegions
static std::shared_ptr< Domain > open(std::shared_ptr< Fabric > fabric)
Open a new domain associated with the specified fabric.
void operator=(Domain const &)=delete
Domain(Domain const &)=delete
RegisteredRegion registerRegionImpl(Region const ®ion, std::uint64_t access)
Register a single memory region to this domain.
bool usingRecvBufForCqData() const noexcept
When this returns true, it means the target must post a fi_recv in order to receive immediate data.
std::vector< RemoteRegion > remoteRegions() const noexcept
Get the remote regions associated to the registered regions to this domain.
static MemoryRegion reg(Domain &domain, Region const ®ion, std::uint64_t access)
Register a memory region with a specified domain and access permissions.
Represent a memory region (unregistered).
Represent a registered memory region.
std::vector< LocalRegion > toLocal(std::vector< RegisteredRegion > const &groups) noexcept
std::vector< RemoteRegion > toRemote(std::vector< RegisteredRegion > const &groups, bool useVirtualAddress) noexcept
void catchAndLogFabricError(F &&fun, std::string_view msg)
int fiCall(F &&fun, std::string_view msg, T &&... args)
Call a libfabric function and check its return code.