integer North,South,East,West |
# These are the processor ranks of 4 nearest neighbors |
integer rowtype,coltype # the new derived types |
# Fortran stores elements in columns contiguously |
# (C has opposite convention!) |
call MPI_TYPE_CONTIGUOUS(NLOC, MPI_REAL, coltype, ierr) |
call MPI_TYPE_COMMIT(coltype,ierr) |
# rows (North and South) are not contiguous |
call MPI_TYPE_VECTOR(NLOC, 1, NLOC2, MPI_REAL, rowtype, ierr) |
call MPI_TYPE_COMMIT(rowtype,ierr) |
call MPI_SEND(array(2,2), 1, coltype, west,0,comm,ierr) |
call MPI_SEND(array(2,NLOC+1), 1, coltype, east,0,comm,ierr) |
call MPI_SEND(array(2,2), rowtype, north, 0,comm,ierr) |
call MPI_SEND(array(NLOC+1,2), 1, rowtype, south, 0,comm,ierr) |