MPI_COMM_GET_INFO(3)

πŸ’… MPI_COMM_GET_INFO(3) ✨

okay bestie, welcome to the Open MPI manual page for MPI_Comm_get_info β€” yes the whole page, yes in the Open MPI collection, and yes it's giving "let me peek at your hints" energy. sit down, hydrate, let's go 🫢


🌸 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 pulling those active info hints from. like, the source of truth. the main character of this call πŸ’–

πŸ¦‹ OUTPUT PARAMETERS πŸ¦‹

  • info_used β€” a brand new info object that comes back holding all the active hints on this communicator. fresh out the box, no cap ✨
  • ierror β€” Fortran only, bestie: the error status, and it's an integer πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

so MPI_Comm_get_info returns a new info object containing the hints of the communicator associated with comm. literally that's the whole vibe.

the current setting of all hints actually used by the system related to this communicator gets returned in info_used. like, not the ones you wished for β€” the ones the system is genuinely running with πŸ‘‘

and if no such hints exist? don't panic 😭 a handle to a newly created info object is returned that contains no key/value pair. empty. clean. iconique. and yeah β€” you, the user, are responsible for freeing info_used via MPI_Info_free. don't leave it hanging, that's not cute πŸ’…


πŸ”₯ ERRORS πŸ”₯

almost all MPI routines return an error value, periodt. C routines get it as the return result of the function, and Fortran routines get it in the last argument 🫢

before that error value comes back, 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 will call the associated MPI error handler. iykyk.

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. and you can change that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or via the mpi_initial_errhandler CLI argument to mpiexec, or via the info key to MPI_Comm_spawn/MPI_Comm_spawn_multiple. slay, options πŸ’…

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. that's the rule, no cap.

Open MPI includes three predefined error handlers that can be used, and honestly they're a whole trio ⭐

  • 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. context-sensitive king πŸ‘‘
  • MPI_ERRORS_RETURN β€” returns an error code to the application. chill. polite. hands you the receipt 🧾

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. like, fr fr, do not assume it bounces back πŸ™ˆ

see the MPI man page for a full list of MPI error codes. and see the Error Handling section of the MPI-3.1 standard for more information. go read, bestie, it's good for you πŸ“š


🌈 SEE ALSO 🌈

  • MPI_Comm_get_info
  • MPI_Info_free

2003-2026, The Open MPI Community


and that's the page, bestie!! πŸŽ€ big slay to the Open MPI crew β€” copyright 2003-2026, The Open MPI Community, and this lil masterpiece is dated Sep 11, 2026. go free your info objects and stan responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from