Crates.io | mpi-fork-fnsp |
lib.rs | mpi-fork-fnsp |
version | 0.6.0 |
source | src |
created_at | 2022-03-24 10:20:45.425723 |
updated_at | 2022-03-24 10:20:45.425723 |
description | Message Passing Interface bindings for Rust (FORK) |
homepage | https://github.com/preiter93/rsmpi-fork-fnsp |
repository | https://github.com/preiter93/rsmpi-fork-fnsp |
max_upload_size | |
id | 555690 |
size | 342,461 |
Message Passing Interface bindings for Rust
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.
This crate is forked from RSMPI.
Add the mpi
crate as a dependency in your Cargo.toml
:
[dependencies]
mpi = { path = "mpi-fork-fnsp", version = "0.6" }
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.any_process().receive_vec::<f64>();
println!("Process {} got message {:?}.\nStatus is: {:?}", rank, msg, status);
}
_ => unreachable!()
}
}
The bindings follow the MPI 3.1 specification.
Currently supported:
Not supported (yet):
The sub-modules contain a more detailed description of which features are and are not supported.
While every publicly defined item in this crate should have some documentation attached to it, most of the descriptions are quite terse for now and to the uninitiated will only make sense in combination with the MPI specification.
License: MIT/Apache-2.0