Display Fortran version (interchange row and column for C) |
Integer nbrtop, nbrbottom, nbrleft, nbrright |
# These are processor ranks of 4 nearest neighbors ( top, bottom, left and right respectively) -- find from MPI_CART_SHIFT (see later) |
integer rowtype, coltype # The new derived types |
call MPI_TYPE_CONTIGUOUS(nxblock, MPI_REAL, coltype, ierr) |
call MPI_TYPE_COMMIT(coltype, ierr) |
call MPI_TYPE_VECTOR(nyblock, 1, nxblock+2, MPI_REAL, rowtype, ierr) |
call MPI_TYPE_COMMIT(rowtype, ierr) |
# Now Transmit from internal edges rows to guard rings on neighbors |
call MPI_SEND( u(1,1), 1, coltype, nbrleft, 0, comm, ierr) |
call MPI_SEND( u(1,nyblock), 1, coltype, nbrright, 0, comm, ierr) |
call MPI_SEND( u(1,1), 1, rowtype, nbtop, 0, comm, ierr) |
call MPI_SEND( u(nxblock,1), 1, rowtype, nbtop, 0, comm, ierr) |