mpi 0.1.8

Message Passing Interface bindings for Rust
docs.rs failed to build mpi-0.1.8
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: mpi-0.7.0

MPI bindings for Rust

Travis build status Documentation: hosted License: MIT crate on crates.io

The Message Passing Interface (MPI) is a specification for a message-passing style concurrency library. Implementations of MPI are often used to structure parallel computation on High Performance Computing systems. The MPI specification describes bindings for the C programming language (and through it C++) as well as for the Fortran programming language. This library tries to bridge the gap into a more rustic world.

Requirements

An implementation of the C language interface of MPI-3.0. These bindings are currently tested with:

To generate FFI definitions rsmpi uses rust-bindgen which needs libclang. See the bindgen project page for troubleshooting.

Building

cargo build

Usage

Add the mpi crate as a dependency in your Cargo.toml:

[dependencies]
mpi = "0.1.8"

Then use it in your program like this:

extern crate mpi;

use mpi::traits::*;

fn main() {
    let universe = mpi::initialize().unwrap();
    let world = universe.world();
    let size = world.size();
    let rank = world.rank();

    if size != 2 {
        panic!("Size of MPI_COMM_WORLD must be 2, but is {}!", size);
     }

    match rank {
        0 => {
            let msg = vec![4.0f64, 8.0, 15.0];
            world.process_at_rank(rank + 1).send(&msg[..]);
        }
        1 => {
            let (msg, status) = world.receive_vec::<f64>();
            println!("Process {} got message {:?}.\nStatus is: {:?}", rank, msg, status);
        }
        _ => unreachable!()
    }
}

Features

The bindings follow the MPI 3.1 specification.

Currently supported:

  • Groups, Contexts, Communicators: Only rudimentary features are supported so far.
  • Point to point communication: Most of the blocking, standard mode functions are supported. Blocking communication in buffered, synchronous and ready mode are not yet supported.
  • Collective communication: Blocking barrier, broadcast and gather operations.
  • Datatypes: Bridging between Rust types and MPI basic types as well as custom MPI datatypes which can act as views into buffers.

Not supported (yet):

  • Process management
  • One-sided communication (RMA)
  • MPI parallel I/O
  • A million small things

Documentation

cargo doc

Or see the hosted documentation.

Examples

See files in examples/.

License

The MIT license, see the file LICENSE.