Attributes


Up: Selected Subsystems Next: Topologies Previous: Collective Operations

Attribute caching on communicators is implemented by using a height-balanced tree (HBT or AVL tree) [35]. Each communicator has an HBT associated with it, although initially the HBT may be an empty or null tree. Caching an attribute on a communicator is simply an insertion into the HBT; retrieving an attribute is simply searching the tree and returning the cached attribute.

MPI keyvals are created by passing the attribute's copy function and destructor as well as any extra_state needed to the keyval constructor. Pointers to these are kept in the keyval structure that is passed to attribute functions.

Additional elements of a keyval include a flag denoting whether C or Fortran calling conventions are to be used for the copy function (the attribute input argument to the copy function is passed by value in C and passed by reference in Fortran).

Caching on other types of MPI handles is being considered for inclusion in the MPI-2 standard. The MPICH HBT implementation of caching can be used almost exactly as is for implementing caching on other types of MPI handles by simply adding an HBT to the other types of handles.



Up: Selected Subsystems Next: Topologies Previous: Collective Operations