Sending and Receiving Messages


Table 5.2: Correspondence between the datatypes supported by MPI and those supported by C.
MPI Datatype C Datatype
MPI_CHAR signed char
MPI_SHORT signed short int
MPI_INT signed int
MPI_LONG signed long int
MPI_UNSIGNED_CHAR unsigned char
MPI_UNSIGNED_SHORT unsigned short int
MPI_UNSIGNED unsigned int
MPI_UNSIGNED_LONG unsigned long int
MPI_FLOAT float
MPI_DOUBLE double
MPI_LONG_DOUBLE long double
MPI_BYTE  
MPI_PACKED  

Note that for all C datatypes, an equivalent MPI datatype is provided.

 $&bull#bullet;$
The MPI_Recv returns only after the requested message has been received and copied into the buffer.
 $&bull#bullet;$
That is, MPI_Recv is a blocking receive operation.
 $&bull#bullet;$
However, MPI allows two different implementations for MPI_Send.
1
MPI_Send returns only after the corresponding MPI_Recv have been issued and the message has been sent to the receiver.
2
MPI_Send first copies the message into a buffer and then returns, without waiting for the corresponding MPI_Recv to be executed.
 $&bull#bullet;$
In either implementation, the buffer that is pointed by the buf argument of MPI_Send can be safely reused and overwritten.

Cem Ozdogan 2010-12-27