MPI_WIN_FLUSH_ALL(3)
π bestie alert π you're in the Open MPI manual, section 3, and the page isMPI_WIN_FLUSH_ALLβ akaMPI_Win_flush_all, riding shotgun with its twinMPI_Win_flush. π¦
okay so the whole vibe of this page, in one breath: complete all outstanding RMA operations at both the origin and the target. That's the assignment. Periodt. β¨
πΈ SYNTAX πΈ
π C Syntax
#include <mpi.h>
int MPI_Win_flush (int rank, MPI_Win win)
int MPI_Win_flush_all (MPI_Win win)
π Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_WIN_FLUSH(RANK, WIN, IERROR)
INTEGER RANK, WIN, IERROR
MPI_WIN_FLUSH_ALL(WIN, IERROR)
INTEGER WIN, IERROR
π Fortran 2008 Syntax
USE mpi_f08
MPI_Win_flush(rank, win, ierror)
INTEGER, INTENT(IN) :: rank
TYPE(MPI_Win), INTENT(IN) :: win
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_Win_flush_all(win, ierror)
TYPE(MPI_Win), INTENT(IN) :: win
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETERS π
rankβ the rank of the window, and it's a nonnegative integer, no cap. πwinβ the window object (handle). The whole little universe you're flushing into. π
π OUTPUT PARAMETER π
ierrorβ Fortran only: error status (integer). The Fortran girlies get the receipts at the end of the call, not as the return value. π«Ά
π DESCRIPTION π
MPI_Win_flush completes all outstanding RMA operations initiated by the calling process to the target rank on the specified window. And bestie, "completes" means both sides β the operations are completed at the origin and at the target. Not one, not the other. Both. Fr fr. π€
MPI_Win_flush_all does the same thing but sends the energy to all targets. Every single one. No picking favorites.
β οΈ BIG ONE, DO NOT SKIP: this can ONLY be called from within a passive target epoch. Not an active one. Not "eh, close enough." Passive only. If you're in the wrong epoch, that's on you. π
π ERRORS π
Okay so almost all MPI routines hand you back an error value β C routines give it to you as the return result of the function, and Fortran routines tuck it into the last argument. π
Before that error value comes back to you, the current MPI error handler that's associated with the communication object (think: communicator, window, file) gets called. If there's no communication object associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and it'll call the associated MPI error handler. π«
And 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 using 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. β¨
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, and they are:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. Everyone. Gone. π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 ifMPI_Abortwas called on that communicator. If it's called on a window or file, it acts as ifMPI_Abortwas 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. The chill one. π«Ά
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerthenMPI_Comm_set_errhandlerMPI_File_create_errhandlerthenMPI_File_set_errhandlerMPI_Session_create_errhandlerthenMPI_Session_set_errhandler, or atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
β οΈ Note that MPI does not guarantee that an MPI program can continue past an error. Like, don't count on walking it off. π
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_localMPI_Win_lockMPI_Win_lock_all
and that's the whole page, bestie, you ate ππ
legal-ish sign-off, because we keep the receipts: this is Copyright 2003-2026, The Open MPI Community π and the page stamp says Sep 10, 2026, filed under MPI_WIN_FLUSH_ALL(3), straight outta the Open MPI manual. mwah πβ¨
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms