next up previous contents
Next: Exercise/Example: Translate this Fortran Up: Sending and Receiving messages Previous: Sample Program using Library   Contents

MPI Basic Send/Receive

Thus the basic (blocking) send has become:
   MPI_Send( start, count, datatype, dest, tag,
                 comm )
and the receive:
   MPI_Recv(start, count, datatype, source, tag,
                 comm, status)
The source, tag, and count of the message actually received can be retrieved from status.
MPI_Status status;
MPI_Recv( ..., &status );
... status.MPI_TAG;
... status.MPI_SOURCE;
MPI_Get_count( &status, datatype, &count );
MPI_Get_count may be used to determine how much data of a particular type was received.

Two simple collective operations:

   MPI_Bcast(start, count, datatype, root, comm)
   MPI_Reduce(start, result, count, datatype,
              operation, root, comm)


Cem Ozdogan 2006-12-27