The following attributes are cached with a window when the window is created.
In C, calls such as
MPI_Win_get_attr(win, MPI_WIN_BASE, &base, &flag),
MPI_Win_get_attr(win, MPI_WIN_SIZE, &size,
&flag),
MPI_Win_get_attr(win, MPI_WIN_DISP_UNIT, &disp_unit,
&flag),
MPI_Win_get_attr(win, MPI_WIN_CREATE_FLAVOR, &create_flavor, &flag), and
MPI_Win_get_attr(win, MPI_WIN_MODEL, &memory_model, &flag)
will return in base a pointer to the start of the window
win and in size,
disp_unit, create_kind, and memory_model
pointers to the size of the window, the displacement unit of the
window, the flavor of the window, and the memory model of the window,
respectively.
A detailed listing of the type of the pointer in the attribute value
argument to MPI_WIN_GET_ATTR and
MPI_WIN_SET_ATTR is shown in
Table 10.
Table 10: C types of attribute value argument to
MPI_WIN_GET_ATTR and MPI_WIN_SET_ATTR
Attribute | C Type |
MPI_WIN_BASE | void * |
MPI_WIN_SIZE | MPI_Aint * |
MPI_WIN_DISP_UNIT | int * |
MPI_WIN_CREATE_FLAVOR | int * |
MPI_WIN_MODEL | int * |
The values of create_kind are
The values of memory_model are MPI_WIN_SEPARATE and MPI_WIN_UNIFIED. The meaning of these is described in Section Memory Model.
In the case of windows created with MPI_WIN_CREATE_DYNAMIC, the base address is MPI_BOTTOM and the size is 0. In C, pointers are returned, and in Fortran, the values are returned, for the respective attributes. (The window attribute access functions are defined in Section Windows.) The value returned for an attribute on a window is constant over the lifetime of the window.
The other ``window attribute,'' namely the group of MPI processes attached to the window, can be retrieved using the call below.
MPI_WIN_GET_GROUP(win, group) | |
IN win | window object (handle) |
OUT group | group of MPI processes that share access to the window (handle) |
MPI_WIN_GET_GROUP returns in group a duplicate of the group of the communicator used to create the window associated with win.