High Performance Computing 1
Cart_create
•c This routine show how to determine the neighbors in
•c  a 2-d decomposition of the domain.
•c Assumes that MPI_Cart_create has already been called
•
• subroutine fnd2dnbrs( comm2d, $ nbrleft, nbrright, nbrtop,
•   &   nbrbottom )
• integer comm2d, nbrleft, nbrright, nbrtop, nbrbottom
•
• integer ierr
•
• call MPI_Cart_shift( comm2d, 0, 1, nbrleft, nbrright, ierr )
• call MPI_Cart_shift( comm2d, 1, 1, nbrbottom, nbrtop, ierr )
•
• return
• end
•
•
new communicator