Chip Foundry Services Request Assessment

Mpi One Sided Communication

MPI One-Sided Communication (RMA) is the MPI paradigm where a single process can directly read from (Get) or write to (Put) memory on a remote process without the remote process explicitly participating in the communication, enabling asynchronous data transfer patterns that can overlap computation with communication and simplify irregular communication structures.

Traditional $\mathrm{MPI} \text{two-sided}$ communication (Send/Recv) requires both sender and receiver to participate: the receiver must post a matching Recv before or concurrently with the sender's Send. This synchronization requirement creates challenges for irregular access patterns (where the target of each communication is data-dependent) and limits overlap opportunities.

MPI RMA Operations:

OperationSemanticsUse Case
$*\cdot \mathrm{MPI}_{Put}^{\ast}*$Write local data to remote windowDistributed array updates
$*\cdot \mathrm{MPI}_{Get}^{\ast}*$Read remote window data to local bufferIrregular data gathering
$*\cdot \mathrm{MPI}_{Accumulate}^{\ast}*$Remote atomic read-modify-writeDistributed reduction
$*\cdot \mathrm{MPI}_{Get_{\text{accumulate}}}^{\ast}*$Atomic get + accumulateCompare-and-swap patterns
MPI_Compare_and_swapAtomic CAS on remote memoryDistributed locks
MPI_Fetch_and_opAtomic fetch + operationCounters, queues

Window Creation: Before RMA operations, each process exposes a memory region as an MPI Window. Window types include: $\mathrm{MPI}_{Win_{\text{create}}}$ (existing buffer), $\mathrm{MPI}_{Win_{\text{allocate}}}$ (MPI allocates optimized memory), MPI_Win_allocate_shared (shared memory in same node), and MPI_Win_create_dynamic (attach/detach memory regions dynamically).

Synchronization Modes: RMA operations are non-blocking — completion must be ensured through synchronization:

  • Fence synchronization: $\mathrm{MPI}_{Win_{\text{fence}}}$ acts as a collective barrier — all RMA ops between two fences are guaranteed complete after the second fence. Simple but synchronizes all processes.
  • Post-Start-Complete-Wait (PSCW): Target process posts $(\mathrm{MPI}_{Win_{\text{post}}})$, origin starts access epoch $(\mathrm{MPI}_{Win_{\text{start}}})$, performs RMA operations, completes $(\mathrm{MPI}_{Win_{\text{complete}}})$, target waits $(\mathrm{MPI}_{Win_{\text{wait}}}). \text{Finer-grained}$ than fence but requires target participation.
  • Lock/Unlock: $\mathrm{MPI}_{Win_{\text{lock}}}/unlock$ creates passive-target access epochs — the target process does not participate at all. Supports shared locks (multiple readers) and exclusive locks (single writer). MPI_Win_lock_all provides persistent passive-target epoch for PGAS-style programming.

Performance Considerations: One-sided communication can exploit RDMA hardware (InfiniBand, iWARP) that performs remote memory access without remote CPU involvement. Key factors: latency — Put/Get can be lower latency than Send/Recv for small messages; overlap — $\text{non-blocking} \mathrm{RMA}$ enables computation during transfer; contention — concurrent access to same window region requires careful synchronization; progress — some MPI implementations require periodic MPI calls for background RMA progress.

Use Cases: Distributed hash tables (remote Get for lookups), stencil computations with one-sided halo exchange, distributed graph algorithms with irregular access, global arrays (GA/PGAS implemented over MPI RMA), and distributed shared-memory emulation.

MPI one-sided communication bridges the gap between message-passing and shared-memory programming models — providing the performance of RDMA-capable hardware with the portability and standardization of MPI, enabling efficient irregular communication patterns that are awkward with two-sided messaging.