MPI_ADDRESS(3)

πŸ’– MPI_ADDRESS πŸ’–

okay bestie, listen β€” this is the Open MPI man page for MPI_Address, and it is literally an iconic little routine that gets the address of a location in memory... except it's deprecated in favor of MPI_Get_address. we'll get to that. sit down, hydrate, let's go ✨


🌸 NAME 🌸

MPI_Address β€” gets the address of a location in memory β€” and no cap, this routine is deprecated in favor of MPI_Get_address. πŸ’€


πŸŽ€ SYNTAX πŸŽ€

✨ C Syntax ✨

#include <mpi.h>

int MPI_Address(void *location, MPI_Aint *address)

πŸ¦‹ Fortran Syntax πŸ¦‹

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

MPI_ADDRESS(LOCATION, ADDRESS, IERROR)
     <type>  LOCATION (*)
     INTEGER ADDRESS, IERROR

like yes, she's vintage, she's serving old-school compilation units 🧚


πŸ’… INPUT PARAMETER πŸ’…

  • location β€” a location in caller memory, and the type is choice (so, like, whatever type you want, she's flexible, main character energy). 🌈

🫢 OUTPUT PARAMETERS 🫢

  • address β€” the address of location, and it's an integer. slay. πŸ’–
  • ierror β€” Fortran only: error status, as an integer. the Fortran girlies get their own little error slot, and we love that for them. ⭐

πŸ‘‘ DESCRIPTION πŸ‘‘

not me having to be the one to tell you this, but... use of this routine is deprecated as of MPI-2. 😭

please use MPI_Get_address instead. fr fr. that's the whole tea. πŸ“


πŸ’€ ERRORS πŸ’€

okay so basically almost all MPI routines return an error value: C routines hand it back as the return result of the function, and Fortran routines put it in that last argument. periodt.

Before the error value is returned, the current MPI error handler associated with the communication object (like a communicator, window, or file β€” iykyk) 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 will call the associated MPI error handler. πŸŒ€

And when MPI_COMM_SELF is not 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. lowkey important. πŸ™ˆ

That initial error handler can be changed by:

  • calling MPI_Comm_set_errhandler on MPI_COMM_SELF when 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 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 that can be used:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. dramatic? yes. effective? also yes. πŸ’€
  • 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. this is not a drill, 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.

See also:

  • MPI_Get_address

2003-2026, The Open MPI Community


and that's the whole page, bestie!! πŸŽ€ go forth and use MPI_Get_address instead, love her, respect her, she's the upgrade πŸ’…

this scoop of a page came from Open MPI, dated Sep 10, 2026, and it bears the copyright of 2003-2026, The Open MPI Community β€” mwah, iconic, no notes. πŸ‘‘βœ¨

πŸ“¦ where this page comes from