Noncontiguous operations are much like their contiguous counterparts, except that the buf, len pair is replaced by buf, count, datatype. The datatype is an struct MPIR_DATATYPE *, and the count (number of elements) replaces the len (number of bytes). The other arguments are unchanged. The routine names replace Contig with Datatype; thus, the general version of MPID_IrsendContig is MPID_IrsendDatatype.
In a heterogeneous system, all communication takes place
through the noncontiguous routines (because these are the only ones with the
struct MPIR_DATATYPE * needed for converting data formats). A typical
use of
these routines in the MPI implementation is something like
int MPI_Send( ... )
{
...
#if !defined(MPID_HAS_HETEROGENEOUS)
if (datatype->is_contig) {
MPID_SendContig( ... &error_code );
} else
#endif
{
MPID_SendDatatype( ... &error_code );
}
return error_code;
}