Derived Data Types

1. Goals

The goal of this material is to introduce you to the concept of MPI derived datatypes. After completing this material, you should know what derived datatypes are, and why, how, and when to use them. By trying the C or FORTRAN exercises, you will also gain hands-on experience. Check out the references included at the end of this material to learn even more about derived datatypes.

Constructing derived datatypes is mainly a case of going through each of the arguments to the routine you want to use and putting in the appropriate values. People often enter into the study of derived datatypes thinking they are very complicated, but after trying them, find them fairly straightforward.

As a prerequisite for this material, you should be familiar with the material in the Basics of MPI Programming, and have knowledge of MPI's basic data types.

WARNING

MPI-2 introduces several new functions for use in constructing derived datatypes. They are not described in this module. The descriptions in this module conform to MPI-1. Code that uses these functions should work in any MPI implementation that conforms to either version of the standard because backward compatibility is required. However, MPI-2 deprecates use of the functions that have been replaced, so anyone who is writing code that will be used only with implementations of the MPI-2 standard should use the new functions.