1 | MPI_Send sends the data stored in the buffer pointed by buf. This buffer consists of consecutive entries of the type specified by the parameter datatype. The number of entries in the buffer is given by the parameter count. |
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 |
2 | MPI_Recv receives a message sent by a process whose rank is given by the source in the communication domain specified by the comm argument.
The tag of the sent message must be that specified by the tag argument.
If there are many messages with identical tag from the same process, then any one of these messages is received.
MPI allows specification of wild card arguments for both source and tag.
|
typedef struct MPI_Status { int MPI_SOURCE; int MPI_TAG; int MPI_ERROR; };
int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count)
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. MPI programs must be able to run correctly regardless of which of the two methods is used for implementing MPI_Send. Such programs are called safe. In writing safe MPI programs, sometimes it is helpful to forget about the alternate implementation of MPI_Send and just think of it as being a blocking send operation. |