|
- A send and receive are correctly matched if the typemaps of the specified datatypes, with the displacements ignored, match according to the usual matching rules for basic datatypes; that is, type matching does not depend on the layout of the datatype in memory.
- While a datatype may specify overlapping entries, use of such a datatype in a receive operation is erroneous.
- A received message does not need to fill the entire receive buffer. MPI defines two routines to help you handle this situation. The MPI_GET_COUNT routine returns the number of received elements of the datatype specified in the receive call. If you want to find out how many basic elements within this datatype were received, use the MPI_GET_ELEMENTS routine.
- C
int MPI_Get_count(MPI_Status *status,
MPI_Datatype datatype, int *count)
int MPI_Get_elements(MPI_Status *status,
MPI_Datatype datatype, int *count)
- FORTRAN
MPI_GET_COUNT(STATUS, DATATYPE, COUNT, MPIERROR)
MPI_GET_ELEMENTS(STATUS, DATATYPE, COUNT, MPIERROR)
INTEGER STATUS(MPI_STATUS_SIZE), DATATYPE, COUNT, MPIERROR
where MPI_Status is an input variable specifying the status of the receive operation.
|