13.2.5. Window Destruction

PreviousUpNext
Up: Initialization Next: Window Attributes Previous: Window of Dynamically Attached Memory

MPI_WIN_FREE(win)
INOUT winwindow object (handle)
C binding
int MPI_Win_free(MPI_Win *win)
Fortran 2008 binding
MPI_Win_free(win, ierror)

TYPE(MPI_Win), INTENT(INOUT) :: win
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_WIN_FREE(WIN, IERROR)

INTEGER WIN, IERROR

Frees the window object win and returns a null handle (equal to MPI_WIN_NULL). This procedure is collective over the group associated with win. MPI_WIN_FREE can be invoked by an MPI process only after it has completed its involvement in RMA communications on window win: e.g., the MPI process has called MPI_WIN_FENCE, or called MPI_WIN_WAIT to match a previous call to MPI_WIN_POST, called MPI_WIN_COMPLETE to match a previous call to MPI_WIN_START, or called MPI_WIN_UNLOCK to match a previous call to MPI_WIN_LOCK. The memory associated with windows created by a call to MPI_WIN_CREATE may be freed after the call returns. If the window was created with MPI_WIN_ALLOCATE, MPI_WIN_FREE will free the window memory that was allocated in MPI_WIN_ALLOCATE. If the window was created with MPI_WIN_ALLOCATE_SHARED, MPI_WIN_FREE will free the window memory that was allocated in MPI_WIN_ALLOCATE_SHARED.

Freeing a window that was created with a call to MPI_WIN_CREATE_DYNAMIC detaches all associated memory; i.e., it has the same effect as if all attached memory was detached by calls to MPI_WIN_DETACH.

MPI_WIN_FREE is required to delay its return until all accesses to the local window using passive target synchronization have completed. Therefore, it is synchronizing unless the window was created with the no_locks info key set to true.


PreviousUpNext
Up: Initialization Next: Window Attributes Previous: Window of Dynamically Attached Memory


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023