8.7. Caching

PreviousUpNext
Up: Groups, Contexts, Communicators, and Caching Next: Functionality Previous: Example 2: Three-Group ``Ring'''

MPI provides a ``caching'' facility that allows an application to attach arbitrary pieces of information, called attributes, to three kinds of MPI objects: communicators, windows, and datatypes. More precisely, the caching facility allows a portable library to do the following:


The caching capabilities, in some form, are required by built-in MPI routines such as collective communication and application topology. Defining an interface to these capabilities as part of the MPI standard is valuable because it permits routines like collective communication and application topologies to be implemented as portable code, and also because it makes MPI more extensible by allowing user-written routines to use standard MPI calling sequences.


Advice to users.

The communicator MPI_COMM_SELF is a suitable choice for posting MPI process-local attributes, via this attribute-caching mechanism. ( End of advice to users.)

Rationale.

In one extreme one can allow caching on all opaque handles. The other extreme is to only allow it on communicators. Caching has a cost associated with it and should only be allowed when it is clearly needed and the increased cost is modest. This is the reason that windows and datatypes were added but not other handles. ( End of rationale.)
One difficulty is the potential for size differences between Fortran integers and C pointers. For this reason, the Fortran versions of these routines use integers of kind MPI_ADDRESS_KIND.
Advice to implementors.

High-quality implementations should raise an error when a keyval that was created by a call to MPI_ XXX_CREATE_KEYVAL is used with an object of the wrong type with a call to MPI_YYY_GET_ATTR, MPI_YYY_SET_ATTR, MPI_YYY_DELETE_ATTR, or MPI_YYY_FREE_KEYVAL. To do so, it is necessary to maintain, with each keyval, information on the type of the associated user function. ( End of advice to implementors.)


PreviousUpNext
Up: Groups, Contexts, Communicators, and Caching Next: Functionality Previous: Example 2: Three-Group ``Ring'''


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023