Skip to main content

Module window

Module window 

Source
Expand description

One-sided (RMA) communication: Windows of memory that remote ranks can put into, get from, and accumulate into without the target making a matching call. This corresponds to MPI’s one-sided chapter (MPI_Win_*), which released rsmpi does not currently expose.

Each window runs on its own communication context; a lightweight active-message handler on every rank services incoming RMA requests against the local window memory (guarded by a mutex), so operations complete even while the target is busy computing. Operations are synchronous (they wait for the target to acknowledge), which makes Window::fence a simple epoch barrier.

use mpi::traits::*;
use mpi::window::Window;

let universe = mpi::initialize().unwrap();
let world = universe.world();
let mut win = Window::<i32>::allocate(4, &world);
win.fence();
if world.rank() == 0 {
    win.put(1, 0, &[10, 20, 30, 40]); // write into rank 1's window
}
win.fence();

Structs§

Window
A window of memory exposed for one-sided access (MPI_Win).