Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 58527c9

Browse files
committed
ompi/win: add internal support for returning same_size and same_disp_unit info keys
master commit open-mpi/ompi@b8356da :bot:assign: @jsquyres closes open-mpi/ompi#814 Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 2f2696a commit 58527c9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ompi/mpi/c/win_get_info.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727

2828
static const char FUNC_NAME[] = "MPI_Win_get_info";
2929

30+
static void _win_info_set (ompi_info_t *info, const char *key, int set)
31+
{
32+
ompi_info_set (info, key, set ? "true" : "false");
33+
}
3034

3135
int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used)
3236
{
@@ -50,11 +54,10 @@ int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used)
5054

5155
if (OMPI_SUCCESS == ret && *info_used) {
5256
/* set standard info keys based on what the OSC module is using */
53-
if (win->w_flags & OMPI_WIN_NO_LOCKS) {
54-
ompi_info_set (*info_used, "no_locks", "true");
55-
} else {
56-
ompi_info_set (*info_used, "no_locks", "false");
57-
}
57+
58+
_win_info_set (*info_used, "no_locks", win->w_flags & OMPI_WIN_NO_LOCKS);
59+
_win_info_set (*info_used, "same_size", win->w_flags & OMPI_WIN_SAME_SIZE);
60+
_win_info_set (*info_used, "same_disp_unit", win->w_flags & OMPI_WIN_SAME_DISP);
5861
}
5962

6063
OMPI_ERRHANDLER_RETURN(ret, win, ret, FUNC_NAME);

ompi/win/win.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ BEGIN_C_DECLS
4141
#define OMPI_WIN_FREED 0x00000001
4242
#define OMPI_WIN_INVALID 0x00000002
4343
#define OMPI_WIN_NO_LOCKS 0x00000004
44+
#define OMPI_WIN_SAME_DISP 0x00000008
45+
#define OMPI_WIN_SAME_SIZE 0x00000010
4446

4547
OMPI_DECLSPEC extern opal_pointer_array_t ompi_mpi_windows;
4648

0 commit comments

Comments
 (0)