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

Commit b672e5c

Browse files
committed
Merge pull request #517 from hjelmn/v2.x_window_updates
V2.x window updates
2 parents 2058f03 + 58527c9 commit b672e5c

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

ompi/errhandler/errcode-internal.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static ompi_errcode_intern_t ompi_err_rma_attach_intern;
5555
static ompi_errcode_intern_t ompi_err_rma_range_intern;
5656
static ompi_errcode_intern_t ompi_err_rma_conflict_intern;
5757
static ompi_errcode_intern_t ompi_err_win_intern;
58+
static ompi_errcode_intern_t ompi_err_rma_flavor_intern;
5859

5960
static void ompi_errcode_intern_construct(ompi_errcode_intern_t* errcode);
6061
static void ompi_errcode_intern_destruct(ompi_errcode_intern_t* errcode);
@@ -250,6 +251,14 @@ int ompi_errcode_intern_init (void)
250251
opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_win_intern.index,
251252
&ompi_err_win_intern);
252253

254+
OBJ_CONSTRUCT(&ompi_err_rma_flavor_intern, ompi_errcode_intern_t);
255+
ompi_err_rma_flavor_intern.code = OMPI_ERR_RMA_FLAVOR;
256+
ompi_err_rma_flavor_intern.mpi_code = MPI_ERR_RMA_FLAVOR;
257+
ompi_err_rma_flavor_intern.index = pos++;
258+
strncpy(ompi_err_rma_flavor_intern.errstring, "OMPI_ERR_RMA_FLAVOR", OMPI_MAX_ERROR_STRING);
259+
opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_rma_flavor_intern.index,
260+
&ompi_err_rma_flavor_intern);
261+
253262
ompi_errcode_intern_lastused=pos;
254263
return OMPI_SUCCESS;
255264
}
@@ -279,6 +288,7 @@ int ompi_errcode_intern_finalize(void)
279288
OBJ_DESTRUCT(&ompi_err_rma_range_intern);
280289
OBJ_DESTRUCT(&ompi_err_rma_conflict_intern);
281290
OBJ_DESTRUCT(&ompi_err_win_intern);
291+
OBJ_DESTRUCT(&ompi_err_rma_flavor_intern);
282292

283293
OBJ_DESTRUCT(&ompi_errcodes_intern);
284294
return OMPI_SUCCESS;

ompi/include/ompi/constants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ enum {
7171
OMPI_ERR_RMA_RANGE = OMPI_ERR_BASE - 5,
7272
OMPI_ERR_RMA_CONFLICT = OMPI_ERR_BASE - 6,
7373
OMPI_ERR_WIN = OMPI_ERR_BASE - 7,
74+
OMPI_ERR_RMA_FLAVOR = OMPI_ERR_BASE - 8,
7475
};
7576

7677
#define OMPI_ERR_MAX (OMPI_ERR_BASE - 100)

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)