In MPI calls, the compiler has assigned to a variable (often an array) in your program.

The first three parameters in MPI_Send and MPI_Recv calls are used to specify the buffer. Here are the fully-specified type signatures for these routines:

The parameters relevant to defining the data buffer are:

buf
The address where the data start. For example, the start of an array in your program. Note that the send buffer has the const modifier in C; this is a new feature in MPI-3 to indicate to the compiler (and programmer) that the MPI implementation should not be changing the message data stored in the buffer.
count
The number of elements (items) of data in the message. Note that this is elements, not bytes. This makes for portable code, since there is no need to worry about different representations of data types on different computers. The software implementation of MPI determines the number of bytes automatically (for the curious, this can be done using the sizeof operator in C or C_SIZEOF procedure in Fortran 2008). The count specified by the receive call should be equal to or greater than the count specified by the send. If more data is sent than storage is available in the receive buffer, an error will occur.
datatype
The type of data to be transmitted. For example, single precision floating-point data corresponds to the MPI_FLOAT datatype in C or the MPI_REAL datatype in Fortran. Technically, the datatype does not have to match for the pair of send and receive calls, but data size across types should match to avoid reading or writing memory incorrectly. For handling mixed types within a single message, the MPI_PACKED datatype can be used, though the preferred method is to use a derived datatype.
 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement