MPI_INFO_SET(3)
π MPI_INFO_SET π
okay so bestie, we're in the Open MPI section of the manual (the 3 part is just the section number, iykyk) and today's main character is MPI_Info_set β she adds a key/value pair to info. that's it. that's the whole job. and she does it flawlessly. π
β¨ 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, aka the handle. she's the one getting β¨editedβ¨.
π« INPUT PARAMETERS
keyβ the key, a string. πvalueβ the value, also a string. π
π« OUTPUT PARAMETER
ierrorβ Fortran only bestie: the error status (an integer). π¦
π DESCRIPTION π
MPI_Info_set adds the (key,value) pair to info, and overrides the value if a value for the same key was previously set. she doesn't argue, she doesn't warn you, she just replaces it. periodt. π
In C, the key and value parameters are null-terminated strings. In Fortran, leading and trailing spaces in key and value get stripped β no cap, they literally get trimmed.
and if eitherkeyorvalueis larger than the allowed maximums? π the errorMPI_ERR_INFO_KEYorMPI_ERR_INFO_VALUEis raised, respectively. so like, watch your sizes bestie.
π ERRORS π
Almost all MPI routines return an error value, okay? C routines hand it back as the return result of the function, and Fortran routines put it in that last argument. classic Fortran behaviour, we love her anyway. π
Before the error value is returned, the current MPI error handler associated with the communication object (e.g., 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 it'll call the associated MPI error handler. Now β 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. That initial error handler can be changed by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're using the World model, or by the mpi_initial_errhandler CLI argument to mpiexec, or by that 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 is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions. that's the deal. π€
Open MPI includes three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ Causes the program to abort all connected MPI processes. π no survivors.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 ifMPI_Abortwas called on that communicator. If 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 called on a session, it aborts only the local process. πMPI_ERRORS_RETURNβ Returns an error code to the application. she's polite like that. π«Ά
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. she said what she said. π
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_createMPI_Info_deleteMPI_Info_dupMPI_Info_freeMPI_Info_set
π Copyright
2003-2026, The Open MPI Community
okay that's the whole page bestie, you ate that ππ and just so you know, this edition is the Sep 10, 2026 printing of MPI_INFO_SET(3) from Open MPI, section 3 of the manual, brought to you by the Open MPI Community (the 2003-2026 copyright era, iconic run). go set some keys, you're gonna slay β¨π¦π
π¦ 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