Skip to content

Commit a5aa4fd

Browse files
committed
add MPI_ERR_ERRHANDLER error class
related to #12082 also some fixes. Like the MPI_Errors.3 wasn't getting installed. mpi4py - disable testing MPI_ERR_ERRHANDLER. We can re-enable this once we actually support MPI 4.1. Signed-off-by: Howard Pritchard <[email protected]>
1 parent cfb5505 commit a5aa4fd

15 files changed

+41
-19
lines changed

.github/workflows/ompi_mpi4py.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,27 @@ jobs:
113113
CFLAGS: "-O0"
114114

115115
- name: Test mpi4py (singleton)
116-
run: python test/main.py -v -x test_doc
116+
run: python test/main.py -v -x TestExcErrhandlerNull
117117
if: ${{ true }}
118118
timeout-minutes: 10
119119
- name: Test mpi4py (np=1)
120-
run: mpiexec -n 1 python test/main.py -v -x test_doc
120+
run: mpiexec -n 1 python test/main.py -v -x TestExcErrhandlerNull
121121
if: ${{ true }}
122122
timeout-minutes: 10
123123
- name: Test mpi4py (np=2)
124-
run: mpiexec -n 2 python test/main.py -v -f -x test_doc
124+
run: mpiexec -n 2 python test/main.py -v -f -x TestExcErrhandlerNull
125125
if: ${{ true }}
126126
timeout-minutes: 10
127127
- name: Test mpi4py (np=3)
128-
run: mpiexec -n 3 python test/main.py -v -f -x test_doc
128+
run: mpiexec -n 3 python test/main.py -v -f -x TestExcErrhandlerNull
129129
if: ${{ true }}
130130
timeout-minutes: 10
131131
- name: Test mpi4py (np=4)
132-
run: mpiexec -n 4 python test/main.py -v -f -x test_doc
132+
run: mpiexec -n 4 python test/main.py -v -f -x TestExcErrhandlerNull
133133
if: ${{ true }}
134134
timeout-minutes: 10
135135
- name: Test mpi4py (np=5)
136-
run: mpiexec -n 5 python test/main.py -v -f -x test_doc
136+
run: mpiexec -n 5 python test/main.py -v -f -x TestExcErrhandlerNull
137137
if: ${{ true }}
138138
timeout-minutes: 10
139139

@@ -151,7 +151,7 @@ jobs:
151151
echo LD_LIBRARY_PATH=/opt/ompi/lib >> $GITHUB_ENV
152152
153153
- name: Test mpi4py (singleton)
154-
run: python test/main.py -v -x test_doc
154+
run: python test/main.py -v -x TestExcErrhandlerNull
155155
if: ${{ true }}
156156
timeout-minutes: 10
157157

docs/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ OMPI_MAN3 = \
179179
MPI_Errhandler_set.3 \
180180
MPI_Error_class.3 \
181181
MPI_Error_string.3 \
182+
MPI_Errors.3 \
182183
MPI_Exscan.3 \
183184
MPI_Exscan_init.3 \
184185
MPI_Fetch_and_op.3 \

docs/man-openmpi/man3/MPI_Errors.3.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,14 @@ Standard error return classes for Open MPI:
343343
- 78
344344
- Invalid session
345345

346+
* - MPI_ERR_VALUE_TOO_LARGE
347+
- 79
348+
- Value is too large to store.
349+
350+
* - MPI_ERR_ERRHANDLER
351+
- 89
352+
- Invalid error handler handle.
353+
346354
* - MPI_ERR_LASTCODE
347355
- 93
348356
- Last error code.

ompi/errhandler/errcode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ static ompi_mpi_errcode_t ompi_err_revoked;
127127
#endif
128128
static ompi_mpi_errcode_t ompi_err_session;
129129
static ompi_mpi_errcode_t ompi_err_value_too_large;
130+
static ompi_mpi_errcode_t ompi_err_errhandler;
130131

131132
static void ompi_mpi_errcode_construct(ompi_mpi_errcode_t* errcode);
132133
static void ompi_mpi_errcode_destruct(ompi_mpi_errcode_t* errcode);
@@ -245,6 +246,7 @@ int ompi_mpi_errcode_init (void)
245246
#endif
246247
CONSTRUCT_ERRCODE( ompi_err_session, MPI_ERR_SESSION, "MPI_ERR_SESSION: Invalid session handle" );
247248
CONSTRUCT_ERRCODE( ompi_err_value_too_large, MPI_ERR_VALUE_TOO_LARGE, "MPI_ERR_VALUE_TOO_LARGE: Value is too large to store" );
249+
CONSTRUCT_ERRCODE( ompi_err_errhandler, MPI_ERR_ERRHANDLER, "MPI_ERR_ERRHANDLER: Invalid error handler handle" );
248250

