next up previous
Next: Code for caching operations Up: Redistribution of block-cyclic data Previous: Use of caching in

Skeleton code for caching


Skeleton Code

subroutine redistribute (a, b, m, r, k,
               datatype, comm, returnerr)
integer a(*), b(*)
integer m, r, k, datatype, comm, returnerr
logical flag
integer ierr, errcode, p, myrank
parameter (errcode=20)

call mpi_initialized (flag, ierr)
if (.not.flag) call mpi_abort (comm, errcode, ierr)
DO CACHING OPERATIONS
call mpi_comm_size (comm, p, ierr)
call mpi_comm_rank (comm, myrank, ierr)
CREATE DATATYPE newtype
COMMUNICATE DATA IN k STEPS

return
end



David W Walker
Mon Jan 20 11:10:22 GMT 1997