pack/
pack.rs

1#![deny(warnings)]
2
3use mpi::traits::*;
4
5fn main() {
6    let universe = mpi::initialize().unwrap();
7    let world = universe.world();
8
9    let ints = [3i32, 2, 1];
10    let packed = world.pack(&ints[..]);
11
12    let mut new_ints = [0, 0, 0];
13    unsafe {
14        world.unpack_into(&packed, &mut new_ints[..], 0);
15    }
16
17    assert_eq!([3, 2, 1], new_ints);
18}