MPI_WIN_SYNC(3)
π MPI_WIN_SYNC π
okay bestie, this is the MPI_WIN_SYNC page from the Open MPI manual (section 3, the library-calls one), and honestly? It's a lil bop. It's short, it's sweet, and it does exactly one job. Let's get into it. β¨
πΈ NAME πΈ
MPI_Win_sync β synchronize the private and public copies of the window. That's it. That's the whole gig. No cap.
β¨ SYNTAX β¨
π C Syntax
#include <mpi.h>
int MPI_Win_sync (MPI_Win win)
π¦ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_WIN_SYNC(WIN, IERROR)
INTEGER WIN, IERROR
π Fortran 2008 Syntax
USE mpi_f08
MPI_Win_sync(win, ierror)
TYPE(MPI_Win), INTENT(IN) :: win
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETERS
winβ the window object, as a handle. Your lil window. Your baby. πͺ
π«Ά OUTPUT PARAMETER
ierrorβ Fortran only, bestie: the error status, and it's an integer. C girlies get the error back as the return value instead. π
π DESCRIPTION π
So here's the tea: MPI_Win_sync synchronizes the private and public window copies of win. That's literally what it does.
For the purposes of synchronizing the private and public window, MPI_Win_sync has the effect of ending and reopening an access and exposure epoch on the window. Like, that's the vibe it's giving.
But β and this is important, bestie, do not skip this β it does not actually end an epoch and it does not complete any pending MPI RMA operations. So it's giving "end and reopen" energy without, y'know, actually doing the end and reopen. Iconic behavior honestly. π
π ERRORS π
Almost all MPI routines return an error value, okay? C routines give it to you as the return result of the function, and Fortran routines put it in the last argument. Fr fr.
Before the error value is returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) is 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 will call the associated MPI error handler. Periodt.
When MPI_COMM_SELF is not 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. The way that you can change the initial error handler is by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or 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 is called for MPI I/O functions, and MPI_ERRORS_ABORT is called for all other MPI functions. That's just how it is. π
Open MPI includes three predefined error handlers that you can use, and they are:
MPI_ERRORS_ARE_FATALβ Causes the program to abort all connected MPI processes. Dramatic? Yes. Effective? Also yes.MPI_ERRORS_ABORTβ An error handler that can be invoked on a communicator, window, file, or session. When called on a communicator, it acts as ifMPI_Abortwas called on that communicator. If 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 called on a session, it aborts only the local process. So specific. We love a handler that knows what it wants. πMPI_ERRORS_RETURNβ Returns an error code to the application. Chill. Communicative. A whole vibe.
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_errhandleror 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, it might just be over. No promises, bestie. π
See the MPI man page for a full list of MPI error codes, and see the Error Handling section of the MPI-3.1 standard for more information. iykyk. π
π Copyright π
2003-2026, The Open MPI Community
okay that's the whole page!! π¦ this was brought to you by the Open MPI manual, MPI_WIN_SYNC(3), dated Sep 10, 2026 β slay, stay synchronized, and don't forget to sync your private and public copies bestie πβ¨πΈ
π¦ 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