1 | Under the new MPI cartesian topology, there are two functions which convert between the logical process coordinates, such as [i,j] in our 2D topology, to the (possibly new) 1D topolgy rank number required by the send and receive functions. |
2 | MPI_CART_COORDS(comm2d, myrank, 2, coords) |
3 | Takes a processor number myrank, in a 2 dim communicator called comm2d, and returns the 2 element vector cooresponding to the [i,j] position of this processor in the new system. |
4 | MPI_CART_RANK(comm2d, [i,j], myrank) |
5 | Takes a 2 element int array with logical process coordinates i and j and returns a 1D processor rank in the variable myrank. |