Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

MPI_CART_SHIFT and all neighbours

diedro
Beginner
759 Views

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
759 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

0 Kudos
Reply