mpi.cart.shift shifts the Cartesian topology in both manners, displacement
mpi.cart.shift(comm=3, direction, disp)
Communicator with Cartesian structure
Coordinate dimension of the shift
displacement (>0 for upwards or left shift, <0 for downwards or right shift)
mpi.cart.shift provides neighbor ranks from given direction and displacement.
The direction argument indicates the dimension of the shift. direction=1 means the first dim,
direction=2 means the second dim, etc. disp=1 or -1 provides immediate neighbor ranks and disp=2
or -2 provides neighbor's neighbor ranks. Negative ranks mean out of boundary. They correspond to
mpi.cart.shift returns a vector containing information regarding the
rank of the source process and rank of the destination process.
Alek Hunchak and Hao Yu
1 2 3 4 5