Skip to main content

laminar_core/numa/
mod.rs

1//! # NUMA Topology Detection
2//!
3//! Detects system NUMA topology for thread-per-core architecture.
4//! On multi-socket systems, memory access latency varies by 2-3x depending on
5//! whether memory is local or remote to the CPU.
6//!
7//! ## Components
8//!
9//! - [`NumaTopology`] - Detects system NUMA topology
10//!
11//! ## Platform Support
12//!
13//! | Platform | Support |
14//! |----------|---------|
15//! | Linux | Full NUMA support |
16//! | macOS | Degraded (single node) |
17//! | Windows | Degraded (single node) |
18
19mod error;
20mod topology;
21
22pub use error::NumaError;
23pub use topology::NumaTopology;
24
25/// Result type for NUMA operations.
26pub type Result<T> = std::result::Result<T, NumaError>;
27
28#[cfg(test)]
29mod tests {
30    use super::*;
31
32    #[test]
33    fn test_topology_detection() {
34        let topo = NumaTopology::detect();
35        assert!(topo.num_nodes() >= 1);
36        assert!(!topo.cpus_for_node(0).is_empty());
37    }
38}