MPI_WIN_UNLOCK_ALL(3)
π NAME π
MPI_Win_unlock_all β bestie, this one completes an RMA access epoch that you started with a call to MPI_Win_lock_all. Like, you opened the door, now you're closing it. Closure! We love that for us. πβ¨
This page lives in the Open MPI manual, section 3 (iykyk). π
πΈ SYNTAX πΈ
C Syntax
#include <mpi.h>
int MPI_Win_unlock_all(MPI_Win win)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_WIN_UNLOCK_ALL(WIN, IERROR)
INTEGER WIN, IERROR
Fortran 2008 Syntax
USE mpi_f08
MPI_Win_unlock_all(win, ierror)
TYPE(MPI_Win), INTENT(IN) :: win
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETERS π
winβ the Window object, aka a handle. That's it, that's the girl. π
π¦ OUTPUT PARAMETER π¦
ierrorβ Fortran only: the error status, an integer. Only the Fortran girlies get one, bestie, the C girlies get their error as the return value.
β¨ DESCRIPTION β¨
Okay so MPI_Win_unlock_all completes an RMA access epoch that was started by a call to MPI_Win_lock_all. And here's the part that matters: all the RMA operations you issued during that period will have completed both at the origin and at the target by the time this call returns. Both sides. Fully done. No loose ends, no "wait did that land", nothing. Periodt. π
Now, why do locks even exist? Locks protect accesses to the locked target window that were made by RMA calls issued between the lock and the unlock call. They also protect local load/store accesses to a locked local window executed between the lock and the unlock call. So it's a whole protective situation. π«Ά
Two flavors of protection, two different vibes:
- Accesses protected by an exclusive lock will not be concurrent at the window site with other accesses to the same window that are lock protected.
- Accesses protected by a shared lock will not be concurrent at the window site with accesses protected by an exclusive lock to the same window.
π ERRORS π
Almost all MPI routines return an error value, bestie. C routines hand it back as the return result of the function, and Fortran routines put it in that last argument. That's just how it is. π
Before that error value gets returned, the current MPI error handler that's associated with the communication object (think: communicator, window, file) gets called. And 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. π
When MPI_COMM_SELF is not initialized β meaning 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. And that initial error handler can be changed by:
- calling
MPI_Comm_set_errhandleronMPI_COMM_SELF, when you're using the World model - or the
mpi_initial_errhandlerCLI argument tompiexec - 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 is called for MPI I/O functions, and MPI_ERRORS_ABORT is called for all other MPI functions. Yeah. π
Open MPI includes three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. Dramatic, but make it everyone. π₯MPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. When you call it on a communicator, it acts as ifMPI_Abortwas called on that communicator. If you call it on a window or a file, it acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. And if you call it on a session, it aborts only the local process. Different scope, different consequences, okay?MPI_ERRORS_RETURNβ returns an error code to the application. Chill vibes, you deal with it. π
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerand thenMPI_Comm_set_errhandlerMPI_File_create_errhandlerand thenMPI_File_set_errhandlerMPI_Session_create_errhandlerand thenMPI_Session_set_errhandleror atMPI_Session_initMPI_Win_create_errhandlerand thenMPI_Win_set_errhandler
Heads up, bestie: note that MPI does not guarantee that an MPI program can continue past an error. So like, don't assume you get to keep going. π
See the MPI man page for a full list of MPI error codes. No cap.
See the Error Handling section of the MPI-3.1 standard for more information. π
See also:
MPI_Win_lock_allMPI_Win_unlock
π Copyright π
Copyright 2003-2026, The Open MPI Community.
Okay that's the whole page, bestie β go unlock all those windows and slay. πβ¨π¦
This was the MPI_WIN_UNLOCK_ALL(3) page from Open MPI, dated Sep 10, 2026. 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