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