MPI_ATTR_GET(3)
π MPI_ATTR_GET(3) β Open MPI manual, bestie edition π
okay so. hi. sit down, grab a strawberry π, because we're talking about MPI_Attr_get, and this one is a legacy girly. It retrieves an attribute value by key... and it is deprecated in favor of MPI_Comm_get_attr. Like, MPI-2 deprecated it, MPI-3 literally deleted it. It said "I'm retiring" and then it retired. π
β¨ SYNTAX β¨
π C Syntax
#include <mpi.h>
int MPI_Attr_get(MPI_Comm comm, int keyval,void *attribute_val,
int *flag )
π Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_ATTR_GET(COMM, KEYVAL, ATTRIBUTE_VAL, FLAG, IERROR)
INTEGER COMM, KEYVAL, ATTRIBUTE_VAL, IERROR
LOGICAL FLAG
πΈ INPUT PARAMETERS πΈ
commβ the communicator that the attribute is attached to (a handle). it's giving "where is this thing glued on".keyvalβ the key value (an integer). your lil lookup key, iykyk ποΈ
π¦ OUTPUT PARAMETERS π¦
attribute_valβ the attribute value, unlessflag = false. so like, no flag, no value.flagβtrueif an attribute value was actually extracted;falseif there is just. no attribute associated with that key. the vibe check result, lowkey πierrorβ Fortran only: the error status (integer).
π DESCRIPTION π
Real talk bestie: use of this routine is deprecated as of MPI-2, and it was deleted in MPI-3. Please, please, use MPI_Comm_get_attr instead. β¨
Also: this function does not have a mpi_f08 binding. so if that's your era, this is not your era. π
π₯ ERRORS π₯
Almost all MPI routines return an error value β C routines hand it back as the return result of the function, and Fortran routines tuck it into the last argument. no cap.
Before the error value is returned, the current MPI error handler associated with the communication object (like, a communicator, window, or file) gets called. 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. And when MPI_COMM_SELF is not initialized (i.e. before MPI_Init / MPI_Init_thread, after MPI_Finalize, or when 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 an 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. periodt.
Open MPI includes three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. dramatic, iconic, unrecoverable π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. main character, but localized πMPI_ERRORS_RETURNβ returns an error code to the application. the chill one. the "here's your problem back, bestie" one.
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_errhandler, or atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
Note that MPI does not guarantee that an MPI program can continue past an error. π
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. π
See also:
MPI_Comm_get_attrβ literally the glow-up replacement, go there bestie π
π Copyright π
2003-2026, The Open MPI Community
and that's the page!! no notes, ate, slay π
k byeee β this was Open MPI'sMPI_ATTR_GET(3)manual page, dated Sep 10, 2026, brought to you by the lovely humans of The Open MPI Community (2003-2026). go useMPI_Comm_get_attrinstead, ily π«Άβ¨
π¦ 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