MPI_GROUP_TRANSLATE_RANKS(3)

πŸ’… MPI_GROUP_TRANSLATE_RANKS(3) πŸ’…

okay bestie, welcome to the Open MPI corner of the man pages β€” this one's MPI_Group_translate_ranks, and it's literally the rank-translation queen πŸ‘‘


✨ SYNOPSIS ✨

🌸 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. the OG group, the one you're translating from 🫢
  • n β€” how many ranks live in the ranks1 and ranks2 arrays (an integer, no cap fr)
  • ranks1 β€” an array of zero or more valid ranks in group1. yes, zero is allowed, she's flexible like that ✨
  • group2 β€” the second group, also a handle. the destination group, the glow-up group πŸ’…

🌈 OUTPUT PARAMETERS 🌈

  • ranks2 β€” the array of corresponding ranks over in group2, and it's set to MPI_UNDEFINED whenever no correspondence exists (aka when a rank in group1 has no matching buddy in group2 😭)
  • ierror β€” Fortran only, bestie: the error status (integer)

πŸ‘‘ DESCRIPTION πŸ‘‘

so this function is important β€” like, main character energy β€” because it's how you figure out the relative numbering of the same processes across two different groups. ngl, this is the whole point.

for instance: if you know the ranks of certain processes in the group of MPI_COMM_WORLD, you might want to know what their ranks are in a subset of that group. that's it, that's the vibe. translate the rank, get the answer, slay πŸ”₯


πŸ’€ ERRORS πŸ’€

okay so almost all MPI routines return an error value β€” C routines hand it back as the function's return result, and Fortran routines tuck it into the last argument. periodt.

before that error value gets returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) is called. and if there's no communication object associated with the MPI call, then the call counts as 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. 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. iykyk 😌

Open MPI includes three predefined error handlers that can be used:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes πŸ’€ like, everyone. gone.
  • 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.
  • MPI_ERRORS_RETURN β€” returns an error code to the application 🫢

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
⚠️ heads up bestie: note that MPI does not guarantee that an MPI program can continue past an error. like, do not assume you can just walk it off 😭

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.


2003-2026, The Open MPI Community


and that's the whole page, bestie πŸ’œ this was MPI_GROUP_TRANSLATE_RANKS(3) from Open MPI, dated Sep 11, 2026 β€” the copyright belongs to 2003-2026, The Open MPI Community, and honestly? iconic of them. go translate some ranks, you've got this βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from