Skip to content

Commit 3dd9832

Browse files
committed
mpi-rma: embiggen second level mpi rma support infrastructure
The top level API files generated by the bindings generation code and the lower level OSC frameworks have been embiggened previously, but the middle layer within OMPI has not been till this patch. There's a present for the RMA WG in this commit in the form of a comment. Something for them to work on. Related to #13151 Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent 77728ef commit 3dd9832

File tree

5 files changed

+22
-56
lines changed

5 files changed

+22
-56
lines changed

ompi/mpi/c/win_allocate.c.in

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2017 IBM Corporation. All rights reserved.
16-
* Copyright (c) 2024 Triad National Security, LLC. All rights
16+
* Copyright (c) 2024-2025 Triad National Security, LLC. All rights
1717
* reserved.
1818
* $COPYRIGHT$
1919
*
@@ -67,22 +67,8 @@ PROTOTYPE ERROR_CLASS win_allocate(AINT size, DISP disp_unit, INFO info,
6767
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME);
6868
}
6969

70-
/*
71-
* TODO:BIGCOUNT remove this check once ompi-rma supports bigcount
72-
*/
73-
#if OMPI_BIGCOUNT_SRC
74-
OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(ret, disp_unit);
75-
if (OMPI_SUCCESS != ret) {
76-
*win = MPI_WIN_NULL;
77-
return OMPI_ERRHANDLER_INVOKE(comm, ret, FUNC_NAME);
78-
}
79-
#endif
80-
8170
/* create window and return */
82-
/*
83-
* TODO:BIGCOUNT remove (int) before disp_unit once ompi-rma supports bigcount
84-
*/
85-
ret = ompi_win_allocate((size_t)size, (int)disp_unit, &(info->super),
71+
ret = ompi_win_allocate((size_t)size, (ptrdiff_t)disp_unit, &(info->super),
8672
comm, baseptr, win);
8773
if (OMPI_SUCCESS != ret) {
8874
*win = MPI_WIN_NULL;

ompi/mpi/c/win_allocate_shared.c.in

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Copyright (c) 2015 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* Copyright (c) 2017 IBM Corporation. All rights reserved.
19-
* Copyright (c) 2024 Triad National Security, LLC. All rights
19+
* Copyright (c) 2024-2025 Triad National Security, LLC. All rights
2020
* reserved.
2121
* $COPYRIGHT$
2222
*
@@ -61,16 +61,6 @@ PROTOTYPE ERROR_CLASS win_allocate_shared(AINT size, DISP disp_unit, INFO info,
6161
} else if ( size < 0 ) {
6262
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_SIZE, FUNC_NAME);
6363
}
64-
/*
65-
* TODO:BIGCOUNT remove this check once ompi-rma supports bigcount
66-
*/
67-
#if OMPI_BIGCOUNT_SRC
68-
OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(ret, disp_unit);
69-
if (OMPI_SUCCESS != ret) {
70-
*win = MPI_WIN_NULL;
71-
return OMPI_ERRHANDLER_INVOKE(comm, ret, FUNC_NAME);
72-
}
73-
#endif
7464
}
7565

7666
/* communicator must be an intracommunicator */
@@ -79,10 +69,7 @@ PROTOTYPE ERROR_CLASS win_allocate_shared(AINT size, DISP disp_unit, INFO info,
7969
}
8070

8171
/* create window and return */
82-
/*
83-
* TODO:BIGCOUNT remove (int) from disp_unit once ompi-rma supports bigcount
84-
*/
85-
ret = ompi_win_allocate_shared((size_t)size, (int)disp_unit, &(info->super),
72+
ret = ompi_win_allocate_shared((size_t)size, (ptrdiff_t)disp_unit, &(info->super),
8673
comm, baseptr, win);
8774
if (OMPI_SUCCESS != ret) {
8875
*win = MPI_WIN_NULL;

ompi/mpi/c/win_create.c.in

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2017 IBM Corporation. All rights reserved.
16-
* Copyright (c) 2024 Triad National Security, LLC. All rights
16+
* Copyright (c) 2024-2025 Triad National Security, LLC. All rights
1717
* reserved.
1818
* $COPYRIGHT$
1919
*
@@ -60,28 +60,15 @@ PROTOTYPE ERROR_CLASS win_create(BUFFER_OUT base, AINT size, DISP disp_unit,
6060
} else if ( disp_unit <= 0 ) {
6161
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_DISP, FUNC_NAME);
6262
}
63-
/*
64-
* TODO:BIGCOUNT remove this check once ompi-rma supports bigcount
65-
*/
66-
#if OMPI_BIGCOUNT_SRC
67-
OMPI_CHECK_MPI_COUNT_INT_CONVERSION_OVERFLOW(ret, disp_unit);
68-
if (OMPI_SUCCESS != ret) {
69-
*win = MPI_WIN_NULL;
70-
return OMPI_ERRHANDLER_INVOKE(comm, ret, FUNC_NAME);
71-
}
72-
#endif
7363
}
7464

7565
/* communicator must be an intracommunicator */
7666
if (OMPI_COMM_IS_INTER(comm)) {
7767
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME);
7868
}
7969

