Skip to content

Commit 959df10

Browse files
committed
ompi-codegen.patch from dalcinl
Signed-off-by: Howard Pritchard <[email protected]>
1 parent a97c98f commit 959df10

File tree

9 files changed

+31
-29
lines changed

9 files changed

+31
-29
lines changed

ompi/mpi/bindings/ompi_bindings/c.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def dump_header(self):
117117
self.dump()
118118

119119
self.define_all('MPI_Datatype', consts.PREDEFINED_DATATYPES)
120-
self.define_all('MPI_Op', consts.COLLECTIVE_OPERATIONS)
121120
self.define_all('MPI_Op', consts.RESERVED_OPS)
122121
self.define_all('MPI_Comm', consts.RESERVED_COMMUNICATORS)
123122
self.define_all('MPI_Errhandler', consts.RESERVED_ERRHANDLERS)
@@ -428,10 +427,11 @@ def generate_message_convert_fn_intern_to_abi(self):
428427
self.generic_convert_reverse(ConvertOMPIToStandard.MESSAGE, 'message', 'MPI_Message', consts.RESERVED_MESSAGES)
429428

430429
def generate_op_convert_fn(self):
431-
self.generic_convert(ConvertFuncs.OP, 'op', 'MPI_Op', consts.COLLECTIVE_OPERATIONS)
430+
self.generic_convert(ConvertFuncs.OP, 'op', 'MPI_Op', consts.RESERVED_OPS)
432431

433432
def generate_op_convert_fn_intern_to_abi(self):
434-
self.generic_convert_reverse(ConvertOMPIToStandard.OP, 'op', 'MPI_Op', consts.RESERVED_OPS)
433+
# Only need to convert MPI_OP_NULL (fist item in consts.RESERVED_OPS)
434+
self.generic_convert_reverse(ConvertOMPIToStandard.OP, 'op', 'MPI_Op', consts.RESERVED_OPS[:1])
435435

436436
def generate_session_convert_fn(self):
437437
self.generic_convert(ConvertFuncs.SESSION, 'session', 'MPI_Session', consts.RESERVED_SESSIONS)

ompi/mpi/bindings/ompi_bindings/consts.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@
217217
]
218218

219219
RESERVED_INFOS = [
220-
'MPI_INFO_ENV',
221220
'MPI_INFO_NULL',
221+
'MPI_INFO_ENV',
222222
]
223223

224224
RESERVED_FILES = [
@@ -227,6 +227,20 @@
227227

228228
RESERVED_OPS = [
229229
'MPI_OP_NULL',
230+
'MPI_MAX',
231+
'MPI_MIN',
232+
'MPI_SUM',
233+
'MPI_PROD',
234+
'MPI_MAXLOC',
235+
'MPI_MINLOC',
236+
'MPI_BAND',
237+
'MPI_BOR',
238+
'MPI_BXOR',
239+
'MPI_LAND',
240+
'MPI_LOR',
241+
'MPI_LXOR',
242+
'MPI_REPLACE',
243+
'MPI_NO_OP',
230244
]
231245

232246
RESERVED_MESSAGES = [
@@ -277,23 +291,6 @@
277291
'MPI_STATUS_IGNORE',
278292
]
279293

280-
COLLECTIVE_OPERATIONS = [
281-
'MPI_MAX',
282-
'MPI_MIN',
283-
'MPI_SUM',
284-
'MPI_PROD',
285-
'MPI_MAXLOC',
286-
'MPI_MINLOC',
287-
'MPI_BAND',
288-
'MPI_BOR',
289-
'MPI_BXOR',
290-
'MPI_LAND',
291-
'MPI_LOR',
292-
'MPI_LXOR',
293-
'MPI_REPLACE',
294-
'MPI_NO_OP',
295-
]
296-
297294
COMM_GROUP_COMPARE_VALS = [
298295
'MPI_IDENT',
299296
'MPI_CONGRUENT',

ompi/mpi/c/comm_disconnect.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "ompi/memchecker.h"
3232
#include "ompi/dpm/dpm.h"
3333

34-
PROTOTYPE ERROR_CLASS comm_disconnect(COMM_OUT comm)
34+
PROTOTYPE ERROR_CLASS comm_disconnect(COMM_INOUT comm)
3535
{
3636
int ret = MPI_SUCCESS;
3737

ompi/mpi/c/errhandler_free.c.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ PROTOTYPE ERROR_CLASS errhandler_free(ERRHANDLER_INOUT errhandler)
3636
*and* the reference count is 1 (meaning that this FREE would
3737
actually free the underlying intrinsic object). This is ugly
3838
but necessary -- see below. */
39-
if (NULL == errhandler ||
39+
if (NULL == errhandler || NULL == *errhandler ||
40+
MPI_ERRHANDLER_NULL == *errhandler ||
4041
(ompi_errhandler_is_intrinsic(*errhandler) &&
4142
1 == (*errhandler)->super.obj_reference_count)) {
4243
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ERRHANDLER,

ompi/mpi/c/group_free.c.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ PROTOTYPE ERROR_CLASS group_free(GROUP_INOUT group)
5050
if (MPI_PARAM_CHECK) {
5151
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
5252

53-
if ((NULL == group) ||
54-
(MPI_GROUP_NULL == *group) || (NULL == *group) ) {
53+
if (NULL == group || NULL == *group ||
54+
MPI_GROUP_NULL == *group) {
5555
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_GROUP,
5656
FUNC_NAME);
5757
}

ompi/mpi/c/info_free.c.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ PROTOTYPE ERROR_CLASS info_free(INFO_INOUT info)
5050
* fashion so that there are no dangling pointers.
5151
*/
5252
if (MPI_PARAM_CHECK) {
53-
if (NULL == info || MPI_INFO_NULL == *info ||
53+
if (NULL == info || NULL == *info ||
54+
MPI_INFO_NULL == *info || MPI_INFO_ENV == *info ||
5455
ompi_info_is_freed(*info)) {
5556
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_INFO,
5657
FUNC_NAME);

ompi/mpi/c/op_free.c.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ PROTOTYPE ERROR_CLASS op_free(OP_INOUT op)
3434

3535
if (MPI_PARAM_CHECK) {
3636
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
37-
if (NULL == op ||
37+
if (NULL == op || NULL == *op ||
38+
MPI_OP_NULL == *op ||
3839
ompi_op_is_intrinsic(*op)) {
3940
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_OP,
4041
FUNC_NAME);

ompi/mpi/c/type_free.c.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ PROTOTYPE ERROR_CLASS type_free(DATATYPE_INOUT type)
4040

4141
if( MPI_PARAM_CHECK ) {
4242
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
43-
if (NULL == type || NULL == *type || MPI_DATATYPE_NULL == *type ||
43+
if (NULL == type || NULL == *type ||
44+
MPI_DATATYPE_NULL == *type ||
4445
ompi_datatype_is_predefined(*type)) {
4546
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_TYPE,
4647
FUNC_NAME );

ompi/mpi/c/win_free.c.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ PROTOTYPE ERROR_CLASS win_free(WIN_INOUT win)
3535
if (MPI_PARAM_CHECK) {
3636
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
3737

38-
if (ompi_win_invalid(*win)) {
38+
if (NULL == win ||
39+
ompi_win_invalid(*win)) {
3940
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_WIN, FUNC_NAME);
4041
}
4142
}

0 commit comments

Comments
 (0)