next up previous
Next: Unpacking integers and reals Up: Packing and unpacking messages Previous: Example of unpacking data

Code for unpacking data


Code for Unpacking Example

 call mpi_recv (message, size, MPI_PACKED,
                MPI_ANY_SOURCE, MPI_ANY_TAG,
                comm, status, ierr)
 pos = 0
 call mpi_unpack (message, size, pos, 
                  typeid, 1, MPI_INTEGER,
                  comm, ierr)
 do while (typeid .gt. 0)
    call mpi_unpack (message, size, pos, 
                     nitems, 1, MPI_INTEGER, 
                     comm, ierr)
    if (typeid .eq. 1) then
       UNPACK INTEGERS
    else
       UNPACK REALS
    end if
    call mpi_unpack (message, size, pos, 
                     typeid, 1, MPI_INTEGER,
                     comm, ierr)
 end do



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