next up previous contents
Next: MPI_Recv Up: MPI - Message Passing Previous: MPI_Wtime   Contents

MPI_Send

Sending data to another processes is definitely a basic operation that should be supported, and hence, the following synopsis is used:

int MPI_Send( void buf*, int count, MPI_Datatype datatype, int dest, 
          int tag, MPI_Comm comm);
   *buf:     initial address of the send buffer
   count:    number of elements to be sent (nonnegative integer)
   datatype: datatype to be sent (e.g. MPI_INT, MPI_DOUBLE, etc.)
   dest:     rank or processor number of the destination
   tag:      message tag, to identify the content of message (integer)
   comm:     MPI Communicator handle

In C programming language, the input parameter buf* is explicitly allocated my calling malloc function to allocate needed memory space and sending and receiving fixed size blocks.

By using the tag input parameter, we can distinguish the nature or purpose of the message sent so that the receiving side can expect to receive what the programmer intends to send and receive. Also, this routine can support multiple sends without confusing the recepient process which message is intended for what purpose.

The return value of this routine indicates success (or otherwise) of the routine. If it should return an error, it will return corresponding values for where the error came from.

This routine blocks the progress in the program until it is confirmed that all the data has been received. That means that the data has been buffered in the receive buffer in the destination process. It does not neccesarily mean that the destination process has to expect to receive that particular data by calling on MPI_Recv routine, which is discuss in the next section.


next up previous contents
Next: MPI_Recv Up: MPI - Message Passing Previous: MPI_Wtime   Contents
J S 2002-08-14