MPI_WIN_DELETE_ATTR(3)

πŸ’– MPI_Win_delete_attr πŸ’–

okay bestie, welcome to another episode of "Open MPI man pages but make it cute" β€” this one's from the Open MPI collection, section 3 of the manual, and it's about yeeting an attribute off a window. no cap, that's the whole job. it's tiny, it's iconic, let's go ✨

MPI_Win_delete_attr β€” deletes an attribute from a window. that's it. that's the gig. πŸŽ€


✨ SYNTAX ✨

🩷 C Syntax

#include <mpi.h>

int MPI_Win_delete_attr(MPI_Win win, int win_keyval)

🩷 Fortran Syntax

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

🩷 Fortran 2008 Syntax

USE mpi_f08
MPI_Win_delete_attr(win, win_keyval, ierror)
     TYPE(MPI_Win), INTENT(IN) :: win
     INTEGER, INTENT(IN) :: win_keyval
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

πŸ“₯πŸ“€ INPUT/OUTPUT PARAMETER

  • win β€” the window we're pulling the attribute off of (a handle, obviously πŸ’…)

πŸ“₯ INPUT PARAMETER

  • win_keyval β€” the key value (an integer, bestie)

πŸ“€ OUTPUT PARAMETER

  • ierror β€” Fortran only: the error status (integer)

πŸ“ NOTES

not me about to warn you 🫣 β€” the MPI standard straight-up does not define what happens if the delete_fn callback calls other MPI functions. so like, undefined behaviour, ok? tread carefully.

in Open MPI specifically, it is not valid for delete_fn callbacks (or any of their children, grandchildren, the whole little callback family 🌱) to add or delete attributes on the same object that the delete_fn callback is being invoked on. that's the rule. respect it. πŸ™…β€β™€οΈ


πŸ’€ ERRORS πŸ’€

almost all MPI routines hand you back an error value β€” C routines as the return result of the function, and Fortran routines in the last argument. fr fr.

before that error value even gets returned, the current MPI error handler associated with the communication object (think communicator, window, file) gets called. and if there's no communication object associated with the MPI call at all? then the call is considered attached to MPI_COMM_SELF and it'll call the associated MPI error handler. πŸ‘‘

when MPI_COMM_SELF isn't initialized (i.e., 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 you can change that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when 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. and if no other appropriate error handler has been set? then the MPI_ERRORS_RETURN error handler is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions. slay, consistency πŸ’…

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. dramatic much? πŸ’€
  • 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 if MPI_Abort was called on that communicator. if 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 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_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
⚠️ note that MPI does not guarantee that an MPI program can continue past an error. like, at all. so don't be surprised, 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 πŸ“š


2003-2026, The Open MPI Community


and that's the whole page, periodt πŸ’…βœ¨ biggest thanks to The Open MPI Community for the copyright stretching all the way from 2003-2026, and this lil beauty was dated Sep 10, 2026 β€” love that for us πŸŽ€πŸ¦‹ go delete those attributes responsibly, bestie, mwah πŸ’–

πŸ“¦ where this page comes from