MPI_Cart_coords
MPI_Cart_coords finds the corresponding cartesian coordinates of a rank in a cartesian communicator.
Fortran Syntax
Subroutine MPI_Cart_coords(comm, rank, maxdims, coords, ierr)
C Syntax
int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords)
Example in Fortran
|
In the above example, a cartesian communicator is created first. Repeated applications of MPI_Cart_coords
for all process ranks (input) produce a correlation table of process ranks and their corresponding cartesian coordinates (output).
0,0 (0) | 0,1 (1) |
1,0 (2) | 1,1 (3) |
2,0 (4) | 2,1 (5) |
Here is the fortran code used to generate
the above table.
Note that:
- this routine is the reciprocal of
MPI_Cart_rank.