Skip to main content

Crate oxifft_adapter_mpi

Crate oxifft_adapter_mpi 

Source
Expand description

§OxiFFT MPI Adapter

oxifft-adapter-mpi is a Pure-Rust-v2 §5 quarantine crate. It isolates the C MPI FFI (the mpi → mpi-sys / libffi-sys / clang-sys dependency chain) out of the core oxifft facade so that oxifft’s --all-features dependency closure stays 100% Pure Rust. All distributed-FFT functionality that needs to link against a system MPI library lives here instead of in oxifft.

This crate provides distributed FFT computation using MPI, similar to FFTW-MPI. It enables computing large-scale FFTs across multiple processes.

§Features

  • 2D, 3D, and N-D distributed FFTs
  • Slab decomposition (row-major distribution)
  • Pencil decomposition (2D process grid) for 3D transforms
  • Efficient all-to-all transpose operations
  • Compatible with FFTW-MPI data layouts

§Example

ⓘ
use oxifft_adapter_mpi::{MpiPool, MpiPlan2D, MpiFlags};
use mpi::topology::Communicator;

// Initialize MPI
let universe = mpi::initialize().unwrap();
let world = universe.world();

// Create MPI pool
let pool = MpiPool::new(world.duplicate());

// Get local allocation size
let (local_n0, local_0_start, alloc_local) = local_size_2d(n0, n1, &pool);

// Create plan
let plan = MpiPlan2D::new(n0, n1, Direction::Forward, MpiFlags::default(), &pool)?;

// Execute
let mut data = vec![Complex::zero(); alloc_local];
plan.execute_inplace(&mut data);

Structs§

LocalPartition
Describes the local partition of data owned by a process.
MpiFlags
MPI-specific planning flags.
MpiPlan2D
2D distributed FFT plan.
MpiPlan3D
3D distributed FFT plan.
MpiPlanND
N-dimensional distributed FFT plan.
MpiPool
MPI process pool for distributed FFT computation.
MpiRealPlan2D
2D distributed real FFT plan (slab decomposition over the first dimension).
MpiRealPlan3D
3D distributed real FFT plan (slab decomposition over the first dimension).
PencilGrid
2D process grid configuration for pencil decomposition.
PencilPlan3D
3D distributed FFT plan using pencil decomposition.

Enums§

Distribution
How data is distributed across processes.
MpiError
Error type for MPI FFT operations.

Traits§

MpiFloat
Trait for float types that can be used with MPI.

Functions§

distributed_transpose
Perform a distributed transpose of a 2D array.
distributed_transpose_batched
Perform a batched distributed transpose of a 3D array in a single collective.
distributed_transpose_inplace
Perform in-place distributed transpose.
local_size_2d
Calculate local size for a 2D distributed FFT.
local_size_2d_r2c
Calculate local buffer sizes for a 2D distributed real FFT (r2c / c2r).
local_size_2d_transposed
Get local partition info for both normal and transposed layouts.
local_size_3d
Calculate local size for a 3D distributed FFT.
local_size_3d_r2c
Calculate local buffer sizes for a 3D distributed real FFT (r2c / c2r).
local_size_nd
Calculate local size for an N-D distributed FFT.