fi_direct(7)

πŸ’… fi_direct(7) β€” Direct fabric provider access ✨

okay so bestie, welcome to the Libfabric Programmer’s Manual page for fi_direct, Libfabric v2.5.1 era. this one is niche but kinda iconic: it’s the β€œskip the framework, go straight to the provider” mode. πŸ¦‹

🌸 NAME 🌸

fi_direct β€” direct fabric provider access. no cap, that’s the whole vibe. πŸ’…

✨ SYNOPSIS ✨

you drop this into your build like a little spell:

-DFABRIC_DIRECT

#define FABRIC_DIRECT

Fabric direct provides a mechanism for applications to compile against a specific fabric provider without going through the libfabric framework or function vector tables. it’s giving extreme optimization via function inlining, but the tradeoff is real: you’re now on the hook for supporting multiple providers or different versions of the same provider. 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so fabric direct is intended only for applications that require the absolute minimum software latency, and are willing to re-compile for specific fabric hardware. like, if you want every last nanosecond? this is your girl. if you need portability? maybe not. πŸ™ˆ

Providers that support fabric direct implement their own versions of the static inline calls that are defined in the libfabric header files, define selected enum values, and provide defines for compile-time optimizations. applications can then code against the standard libfabric calls, but link directly against the provider calls by defining FABRIC_DIRECT as part of their build. slay. ✨

In general, the use of fabric direct does not require application source code changes, and, instead, is limited to the build process. so it’s a build-time vibe, not a source-code rewrite situation. 🫢

Providers supporting fabric direct must install direct versions of all libfabric header files. for convenience, the libfabric sources contain sample header files that may be modified by a provider. the direct header file names have fi_direct as their prefix: fi_direct.h, fi_direct_endpoint.h, etc. keep those names exact, bestie. πŸ’–

Direct providers are prohibited from overriding or modifying existing data structures. like, prohibited prohibited. However, provider specific extensions are still available. 😌

In addition to provider direct function calls to provider code, a fabric direct provider may define zero or more of the following capability definitions. applications can check for these capabilities in order to optimize code paths at compile time, versus relying on run-time checks. iykyk. πŸ”₯

πŸ’… CAPABILITY DEFINITIONS πŸ’…

In order that application code may be optimized during compile time, direct providers must provide definitions for various capabilities and modes, if those capabilities are supported. The following #define values may be used by an application to test for provider support of supported features. yes, it’s compile-time vibe checking. ⭐

  • FI_DIRECT_CONTEXT β€” The provider sets FI_CONTEXT or FI_CONTEXT2 for fi_info:mode. See fi_getinfo for additional details. When FI_DIRECT_CONTEXT is defined, applications should use struct fi_context in their definitions, even if FI_CONTEXT2 is set. πŸ’…
  • FI_DIRECT_LOCAL_MR β€” The provider sets FI_LOCAL_MR for fi_info:mode. See fi_getinfo for additional details. πŸŽ€

πŸŽ€ SEE ALSO πŸŽ€

go read these next, bestie: fi_getinfo(3), fi_endpoint(3), fi_domain(3). πŸ¦‹

πŸ‘‘ AUTHORS πŸ‘‘

OpenFabrics. πŸ’œ

okay bye bestie β€” that’s the whole page, straight from the Libfabric Programmer’s Manual for Libfabric v2.5.1, dated 2024-12-10. now go inline something iconic. 🌈✨

πŸ“¦ where this page comes from