MPI_INFO_SET(3)

✨ MPI_INFO_SET(3) ✨

okay so bestie, we're in the Open MPI corner of the manual today, and this one is literally the "add a thing to the thing" function πŸŽ€

πŸ’– NAME πŸ’–

MPI_Info_set β€” adds a key/value pair to info. that's it, that's the vibe πŸ’…


🌸 SYNTAX 🌸

πŸ¦‹ C Syntax

#include <mpi.h>

int MPI_Info_set(MPI_Info info, const char *key, const char *value)

πŸ¦‹ Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_INFO_SET(INFO, KEY, VALUE, IERROR)
     INTEGER         INFO, IERROR
     CHARACTER*(*)   KEY, VALUE

πŸ¦‹ Fortran 2008 Syntax

USE mpi_f08
MPI_Info_set(info, key, value, ierror)
     TYPE(MPI_Info), INTENT(IN) :: info
     CHARACTER(LEN=*), INTENT(IN) :: key, value
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

🌈 INPUT/OUTPUT PARAMETER 🌈

  • info β€” the Info object, a handle. main character energy, it goes in and comes out changed ✨

πŸ“ INPUT PARAMETERS πŸ“

  • key β€” the key, a string. yes bestie, a string πŸ”‘
  • value β€” the value, also a string. also a string πŸ’œ

πŸŽ€ OUTPUT PARAMETER πŸŽ€

  • ierror β€” Fortran only: the error status (an integer). Fortran girlies get their errors in the last argument, no cap 🌸

πŸ‘‘ DESCRIPTION πŸ‘‘

so like, MPI_Info_set adds the (key,value) pair to info, and it overrides the value if a value for the same key was already set. it does not ask, it does not negotiate, it just overrides πŸ’…

the key and value parameters are null-terminated strings in C. in Fortran, leading and trailing spaces in key and value are stripped. and listen β€” if either key or value is larger than the allowed maximums, the error MPI_ERR_INFO_KEY or MPI_ERR_INFO_VALUE is raised, respectively. that's the line, don't cross it 🚫


πŸ’€ ERRORS πŸ’€

almost all MPI routines return an error value, fr fr: C routines as the return result of the function, and Fortran routines in the last argument.

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. 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, 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 🫢
  • 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. like, bestie, it might just not 😭

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_Info_create
  • MPI_Info_delete
  • MPI_Info_dup
  • MPI_Info_free
  • MPI_Info_set

(i know, MPI_Info_set is in its own SEE ALSO list. iconic behaviour, honestly πŸ‘‘)


2003-2026, The Open MPI Community β€” love that for them πŸ’–


and that's the whole page, bestie! this one shipped with Open MPI, dated Sep 11, 2026, and the footer reads MPI_INFO_SET(3) right back at you. slay, go set some keys πŸ¦‹βœ¨

πŸ“¦ where this page comes from