Community
cancel
Showing results for 
Search instead for 
Did you mean: 
diedro
Beginner
34 Views

MPI_CART_SHIFT and all neighbours

Dear MPI users,

I have a question about MPI_CART_SHIFT. How can I now all the processor neighbours.

I have understood how to know the left,right, above and bellow processor:

   ! Find neighbors
   CALL MPI_CART_SHIFT(COMM_CART,0,1,source,RCPU,MPI%iErr)  ! x-dir, right
   CALL MPI_CART_SHIFT(COMM_CART,0,-1,source,LCPU,MPI%iErr) ! x-dir, left
   CALL MPI_CART_SHIFT(COMM_CART,1,1,source,TCPU,MPI%iErr)  ! y-dir, top
   CALL MPI_CART_SHIFT(COMM_CART,1,-1,source,BCPU,MPI%iErr) ! y-dir, bottom

How can I now the processor the right and at the same time above processor? To make me clear, the processor that share not the edge but the corner.

Thanks a lot

0 Kudos
1 Reply
diedro
Beginner
34 Views

Dear all,

I have understood. It is not possible to have "diagonal" shift, the only way is to use CALL MPI_CART_RANK

Thanks anyway

Reply