MPI_COMM_GET_INFO(3)
π MPI_COMM_GET_INFO(3) β the Open MPI glow-up π
okay bestie, we're in section 3 of the Open MPI manuals and today's main character is MPI_Comm_get_info. it's giving "let me peek at what hints you're actually running with" and honestly? iconic. let's get into it β¨
πΈ NAME πΈ
MPI_Comm_get_info β pulls up the active communicator info hints. like, the real ones. not the ones you wished for.
π SYNTAX π
C Syntax
#include <mpi.h>
int MPI_Comm_get_info(MPI_Comm comm, MPI_Info *info_used)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_COMM_GET_INFO(COMM, INFO_USED, IERROR)
INTEGER COMM, INFO_USED, IERROR
Fortran 2008 Syntax
USE mpi_f08
MPI_Comm_get_info(comm, info_used, ierror)
TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Info), INTENT(OUT) :: info_used
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π«Ά INPUT PARAMETERS π«Ά
commβ the communicator you're asking for active info hints from. yes, that one. hand it over π
β¨ OUTPUT PARAMETERS β¨
info_usedβ a brand-new info object, returned packed with every active hint chillin' on this communicator. fresh out the box, bestie πierrorβ Fortran only, bestie: error status, and it's an integer.
π¦ DESCRIPTION π¦
so MPI_Comm_get_info hands you back a new info object stuffed with the hints of the communicator that's tied to comm. what you get in info_used is the current setting of all the hints that the system is actually using for this communicator β not the ones you offered, the ones that made the cut β¨
and if there are literally no such hints? no stress. you still get a handle to a freshly created info object, it just contains no key/value pair. empty. a lil void. still valid though π
β οΈ important bestie, do not forget this one: you are the one responsible for freeinginfo_used, and you do it withMPI_Info_free. it's your info now. your responsibility. your problem. periodt π
π ERRORS π
almost all MPI routines return an error value, okay? in C it comes back as the return result of the function. in Fortran it shows up in that last argument. classic.
before that error value gets returned, 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 at all? then the call is considered attached to MPI_COMM_SELF, and it calls the associated MPI error handler. iykyk.
when MPI_COMM_SELF is not initialized β meaning before MPI_Init / MPI_Init_thread, or after MPI_Finalize, or when you're using the Sessions Model exclusively β the error raises the initial error handler. and you can change that initial error handler, bestie:
- call
MPI_Comm_set_errhandleronMPI_COMM_SELF, if you're using the World model, or - use the
mpi_initial_errhandlerCLI argument tompiexec, or - use 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 gets called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler gets called for all other MPI functions. that's the rule π
Open MPI ships with three predefined error handlers you can use:
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 it's called on a communicator, it acts as ifMPI_Abortwas called on that communicator. if it's 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 it's called on a session, it aborts only the local process. cute and local πMPI_ERRORS_RETURNβ returns an error code to the application. the chill one. the lowkey 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_errhandleror atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
note that MPI does not guarantee that an MPI program can continue past an error. like, no cap. do not assume you can just keep going π
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.
also see:
MPI_Comm_get_infoMPI_Info_free
π Copyright π
2003-2026, The Open MPI Community
okay that's the whole thing, you ate it, slay π this page was served up by the Open MPI crew, section 3, dated Sep 10, 2026 β go forth and free your info objects, bestie ππ¦β
π¦ 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