MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
AddressVector.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project.
2
//
3
// SPDX-License-Identifier: Apache-2.0
4
5
#pragma once
6
7
#include <memory>
8
#include <rdma/fabric.h>
9
#include <rdma/fi_domain.h>
10
#include "
Address.hpp
"
11
#include "
Domain.hpp
"
12
13
namespace
mxl::lib::fabrics::ofi
14
{
15
18
class
AddressVector
19
{
20
public
:
23
struct
Attributes
24
{
25
public
:
28
static
Attributes
defaults
()
noexcept
;
29
32
[[nodiscard]]
33
::fi_av_attr
toRaw
()
const
noexcept
;
34
35
public
:
38
std::size_t
count
;
39
45
std::size_t
epPerNode
;
46
};
47
50
static
std::shared_ptr<AddressVector>
open
(std::shared_ptr<Domain> domain,
Attributes
attr =
Attributes::defaults
());
51
52
~AddressVector
();
53
54
// Copy constructor is deleted
55
AddressVector
(
AddressVector
const
&) =
delete
;
56
void
operator=
(
AddressVector
const
&) =
delete
;
57
58
// Implements proper move semantics. An AddressVector in a moved-from state can no longer be used.
59
AddressVector
(
AddressVector
&&) noexcept;
60
// Move-assigning an AddressVector to another, releases all resources from the moved-into AddressVector.
61
AddressVector
& operator=(
AddressVector
&&);
62
66
::fi_addr_t
insert
(
RawFabricAddress
const& addr);
67
70
void
remove
(::fi_addr_t addr) noexcept;
71
74
[[nodiscard]]
75
std::
string
addrToString
(
RawFabricAddress
const& addr) const;
76
79
::fid_av*
raw
() noexcept;
80
83
[[nodiscard]]
84
::fid_av const*
raw
() const noexcept;
85
86
private:
87
AddressVector
(fid_av*
raw
, std::shared_ptr<
Domain
> domain);
88
91
void
close
();
92
93
private:
94
fid_av*
_raw
;
95
std::shared_ptr<
Domain
>
_domain
;
96
};
97
}
Address.hpp
Domain.hpp
mxl::lib::fabrics::ofi::AddressVector::insert
::fi_addr_t insert(RawFabricAddress const &addr)
Insert an address into the address vector. User of this API are responsible for keeping track of inse...
Definition
AddressVector.cpp:54
mxl::lib::fabrics::ofi::AddressVector::AddressVector
AddressVector(AddressVector const &)=delete
mxl::lib::fabrics::ofi::AddressVector::open
static std::shared_ptr< AddressVector > open(std::shared_ptr< Domain > domain, Attributes attr=Attributes::defaults())
Create an AddressVector.
Definition
AddressVector.cpp:35
mxl::lib::fabrics::ofi::AddressVector::_domain
std::shared_ptr< Domain > _domain
Definition
AddressVector.hpp:95
mxl::lib::fabrics::ofi::AddressVector::remove
void remove(::fi_addr_t addr) noexcept
Remove an address of the address vector.
Definition
AddressVector.cpp:67
mxl::lib::fabrics::ofi::AddressVector::~AddressVector
~AddressVector()
Definition
AddressVector.cpp:94
mxl::lib::fabrics::ofi::AddressVector::addrToString
std::string addrToString(RawFabricAddress const &addr) const
Convert a libfabric endpoint address into a human-readable string.
Definition
AddressVector.cpp:72
mxl::lib::fabrics::ofi::AddressVector::close
void close()
Close the address vector and release all resources. Called from the destructor and the move assignmen...
Definition
AddressVector.cpp:117
mxl::lib::fabrics::ofi::AddressVector::raw
::fid_av * raw() noexcept
Mutable accessor of the underlying fi_av instance.
Definition
AddressVector.cpp:128
mxl::lib::fabrics::ofi::AddressVector::_raw
fid_av * _raw
Definition
AddressVector.hpp:94
mxl::lib::fabrics::ofi::AddressVector::operator=
void operator=(AddressVector const &)=delete
mxl::lib::fabrics::ofi::Domain
RAII Wrapper around a libfabric domain (fi_domain).
Definition
Domain.hpp:24
mxl::lib::fabrics::ofi::RawFabricAddress
Wrapper around a libfabric endpoint address.
Definition
Address.hpp:20
mxl::lib::fabrics::ofi
Definition
fabrics.cpp:33
mxl::lib::fabrics::ofi::AddressVector::Attributes
Configuration attributes of the AddressVector.
Definition
AddressVector.hpp:24
mxl::lib::fabrics::ofi::AddressVector::Attributes::epPerNode
std::size_t epPerNode
Definition
AddressVector.hpp:45
mxl::lib::fabrics::ofi::AddressVector::Attributes::toRaw
::fi_av_attr toRaw() const noexcept
Convert to libfabric fi_av_attr object.
Definition
AddressVector.cpp:23
mxl::lib::fabrics::ofi::AddressVector::Attributes::count
std::size_t count
Definition
AddressVector.hpp:38
mxl::lib::fabrics::ofi::AddressVector::Attributes::defaults
static Attributes defaults() noexcept
Get default attributes.
Definition
AddressVector.cpp:18
lib
fabrics
ofi
src
internal
AddressVector.hpp
Generated by
1.15.0