1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Typed, safe MPI one-sided communication (RMA) for Rust, on top of
//! [rsmpi](https://docs.rs/mpi).
//!
//! rsmpi does not expose RMA windows. This crate contains the raw RMA calls,
//! extends every rsmpi communicator through [`CommunicatorRmaExt`], and builds
//! fixed-slot [`Ring`] transport on those windows.
//!
//! [`Ring::safe`] provides backpressure with a cumulative-acknowledgement
//! gate. [`Ring::raw`] never blocks and reports overwritten messages instead.
//! Polling reads local memory; each safe [`Ring::ack`] call uses one atomic
//! MPI operation.
//!
//! ```no_run
//! use mpi::topology::Communicator;
//! use mpi_rma::Ring;
//!
//! # let (universe, _) = mpi::initialize_with_threading(mpi::Threading::Multiple).unwrap();
//! let world = universe.world();
//! // One lane from rank 0 to rank 1: 8 slots of 64 KiB each.
//! let ring = Ring::safe(&world, &[(0, 1, 8, 64 * 1024)]).unwrap();
//! if world.rank() == 0 {
//! ring.send(1, b"hello").unwrap();
//! } else if world.rank() == 1 {
//! 'receive: loop {
//! for message in ring.poll().unwrap() {
//! ring.ack(message.origin, message.sequence).unwrap();
//! break 'receive;
//! }
//! std::thread::yield_now();
//! }
//! }
//! ring.close().unwrap();
//! ```
//!
//! See `design.md` for the slot layout, sequencing rules, and the
//! acknowledge-gating model behind the ring transport, and `BENCHMARKS.md`
//! for measured throughput and latency against MPI point-to-point.
pub use Error;
pub use ;
pub use ;
/// rsmpi-style trait prelude. Importing this extends the original
/// communicator types in place; no communicator wrapper is involved.