Crate ferrompi

Crate ferrompi 

Source
Expand description

§ferrompi

Thin MPI 4.x bindings for the powers-rs SDDP implementation.

This crate provides access to MPI functionality through a C wrapper layer, enabling use of MPI 4.0+ features like persistent collectives that are not available in the rsmpi crate.

§Quick Start

use ferrompi::{Mpi, ReduceOp};

fn main() -> Result<(), ferrompi::Error> {
    // Initialize MPI
    let mpi = Mpi::init()?;
    let world = mpi.world();

    let rank = world.rank();
    let size = world.size();

    println!("Hello from rank {} of {}", rank, size);

    // Synchronize
    world.barrier()?;

    // All-reduce example
    let my_value = rank as f64;
    let sum = world.allreduce_scalar(my_value, ReduceOp::Sum)?;
    println!("Rank {}: sum of all ranks = {}", rank, sum);

    Ok(())
    // MPI finalized on drop
}

§Features

  • Basic collectives: barrier, broadcast, reduce, allreduce, gather, scatter
  • Nonblocking collectives: ibcast, iallreduce with request handles
  • Persistent collectives (MPI 4.0+): bcast_init, allreduce_init, etc.
  • Large count support (MPI 4.0+): automatic use of _c variants for large arrays

Structs§

Communicator
An MPI communicator.
Mpi
MPI environment handle.
PersistentRequest
A persistent MPI request handle.
Request
A handle to a nonblocking MPI operation.

Enums§

Error
Error types for MPI operations
ReduceOp
Reduction operations
ThreadLevel
MPI thread support levels

Type Aliases§

Result
Result type for MPI operations