•find neighbors
•call MPI_CART_GET(comm2d, 2, dims,
isperiodic, coords, ierr)
•myrank in comm2d
•call MPI_COMM_RANK(comm2d, myrank,
ierr)
•get coordinates of a process
•call MPI_CART_COORDS(comm2d, myrank,
2, coords,
ierr)
•find destination and source of shifting
•call MPI_CART_SHIFT(comm1d, 0, 1,
nbrottom, nbrtop,
ierr)
•
•