Choices, Choices, Choices
You really need to measure the costs of each to make the best decision
Rules of thumb:
- If the data is stored in consecutive entries of an array use the count and datatype parameters to the communication function
- If you are sending heterogeneous data only once or very few times use MPI_Pack() and MPI_Unpack()
- Otherwise pick the appropriate derived datatype constructor
- Homogeneous and regular intervals - MPI_Type_vector
- Homogeneous and irregular intervals - MPI_Type_indexed
- Heterogeneous - MPI_Type_struct