MPI_WIN_FLUSH_LOCAL_ALL(3)

πŸ“¦
version 5.0.10 Β· 4 versions
, in ubuntu stonking

✨ NAME ✨

MPI_Win_flush_local and MPI_Win_flush_local_all β€” they complete all outstanding RMA operations at the origin πŸ’…

(the whole page lives in the Open MPI manual, bestie, that's the vibe)


πŸŽ€ SYNTAX πŸŽ€

C Syntax

#include <mpi.h>

int MPI_Win_flush_local (int rank, MPI_Win win)

int MPI_Win_flush_local_all (MPI_Win win)

Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_WIN_FLUSH_LOCAL(RANK, WIN, IERROR)
     INTEGER RANK, WIN, IERROR

MPI_WIN_FLUSH_LOCAL_ALL(WIN, IERROR)
     INTEGER WIN, IERROR

Fortran 2008 Syntax

USE mpi_f08
MPI_Win_flush_local(rank, win, ierror)
     INTEGER, INTENT(IN) :: rank
     TYPE(MPI_Win), INTENT(IN) :: win
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

MPI_Win_flush_local_all(win, ierror)
     TYPE(MPI_Win), INTENT(IN) :: win
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

🌸 INPUT PARAMETERS 🌸

  • rank β€” Rank of the window, a nonnegative integer πŸ’–
  • win β€” the window object, as a handle ✨

πŸ¦‹ OUTPUT PARAMETER πŸ¦‹

  • ierror β€” Fortran only: error status, an integer πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

So MPI_Win_flush_local locally completes, at the origin, all the outstanding RMA operations that the calling process initiated toward the target process you named in rank, on that specified window. The way that works is: once this routine finishes, you're literally free to reuse any buffers you handed over to put, get, or accumulate operations 🫢

And MPI_Win_flush_local_all is the glow-up version β€” it locally completes, at the origin, all outstanding RMA operations to all targets. Periodt πŸ”₯

Bestie, this one has a rule: it can only be called from within a passive target epoch. No notes. πŸ’…

😭 ERRORS 😭

Okay so, almost all MPI routines return an error value β€” C routines hand it back as the return result of the function, and Fortran routines put it in the last argument. ✨

Before that error value comes back, the current MPI error handler associated with the communication object (think communicator, window, file) gets called. And if there's, like, no communication object attached to the MPI call? Then the call is considered attached to MPI_COMM_SELF and it'll call that associated MPI error handler instead. When MPI_COMM_SELF isn't initialized (that's before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively), the error raises the initial error handler. You can change that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're on the World model, or via the mpi_initial_errhandler CLI argument to mpiexec, or the info key to MPI_Comm_spawn/MPI_Comm_spawn_multiple. And if no other appropriate error handler has been set? Then MPI_ERRORS_RETURN gets called for MPI I/O functions, and MPI_ERRORS_ABORT gets called for all other MPI functions. πŸ’€

Open MPI ships three predefined error handlers you can use:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes πŸ’€
  • MPI_ERRORS_ABORT β€” an error handler that can be invoked on a communicator, window, file, or session. When it's called on a communicator, it acts as if MPI_Abort was called on that communicator. If it's called on a window or file, it acts as if MPI_Abort was called on a communicator containing the group of processes in the corresponding window or file. If it's called on a session, it aborts only the local process 🫢
  • MPI_ERRORS_RETURN β€” returns an error code to the application ✨

MPI applications can also implement their own error handlers, by calling:

  • MPI_Comm_create_errhandler then MPI_Comm_set_errhandler
  • MPI_File_create_errhandler then MPI_File_set_errhandler
  • MPI_Session_create_errhandler then MPI_Session_set_errhandler or at MPI_Session_init
  • MPI_Win_create_errhandler then MPI_Win_set_errhandler
Heads up bestie: MPI does not guarantee that an MPI program can continue past an error. Not me being dramatic, that's just the truth 😭

See the MPI man page for a full list of MPI error codes. πŸ“œ

See the Error Handling section of the MPI-3.1 standard for more information. 🌈

See also:

  • MPI_Win_flush
  • MPI_Win_lock
  • MPI_Win_lock_all

2003-2026, The Open MPI Community


okay that's the whole page, no cap β€” this was transcribed from Open MPI's manual page MPI_WIN_FLUSH_LOCAL_ALL(3) dated Sep 10, 2026. go flush those windows, main character πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from