next up previous
Next: General redistributions Up: Redistribution of block-cyclic data Previous: Detailed communication code

Communication using send/receive


Communicating the Data 3

  integer source, dest, soffset, roffset
  integer status(MPI_STATUS_SIZE), istep

  do istep=0,k-1
     source  = get_source (istep, p, m, k, myrank)
     dest    = get_dest (istep, p, m, k, myrank)
     soffset = get_soffset (p, r, k, myrank, dest)
     roffset = get_roffset (p, r, k, myrank, source)
     call mpi_sendrecv (a(soffset), nsuperblks, newtype,
                        dest, tag, b(roffset), nsuperblks, 
                        newtype, source, tag,
                        comm, status, ierr)
  end do



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