Basic HTML version of Foils prepared 19 September 98

Foil 69 Use of Derived Types in Jacobi Iteration

From MPI Message Passing Interface Computational Science for Simulations -- Fall Semester 1998. by Geoffrey C. Fox, Nancy McCracken


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)



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 11 1999