Skip to main content

nexar_rdma/
lib.rs

1//! RDMA and GPUDirect transport extensions for nexar.
2//!
3//! This crate provides InfiniBand/RoCE kernel-bypass transport as an extension
4//! to nexar's QUIC-based communication. It uses the extension slot on
5//! `PeerConnection` to attach RDMA state without requiring any `#[cfg]` flags
6//! in the core nexar crate.
7//!
8//! # Features
9//!
10//! - **default** — RDMA transport via ibverbs (InfiniBand/RoCE)
11//! - **gpudirect** — GPUDirect RDMA: NIC reads/writes GPU memory directly
12//!
13//! # Usage
14//!
15//! ```ignore
16//! use nexar_rdma::ext::PeerConnectionRdmaExt;
17//!
18//! // After bootstrap, each rank calls establish_rdma_mesh:
19//! nexar_rdma::bootstrap::establish_rdma_mesh(&client).await;
20//!
21//! // Send via RDMA with QUIC fallback:
22//! peer.send_raw_rdma(data).await?;
23//! ```
24
25pub mod bootstrap;
26pub mod client_ext;
27#[cfg(feature = "gpudirect")]
28pub mod cuda_adapter;
29pub mod ext;
30#[cfg(feature = "gpudirect")]
31pub mod gpudirect;
32pub mod rdma;
33
34#[cfg(feature = "gpudirect")]
35pub use cuda_adapter::CudaAdapter;
36pub use ext::PeerConnectionRdmaExt;
37pub use rdma::{RdmaConnection, RdmaContext, RdmaEndpoint, RdmaMemoryPool, RdmaMr};
38
39#[cfg(feature = "gpudirect")]
40pub use client_ext::NexarClientRdmaExt;
41#[cfg(feature = "gpudirect")]
42pub use ext::PeerConnectionGpuDirectExt;
43#[cfg(feature = "gpudirect")]
44pub use gpudirect::{GpuDirectContext, GpuDirectPool, GpuDirectQp, GpuMr};