MPI_GROUP_TRANSLATE_RANKS(3)
π MPI_GROUP_TRANSLATE_RANKS β Open MPI, bestie edition β¨
okay so listen, this is MPI_GROUP_TRANSLATE_RANKS(3) from the Open MPI manual, and it does exactly one gorgeous thing: it translates the ranks of processes in one group to those in another group. that's it. that's the whole girl. π
β¨ SYNTAX β¨
πΈ C Syntax
#include <mpi.h>
int MPI_Group_translate_ranks(MPI_Group group1, int n,
const int ranks1[], MPI_Group group2, int ranks2[])
πΈ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_GROUP_TRANSLATE_RANKS(GROUP1, N, RANKS1, GROUP2, RANKS2,
IERROR)
INTEGER GROUP1, N, RANKS1(*), GROUP2, RANKS2(*), IERROR
πΈ Fortran 2008 Syntax
USE mpi_f08
MPI_Group_translate_ranks(group1, n, ranks1, group2, ranks2, ierror)
TYPE(MPI_Group), INTENT(IN) :: group1, group2
INTEGER, INTENT(IN) :: n, ranks1(n)
INTEGER, INTENT(OUT) :: ranks2(n)
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETERS π
group1β the first group, as a handle. your home base, your origin story πnβ how many ranks live in theranks1andranks2arrays (integer, bestie).ranks1β array of zero or more valid ranks ingroup1. zero! yes! an empty array is valid, she contains multitudes β¨group2β the second group, also a handle. your destination, your glow-up π¦
π«Ά OUTPUT PARAMETERS π«Ά
ranks2β array of corresponding ranks ingroup2, and it'sMPI_UNDEFINEDwhen no correspondence exists. so if a process fromgroup1simply is not ingroup2? she'sMPI_UNDEFINED. not lost, just unmatched πierrorβ Fortran only: the error status (integer).
π DESCRIPTION π
okay so this function is important for figuring out the relative numbering of the same processes across two different groups. it's giving translator, it's giving "who are you in this other friend group" energy.
for instance β and this is the example straight from the source, no cap β if you know the ranks of certain processes in the group of MPI_COMM_WORLD, you might want to know their ranks in a subset of that group. same girlies, different group chat. periodt. π
π ERRORS π
almost all MPI routines return an error value. C routines hand it back as the return result of the function, and Fortran routines drop it in the last argument. iykyk.
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. and when MPI_COMM_SELF is not initialized β meaning 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 by the mpi_initial_errhandler CLI argument to mpiexec, or 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. drama, but make it specified π
Open MPI ships three predefined error handlers you can absolutely use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. she said everyone is coming with her π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. context-aware queen πMPI_ERRORS_RETURNβ returns an error code to the application. polite. respectful. hands you the receipt π§Ύ
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, at all. plan accordingly, gorgeous.
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, it's good for you π
π Copyright
2003-2026, The Open MPI Community
and that's the whole page, bestie!! π¦ it's MPI_GROUP_TRANSLATE_RANKS(3) from Open MPI, dated Sep 10, 2026, and you now know her better than she knows herself. slay, go translate some ranks, and remember: MPI_UNDEFINED is a valid answer, not a personal failure. πβ¨
π¦ 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