bempp_octree::parsort

Function parsort

Source
pub fn parsort<C: CommunicatorCollectives, R: Rng + ?Sized>(
    arr: &[MortonKey],
    comm: &C,
    rng: &mut R,
) -> Vec<MortonKey>
Expand description

Parallel sort

Examples found in repository?
examples/parsort.rs (line 18)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pub fn main() {
    let universe = mpi::initialize().unwrap();
    let world = universe.world();
    let n_per_rank = 1000;

    let mut rng = rand::rngs::StdRng::seed_from_u64(0);

    let keys = generate_random_keys(n_per_rank, &mut rng);

    let arr = parsort(&keys, &world, &mut rng);

    assert!(is_sorted_array(&arr, &world));

    if world.rank() == 0 {
        println!("Array is sorted.");
    }
}