8.7.1. Functionality

PreviousUpNext
Up: Caching Next: Communicators Previous: Caching

Attributes can be attached to communicators, windows, and datatypes. Attributes are local to the MPI process and specific to the communicator to which they are attached. Attributes are not propagated by MPI from one communicator to another except when the communicator is duplicated using MPI_COMM_DUP, MPI_COMM_IDUP, MPI_COMM_DUP_WITH_INFO, and MPI_COMM_IDUP_WITH_INFO (and even then the application must give specific permission through callback functions for the attribute to be copied. Please refer to Section Communicator Constructors and Section Communicators for attributes propagation rules).


Advice to users.

Attributes in C are of type void*. Typically, such an attribute will be a pointer to a structure that contains further information, or a handle to an MPI object. In Fortran, attributes are of type INTEGER. Such attribute can be a handle to an MPI object, or just an integer-valued attribute. ( End of advice to users.)

Advice to implementors.

Attributes are scalar values, equal in size to, or larger than a C-language pointer. Attributes can always hold an MPI handle. ( End of advice to implementors.)
The caching interface defined here requires that attributes be stored by MPI opaquely within a communicator, window, or datatype. Accessor functions include the following:



Advice to implementors.

Caching and callback functions are only called synchronously, in response to explicit application requests. This avoids problems that result from repeated crossings between user and system space. (This synchronous calling rule is a general property of MPI.)

The choice of key values is under control of MPI. This allows MPI to optimize its implementation of attribute sets. It also avoids conflict between independent modules caching information on the same communicators.

A much smaller interface, consisting of just a callback facility, would allow the entire caching facility to be implemented by portable code. However, with the minimal callback interface, some form of table searching is implied by the need to handle arbitrary communicators. In contrast, the more complete interface defined here permits rapid access to attributes through the use of pointers in communicators (to find the attribute table) and cleverly chosen key values (to retrieve individual attributes). In light of the efficiency ``hit'' inherent in the minimal interface, the more complete interface defined here is seen to be superior. ( End of advice to implementors.)
MPI provides the following services related to caching. They are all MPI process local.


PreviousUpNext
Up: Caching Next: Communicators Previous: Caching


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