13.2.6. Window Attributes



Up: Initialization
Next: Window Info
Previous: Window Destruction
The following attributes are cached with a
window when the
window is created.
MPI_WIN_BASE | window base address. |
MPI_WIN_SIZE | window size, in bytes. |
MPI_WIN_DISP_UNIT | displacement unit associated with the
window. |
MPI_WIN_CREATE_FLAVOR | how the window was
created. |
MPI_WIN_MODEL | memory model for window. |
| |
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_flavor, 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 * |
|
In Fortran, calls such as
MPI_WIN_GET_ATTR(win, MPI_WIN_BASE, base, flag, ierror),
MPI_WIN_GET_ATTR(win, MPI_WIN_SIZE, size, flag, ierror),
MPI_WIN_GET_ATTR(win, MPI_WIN_DISP_UNIT, disp_unit,
flag, ierror),
MPI_WIN_GET_ATTR(win, MPI_WIN_CREATE_FLAVOR, create_flavor, flag,
ierror), and
MPI_WIN_GET_ATTR(win, MPI_WIN_MODEL, memory_model, flag,
ierror)
will return in base, size, disp_unit, create_flavor, and memory_model the
(integer representation of) the base address of the window, the
size of the window, the displacement unit of the window,
the flavor of the window, and the memory model of the window,
respectively.
The values of create_flavor are
MPI_WIN_FLAVOR_CREATE | Window was created with MPI_WIN_CREATE. |
MPI_WIN_FLAVOR_ALLOCATE | Window was created with MPI_WIN_ALLOCATE. |
MPI_WIN_FLAVOR_DYNAMIC | Window was created with MPI_WIN_CREATE_DYNAMIC. |
MPI_WIN_FLAVOR_SHARED | Window was created with MPI_WIN_ALLOCATE_SHARED. |
| |
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) |
C binding
int MPI_Win_get_group(MPI_Win win, MPI_Group *group)
Fortran 2008 binding
MPI_Win_get_group(win, group, ierror)
TYPE(MPI_Win), INTENT(IN) :: win
TYPE(MPI_Group), INTENT(OUT) :: group
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_WIN_GET_GROUP(WIN, GROUP, IERROR)
INTEGER WIN, GROUP, IERROR
MPI_WIN_GET_GROUP returns in group
a duplicate of the group
of the communicator used to create the window
associated with win.



Up: Initialization
Next: Window Info
Previous: Window Destruction
Return to MPI-5.0 Standard Index
Return to MPI Forum Home Page
(Unofficial) MPI-5.0 of June 9, 2025
HTML Generated on March 2, 2025