next up previous
Next: Code for creating the Up: Redistribution of block-cyclic data Previous: Skeleton code for caching

Code for caching operations


Caching Operations

integer redistkey, redistcomm, group, extra
logical useflag
data redistkey /MPI_KEYVAL_INVALID/
save redistkey

if (redistkey .eq. MPI_KEYVAL_INVALID) then
   call mpi_keyval_create (MPI_NULL_FN, MPI_NULL_FN,
                           redistkey, extra, ierr)
end if
call mpi_attr_get (comm, redistkey,
                   redistcomm, useflag, ierr)
if (.not.useflag) then
   call mpi_comm_dup (comm, redistcomm, ierr)
   call mpi_attr_put (comm, redistkey,
                      redistcomm, ierr)
end if



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