1 | Given the rank of the process returned by MPI_Comm_rank in a variable myrank, this routine gives a two element (for two dimensional topology) array (coords in example below) with the (i, j) coordinates of this process in the new cartesian communicator. |
2 | ierr = MPI_Cart_coords (MPI_COMM_WORLD, |
3 | myrank, ndim, coords); |
4 | coords[0] and coords[1] will be the i and j coordinates. |