MPI defines a number of basic types, which one can use directly:
|
MPI datatype |
C equivalent |
|
MPI_SHORT |
short int |
|
MPI_INT |
int |
|
MPI_LONG |
long int |
|
MPI_LONG_LONG |
long long int |
|
MPI_UNSIGNED_CHAR |
unsigned char |
|
MPI_UNSIGNED_SHORT |
unsigned short int |
|
MPI_UNSIGNED |
unsigned int |
|
MPI_UNSIGNED_LONG |
unsigned long int |
|
MPI_UNSIGNED_LONG_LONG |
unsigned long long int |
|
MPI_FLOAT |
float |
|
MPI_DOUBLE |
double |
|
MPI_LONG_DOUBLE |
long double |
|
MPI_BYTE |
char |
MPI guarantees that when using these types, the receiving side will always get the message data in the format it expects, regardless of endianness and other platform-related issues.