next up previous index
Next: Collective Communication Up: Derived Data Types Previous: Pack and unpack

Exercises

Write a simple program, which builds a tree on an array of the following structures:

      {char, int, int}
The first int points to the location, i.e., an index value within the array, of the left branch and the second int points to the location, i.e., an index value within the array, of the right branch. The value stored at the node of the tree is going to be a character. A negative value, e.g., -1 stored in any of the int locations means NULL. Zero means the root of the tree.

Define the whole array as a single data type, i.e., a tree. Find the size and the extent of the tree.

Generate dynamically a new MPI type that corresponds to one of the branches of the tree, and send it across to a slave process.

Make both the master process and the slave process print the branch on stdout.

Are they identical?



Zdzislaw Meglicki
2001-02-26