249251
/* Per MPI-3 p353:27-32, MPI_LASTUSEDCODE must be >=
250252
MPI_ERR_LASTCODE. So just start it as == MPI_ERR_LASTCODE. */
@@ -362,6 +364,7 @@ int ompi_mpi_errcode_finalize (void)
362364
#endif
363365
OBJ_DESTRUCT(&ompi_err_session);
364366
OBJ_DESTRUCT(&ompi_err_value_too_large);
367+
OBJ_DESTRUCT(&ompi_err_errhandler);
365368
OBJ_DESTRUCT(&ompi_mpi_errcodes);
366369
ompi_mpi_errcode_lastpredefined = 0;
367370
opal_mutex_unlock(&errcode_lock);

ompi/include/mpi.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ enum {
752752
#define MPI_ERR_REVOKED 77
753753
#define MPI_ERR_SESSION 78
754754
#define MPI_ERR_VALUE_TOO_LARGE 79
755+
#define MPI_ERR_ERRHANDLER 80
755756

756757
/* Per MPI-3 p349 47, MPI_ERR_LASTCODE must be >= the last predefined
757758
MPI_ERR_<foo> code. Set the last code to allow some room for adding

ompi/include/mpif-values.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@
295295
'MPI_T_ERR_INVALID': 72,
296296
'MPI_ERR_SESSION': 78,
297297
'MPI_ERR_VALUE_TOO_LARGE': 79,
298+
'MPI_ERR_ERRHANDLER': 80,
298299
'MPI_ERR_LASTCODE': 92,
299300
'MPI_IDENT': 0,
300301
'MPI_CONGRUENT': 1,

ompi/mpi/c/comm_create_from_group.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ PROTOTYPE ERROR_CLASS comm_create_from_group (GROUP group, STRING tag, INFO info
5151
( OMPI_ERRHANDLER_TYPE_COMM != errhandler->eh_mpi_object_type &&
5252
OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) {
5353
return ompi_errhandler_invoke (NULL, MPI_COMM_NULL, OMPI_ERRHANDLER_TYPE_COMM,
54-
MPI_ERR_ARG,FUNC_NAME);
54+
MPI_ERR_ERRHANDLER,FUNC_NAME);
5555
}
5656

5757
if (NULL == tag) {

ompi/mpi/c/comm_set_errhandler.c.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights
1616
* reserved.
17-
* Copyright (c) 2024 Triad National Security, LLC. All rights
17+
* Copyright (c) 2024-2025 Triad National Security, LLC. All rights
1818
* reserved.
1919
* $COPYRIGHT$
2020
*
@@ -51,7 +51,7 @@ PROTOTYPE ERROR_CLASS comm_set_errhandler(COMM comm, ERRHANDLER errhandler)
5151
MPI_ERRHANDLER_NULL == errhandler ||
5252
( OMPI_ERRHANDLER_TYPE_COMM != errhandler->eh_mpi_object_type &&
5353
OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) {
54-
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG,
54+
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ERRHANDLER,
5555
FUNC_NAME);
5656
}
5757
}

ompi/mpi/c/errhandler_c2f.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ PROTOTYPE FINT errhandler_c2f(ERRHANDLER errhandler)
3535
if (MPI_PARAM_CHECK) {
3636
/* mapping an invalid handle to a null handle */
3737
if (NULL == errhandler) {
38-
return OMPI_INT_2_FINT(-1);
38+
return OMPI_INT_2_FINT(MPI_ERR_ERRHANDLER);
3939
}
4040
}
4141

ompi/mpi/c/errhandler_free.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PROTOTYPE ERROR_CLASS errhandler_free(ERRHANDLER_OUT errhandler)
3939
if (NULL == errhandler ||
4040
(ompi_errhandler_is_intrinsic(*errhandler) &&
4141
1 == (*errhandler)->super.obj_reference_count)) {
42-
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG,
42+
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ERRHANDLER,
4343
"MPI_Errhandler_free");
4444
}
4545
}

0 commit comments

Comments
 (0)