MPI_ATTR_DELETE(3)

πŸ‘‘ MPI_ATTR_DELETE πŸ’…

okay bestie, so this one is an oldie from the Open MPI manual pages, and I need you to sit down for this one because it's giving legacy code energy fr fr.

✨ SYNTAX ✨

🌸 C Syntax

#include <mpi.h>

int MPI_Attr_delete(MPI_Comm comm, int keyval)

πŸŽ€ Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'

MPI_ATTR_DELETE(COMM, KEYVAL, IERROR)
     INTEGER COMM, KEYVAL, IERROR

πŸ’– INPUT PARAMETERS πŸ’–

  • comm β€” the communicator that the attribute is attached to (it's a handle, bestie).
  • keyval β€” the key value of the attribute you're deleting (an integer, yes ma'am).

🫢 OUTPUT PARAMETER 🫢

  • ierror β€” Fortran only: the error status (integer). The C girlies get it as a return value instead, iykyk.

🌈 DESCRIPTION 🌈

okay so here's the tea 🍡 β€” using this routine is deprecated as of MPI-2, and it was deleted in MPI-3. like, fully gone. so please, for the love of everything, use MPI_Comm_delete_attr instead.

🚨 also important: this function does not have an mpi_f08 binding. not a vibe, just a fact.

πŸ’€ ERRORS πŸ’€

Almost all MPI routines return an error value, bestie β€” C routines hand it back as the return result of the function, and Fortran routines drop it in the last argument. periodt.

Before that error value makes its way back to you, 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? Then the call is considered attached to MPI_COMM_SELF and it'll call the associated MPI error handler. 🫠

When MPI_COMM_SELF is not initialized β€” that means 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
  • the mpi_initial_errhandler CLI argument to mpiexec, or
  • the info key to MPI_Comm_spawn / MPI_Comm_spawn_multiple.

If no other appropriate error handler has been set, then MPI_ERRORS_RETURN is the one that gets called for MPI I/O functions, and MPI_ERRORS_ABORT gets called for all other MPI functions. πŸ’…

⭐ Open MPI ships three predefined error handlers ⭐

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. like everyone. gone. 😭
  • 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 it's 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 it's called on a session, it aborts only the local process.
  • MPI_ERRORS_RETURN β€” returns an error code to the application. the chill one.

🧚 but wait, you can also make your own 🧚

MPI applications can 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
⚠️ real talk: note that MPI does not guarantee that an MPI program can continue past an error. so don't get cute with it.

See the MPI man page for a full list of MPI error codes, and the Error Handling section of the MPI-3.1 standard for more information. πŸ“š

πŸ‘€ See also:

  • MPI_Comm_delete_attr

Copyright πŸŽ€

2003-2026, The Open MPI Community


and that's the whole page, bestie!! hope she slays for you πŸ’–βœ¨ this was the Open MPI MPI_ATTR_DELETE(3) page, dated Sep 10, 2026 β€” go forth and use MPI_Comm_delete_attr instead, mwah πŸ«ΆπŸ‘‘

πŸ“¦ where this page comes from