80-
/*
81-
* TODO:BIGCOUNT remove (int) before disp_unit once ompi-rma supports bigcount
82-
*/
8370
/* create window and return */
84-
ret = ompi_win_create(base, (size_t)size, (int)disp_unit, comm,
71+
ret = ompi_win_create(base, (size_t)size, (ptrdiff_t)disp_unit, comm,
8572
&(info->super), win);
8673
if (OMPI_SUCCESS != ret) {
8774
*win = MPI_WIN_NULL;

ompi/win/win.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Copyright (c) 2015-2017 Research Organization for Information Science
1818
* and Technology (RIST). All rights reserved.
1919
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
20-
* Copyright (c) 2018-2019 Triad National Security, LLC. All rights
20+
* Copyright (c) 2018-2025 Triad National Security, LLC. All rights
2121
* reserved.
2222
* Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
2323
* $COPYRIGHT$
@@ -206,7 +206,7 @@ static int alloc_window(struct ompi_communicator_t *comm, opal_info_t *info, int
206206
}
207207

208208
static int
209-
config_window(void *base, size_t size, int disp_unit,
209+
config_window(void *base, size_t size, ptrdiff_t disp_unit,
210210
int flavor, int model, ompi_win_t *win)
211211
{
212212
int ret;
@@ -220,9 +220,15 @@ config_window(void *base, size_t size, int disp_unit,
220220
MPI_WIN_SIZE, size, true);
221221
if (OMPI_SUCCESS != ret) return ret;
222222

223+
/*
224+
* No this isn't really right but the MPI Forum RMA WG was spleeping during
225+
* Big count proposal reading and didn't put in something for Table 12.1 of the
226+
* MPI 5.0 standard for embiggened disp_unit, so here we go with int * in accordance
227+
* with that table.
228+
*/
223229
ret = ompi_attr_set_int(WIN_ATTR, win,
224230
&win->w_keyhash,
225-
MPI_WIN_DISP_UNIT, disp_unit,
231+
MPI_WIN_DISP_UNIT, (int)disp_unit,
226232
true);
227233
if (OMPI_SUCCESS != ret) return ret;
228234

@@ -244,7 +250,7 @@ config_window(void *base, size_t size, int disp_unit,
244250

245251
int
246252
ompi_win_create(void *base, size_t size,
247-
int disp_unit, ompi_communicator_t *comm,
253+
ptrdiff_t disp_unit, ompi_communicator_t *comm,
248254
opal_info_t *info,
249255
ompi_win_t** newwin)
250256
{
@@ -275,7 +281,7 @@ ompi_win_create(void *base, size_t size,
275281
}
276282

277283
int
278-
ompi_win_allocate(size_t size, int disp_unit, opal_info_t *info,
284+
ompi_win_allocate(size_t size, ptrdiff_t disp_unit, opal_info_t *info,
279285
ompi_communicator_t *comm, void *baseptr, ompi_win_t **newwin)
280286
{
281287
ompi_win_t *win;
@@ -307,7 +313,7 @@ ompi_win_allocate(size_t size, int disp_unit, opal_info_t *info,
307313
}
308314

309315
int
310-
ompi_win_allocate_shared(size_t size, int disp_unit, opal_info_t *info,
316+
ompi_win_allocate_shared(size_t size, ptrdiff_t disp_unit, opal_info_t *info,
311317
ompi_communicator_t *comm, void *baseptr, ompi_win_t **newwin)
312318
{
313319
ompi_win_t *win;

ompi/win/win.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
18-
* Copyright (c) 2018 Triad National Security, LLC. All rights
18+
* Copyright (c) 2018-2025 Triad National Security, LLC. All rights
1919
* reserved.
2020
* $COPYRIGHT$
2121
*
@@ -134,12 +134,12 @@ OMPI_DECLSPEC extern ompi_predefined_win_t *ompi_mpi_win_null_addr;
134134

135135
int ompi_win_init(void);
136136

137-
int ompi_win_create(void *base, size_t size, int disp_unit,
137+
int ompi_win_create(void *base, size_t size, ptrdiff_t disp_unit,
138138
ompi_communicator_t *comm, opal_info_t *info,
139139
ompi_win_t **newwin);
140-
int ompi_win_allocate(size_t size, int disp_unit, opal_info_t *info,
140+
int ompi_win_allocate(size_t size, ptrdiff_t disp_unit, opal_info_t *info,
141141
ompi_communicator_t *comm, void *baseptr, ompi_win_t **newwin);
142-
int ompi_win_allocate_shared(size_t size, int disp_unit, opal_info_t *info,
142+
int ompi_win_allocate_shared(size_t size, ptrdiff_t disp_unit, opal_info_t *info,
143143
ompi_communicator_t *comm, void *baseptr, ompi_win_t **newwin);
144144
int ompi_win_create_dynamic(opal_info_t *info, ompi_communicator_t *comm, ompi_win_t **newwin);
145145
int ompi_win_free(ompi_win_t *win);

0 commit comments

Comments
 (0)