MPI_INFO_GET_NTHKEY(3)
π MPI_INFO_GET_NTHKEY π
okay bestie, so this is a page from the Open MPI manual, and we're about to get so cozy with MPI_Info_get_nthkey. she's a little lookup gremlin β you hand her a number, she hands you a key. it's giving β¨index girlieβ¨.
πΈ NAME πΈ
MPI_Info_get_nthkey β Returns the nth defined key in info.
lowkey the whole personality right there. no notes. π
β¨ SYNTAX β¨
π«Ά C Syntax
#include <mpi.h>
int MPI_Info_get_nthkey(MPI_Info info, int n, char *key)
π«Ά Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_INFO_GET_NTHKEY(INFO, N, KEY, IERROR)
INTEGER INFO, N, IERROR
CHARACTER*(*) KEY
π«Ά Fortran 2008 Syntax
USE mpi_f08
MPI_Info_get_nthkey(info, n, key, ierror)
TYPE(MPI_Info), INTENT(IN) :: info
INTEGER, INTENT(IN) :: n
CHARACTER(LEN=*), INTENT(OUT) :: key
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETERS π
infoβ the Info object, aka the handle. your lil info bestie. π¦nβ the key number, an integer. it's the which one of it all.
π OUTPUT PARAMETERS π
keyβ the key itself, as a string. the glow-up reveal. β¨ierrorβ Fortran only: error status, as an integer. she reports back fr fr.
π DESCRIPTION π
so MPI_Info_get_nthkey returns the nth defined key in info. that's it. that's the whole vibe.
the keys are numbered 0β¦N - 1, where N is whatever value MPI_Info_get_nkeys handed you. and β no cap β every single key between 0 and N - 1 is guaranteed to be defined. like, all of them. full roster. π
and here's the part bestie, the key detail: the number of a given key does not change as long as info is not modified with MPI_Info_set or MPI_Info_delete. so once you clock a key's number, she stays put. π«Ά
π ERRORS π
almost all MPI routines return an error value, okay? C routines give it back as the return result of the function, and Fortran routines put it in the last argument. classic.
before the error value is returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) is called. and 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. so it's not, like, orphaned β it's got a home. π
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 the initial error handler can be changed by:
- calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen using the World model, or - the
mpi_initial_errhandlerCLI argument tompiexec - 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 is called for MPI I/O functions and the MPI_ERRORS_ABORT error handler is called for all other MPI functions. crumbs of structure, honestly.
also, heads up bestie: 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 but she's honest.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. so versatile, so scary. π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_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
do it yourself, DIY queen. π οΈβ¨
note that MPI does not guarantee that an MPI program can continue past an error. so likeβ¦ that's a real caveat, not a vibe. π«
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_getMPI_Info_get_nkeysMPI_Info_get_valuelen
π§ Copyright π§
2003-2026, The Open MPI Community
and that's the whole page, bestie!! π this was written for Open MPI, and the page source says Sep 10, 2026 β so go forth, grab that nth key, and slay. MPI_INFO_GET_NTHKEY(3), out. ππ¦β
π¦ 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