Create a description from a libfabric fi_info entry. Translates libfabric capabilities (FI_SEND, FI_WRITE, FI_RMA, etc.) into MXL capability flags and extracts NIC, domain, and endpoint attributes. Returns nullopt if the provider is not recognized.
111 {
112 auto caps = std::uint64_t{};
113 auto attr = picojson::object{};
115 if (!provider)
116 {
117 return std::nullopt;
118 }
119
121 auto node = std::string{};
122 auto service = std::string{};
124 {
125 node = getHostname();
126 service = faddr.service().value_or("");
127 }
128 else
129 {
130 node = faddr.node().value_or("");
131 }
132
133 if ((info->caps & (FI_SEND | FI_RECV)) != 0)
134 {
136 }
137 if ((info->caps & (FI_REMOTE_WRITE | FI_WRITE | FI_RMA)) != 0)
138 {
140 }
142 {
144 }
145
146 copyStringProperty(attr,
fiToString(&info->addr_format, FI_TYPE_ADDR_FORMAT),
"ep_addr_format");
147 copyStringProperty(attr,
fiToString(&info->ep_attr->protocol, FI_TYPE_PROTOCOL),
"ep_protocol");
148 copyStringProperty(attr,
fiToString(&info->ep_attr->type, FI_TYPE_EP_TYPE),
"ep_type");
149 copyDomainProperties(attr, info->domain_attr);
150
151 if (info->nic != nullptr)
152 {
153 copyNicProperties(attr, info->nic);
154 }
155
157 {
158
159 copyStringProperty(attr, info->domain_attr->name, "device_name");
160 }
161
163 }
static bool isWaitObjectSupportedForEFA() noexcept
Check if wait any wait object type supported by the EFA provider for this libfabric version.
static FabricAddress fromSource(FabricInfoView info) noexcept
Build a FabricAddress from the source address of info.
FabricInterfaceDescription(Provider, std::string, std::string, std::uint64_t, std::uint64_t, picojson::object)
std::uint64_t caps() const noexcept
Return the raw MXL_FABRICS_IFACE_CAP_* flags for this interface.
@ MXL_FABRICS_IFACE_CAP_SEND_RECEIVE
@ MXL_FABRICS_IFACE_CAP_BLOCKING_OPERATIONS
@ MXL_FABRICS_IFACE_CAP_REMOTE_WRITE
std::string fiToString(void *any, ::fi_type type)
std::optional< Provider > providerFromString(std::string const &s) noexcept
Parse a provider name string, and return the enum value.