Purpose
Translates task coordinates into a task rank.
C synopsis
#include <mpi.h> MPI_Cart_rank(MPI_Comm comm,int *coords,int *rank);
C++ synopsis
#include mpi.h int MPI::Cartcomm::Get_cart_rank(const int coords[]) const;
FORTRAN synopsis
include 'mpif.h' or use mpi
MPI_CART_RANK(INTEGER COMM,INTEGER COORDS(*),INTEGER RANK,
INTEGER IERROR)
Parameters
Description
This subroutine translates cartesian task coordinates into a task rank.
For dimension i with periods(i) = true, if the coordinate coords(i) is out of range, that is, coords(i) < 0 or coords(i) >= dims(i), it is automatically shifted back to the interval 0 >= coords(i) < dims(i). Out-of-range coordinates are erroneous for non-periodic dimensions.
Notes
Task coordinates in a cartesian structure begin their numbering at 0. Row-major numbering is always used for the tasks in a cartesian structure.
Errors
Related information