MPI_Group_translate_ranks(3)

NAME
MPI_Group_translate_ranks - Looks up the corresponding ranks in one group from another

SYNOPSIS
#include <mpi.h>
int MPI_Group_translate_ranks(MPI_Group g1, int n, int *r1, MPI_Group g2, int *r2);

#include <pmpi.h>
int PMPI_Group_translate_ranks(MPI_Group g1, int n, int *r1, MPI_Group g2, int *r2);

#include <mpi.h>
static void MPI::Group::Translate_ranks(const MPI::Group &g1, int n, const int *r1, const MPI::Group &g2, int *r2);

INCLUDE 'mpif.h'
MPI_GROUP_TRANSLATE_RANKS(g1, n, r1, g2, r2, ierr)
INTEGER g1, n, r1(*), g2, r2(*), ierr

INPUT PARAMETERS
g1  - group 1 (handle)
n   - size of rank arrays (integer)
r1  - ranks (array)
g1  - group 2 (handle)

OUTPUT PARAMETER
r2  - equivalent ranks in group 2 (array).

DESCRIPTION
The MPI_Group_translate_ranks() function is used to determine the corresponding ranks between two groups g1 and g2. An array of n ranks (r1) are looked up inside g1. The corresponding ranks within g2 are stored within the r2 array. If a rank does not exist in the other group, then MPI_UNDEFINED is stored within the array for that rank. Note that the groups must be valid (not MPI_GROUP_NULL). PMPI_Group_translate_ranks() is the profiling version of this function.

ERRORS
All MPI routines except for MPI_Wtime and MPI_Wtick return an error code. The the current MPI error handler is invoked if the return value is not MPI_SUCCESS. The default error handler aborts, but this may be changed with by using the MPI_Errhandler_set() function. The predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead. Note that MPI does not guarentee that an MPI program can continue past an error. In this implementation, all errors except MPI_ERR_INTERN or MPI_ERR_OTHER should always be recoverable. In C, the error code is passed as the return value. In FORTRAN, all functions have an parameter ierr which returns the error code. MPI C++ functions do not directly return an error code. However, C++ users may want to use the MPI::ERRORS_THROW_EXCEPTIONS handler. This will throw an MPI::Exception with the corresponding error code. To prevent exceptions from being raised from within C and Fortran code, they will see all error return values as MPI_ERR_PENDING when this handler is chosen. In this implementation, call MPI::throw_exception() to throw the correct exception if this occurs.
MPI_SUCCESS
    - No error;
MPI_ERR_PENDING
    - Pending exception;
MPI_ERR_GROUP
    - Invalid group;
MPI_ERR_ARG
    - Invalid input or output pointer;
MPI_ERR_RANK
    - Invalid rank.

SEE ALSO
MPI_Group_size(3), MPI_Group_rank(3)