MPI_GET_VERSION(3)

πŸ’… MPI_GET_VERSION(3) πŸ’…

okay so this is a page from the Open MPI manual, and honestly? it's a little cutie. it just tells you which version of the MPI standard your implementation is out here living by. let's get into it πŸŽ€


✨ NAME ✨

MPI_Get_version β€” returns the version of the standard corresponding to the current implementation. literally that's it, that's the whole job 🫢


🌸 SYNTAX 🌸

πŸ’– C Syntax

#include <mpi.h>

int MPI_Get_version(int *version, int *subversion)

πŸ’– Fortran Syntax

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

MPI_GET_VERSION(VERSION, SUBVERSION, IERROR)
    INTEGER VERSION, SUBVERSION, IERROR

πŸ’– Fortran 2008 Syntax

USE mpi_f08

MPI_Get_version(version, subversion, ierror)
    INTEGER, INTENT(OUT) :: version, subversion
    INTEGER, OPTIONAL, INTENT(OUT) :: ierror

πŸ¦‹ OUTPUT PARAMETERS πŸ¦‹

  • version β€” the major version number of the corresponding standard (integer). the big number bestie ✨
  • subversion β€” the minor version number of the corresponding standard (integer). the lil number πŸŽ€
  • ierror β€” Fortran only: error status (integer).

πŸ‘‘ DESCRIPTION πŸ‘‘

so since Open MPI v5.0.11 is MPI-3.1 compliant (there's a whole page about Open MPI standards conformance if you wanna go deeper πŸ‘€), this function will return a version value of 3 and a subversion value of 1 for this release. no cap, that's the answer it's giving πŸ’…


⭐ NOTE ⭐

MPI_Get_version is one of the few functions that can be called before MPI_Init and after MPI_Finalize. main character energy fr fr β€” it doesn't even need the party to be started 🌈


πŸ’€ ERRORS πŸ’€

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

before the error value is returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) is called. if no communication object is associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and will call the associated MPI error handler. 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 using the World model, or the mpi_initial_errhandler CLI argument to mpiexec or 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. yeah. everybody. 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 called on a window or file, 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, aborts only the local process. very "knows exactly who to cancel" of it πŸ”₯
  • MPI_ERRORS_RETURN β€” returns an error code to the application. the polite 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. 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. yes, there's homework, but it's good homework πŸ“š


2003-2026, The Open MPI Community


and that's the tea πŸ“ this little page is from the Open MPI manual, dated Sep 11, 2026 β€” go forth and check your versions, queen πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from