MPI_WIN_GET_ATTR(3)

πŸ’– MPI_WIN_GET_ATTR πŸ’–

okay so first things first: this page is from the Open MPI manual, and honestly? it's short and sweet. we love a low-effort icon. πŸ’…


✨ NAME ✨

MPI_Win_get_attr β€” Obtains the value of a window attribute.

like. it gets you the value of an attribute that's attached to a window. that's the whole vibe. πŸͺŸ


🌸 SYNTAX 🌸

πŸŽ€ C Syntax πŸŽ€

#include <mpi.h>

int MPI_Win_get_attr(MPI_Win win, int win_keyval,
     void *attribute_val, int *flag)

πŸŽ€ Fortran Syntax πŸŽ€

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_WIN_GET_ATTR(WIN, WIN_KEYVAL, ATTRIBUTE_VAL, FLAG, IERROR)
     INTEGER WIN, WIN_KEYVAL, IERROR
     INTEGER(KIND=MPI_ADDRESS_KIND) ATTRIBUTE_VAL
     LOGICAL FLAG

πŸŽ€ Fortran 2008 Syntax πŸŽ€

USE mpi_f08
MPI_Win_get_attr(win, win_keyval, attribute_val, flag, ierror)
     TYPE(MPI_Win), INTENT(IN) :: win
     INTEGER, INTENT(IN) :: win_keyval
     INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(OUT) :: attribute_val
     LOGICAL, INTENT(OUT) :: flag
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

🫢 INPUT PARAMETERS 🫢

  • win β€” the window the attribute is attached to, bestie (it's a handle).
  • win_keyval β€” the key value, and yes it's an integer (integer).

πŸ’œ OUTPUT PARAMETERS πŸ’œ

  • attribute_val β€” the attribute value, unless ag = false. πŸ™ˆ
  • flag β€” false if no attribute is associated with the key (logical).
  • ierror β€” Fortran only: error status (integer).

πŸ¦‹ DESCRIPTION πŸ¦‹

Obtains the value of a window attribute. that's it, that's the description. short queen energy. ✨


πŸ”₯ ERRORS πŸ”₯

okay so here's where it gets real. Almost all MPI routines return an error value β€” C routines hand it back as the return result of the function, and Fortran routines drop it in the last argument. no cap.

Before that error value makes it back to you, the current MPI error handler associated with the communication object (so like, communicator, window, file) gets called. If there's no communication object attached to 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 (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. The initial error handler can be changed 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. 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. πŸ’€

Open MPI includes three predefined error handlers you can use, and they are:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. (yes. all of them. goodbye.)
  • 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. polite king behavior. πŸ‘‘

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. so like, don't count on it, bestie. 😭

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.


2003-2026, The Open MPI Community


and that's the whole page, babes πŸŽ€ this was the Open MPI version of MPI_WIN_GET_ATTR(3), dated Sep 10, 2026 β€” love that for us. now go get those window attributes. bye bestie!! πŸ’–βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from