13.2.6. Window Attributes

PreviousUpNext
Up: Initialization Next: Window Info Previous: Window Destruction

The following attributes are cached with a window when the window is created.

Image file

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 *
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_kind, 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_kind are

Image file

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 winwindow object (handle)
OUT groupgroup 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.


PreviousUpNext
Up: Initialization Next: Window Info Previous: Window Destruction


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