MPIX_Nodecart_coords

Determines process coords in Cartesian topology given rank in group

Synopsis

int MPIX_Nodecart_coords(MPI_Comm comm, int rank, int maxdims, int coords[])

Input Parameters

comm
communicator with Cartesian structure (handle)
rank
rank of a process within group of comm (integer)
maxdims
length of vector coords in the calling program (integer)

Output Parameters

coords
integer array (of size ndims) containing the Cartesian coordinates of specified process (integer)
*/ int MPIX_Nodecart_coords(MPI_Comm comm, int rank, int maxdims, int coords[]) { int flag; nodecart_t *ninfo;

MPI_Comm_get_attr(comm, nodecartKeyval, &ninfo, &flag); if (!ninfo || !flag) { fprintf(stderr, "Unable to access attribute on comm\n"); fflush(stderr); MPI_Abort(MPI_COMM_WORLD, 1 ); }

rankToCoords(ninfo->ndim, ninfo->dims, rank, coords);

return MPI_SUCCESS; }

/*@ MPIX_Nodecart_rank - Determines process rank in communicator given Cartesian location

Input Parameters

comm
communicator with Cartesian structure (handle)
coords
integer array (of size ndims, the number of dimensions of the Cartesian topology associated with comm) specifying the Cartesian coordinates of a process

Output Parameters

rank
rank of specified process (integer)

Notes

Out-of-range coordinates are erroneous for non-periodic dimensions.