diff --git a/.github/workflows/ompi_mpi4py.yaml b/.github/workflows/ompi_mpi4py.yaml index f84306a7657..0e9f675023e 100644 --- a/.github/workflows/ompi_mpi4py.yaml +++ b/.github/workflows/ompi_mpi4py.yaml @@ -113,27 +113,27 @@ jobs: CFLAGS: "-O0" - name: Test mpi4py (singleton) - run: python test/main.py -v -x test_doc + run: python test/main.py -v -x TestExcErrhandlerNull if: ${{ true }} timeout-minutes: 10 - name: Test mpi4py (np=1) - run: mpiexec -n 1 python test/main.py -v -x test_doc + run: mpiexec -n 1 python test/main.py -v -x TestExcErrhandlerNull if: ${{ true }} timeout-minutes: 10 - name: Test mpi4py (np=2) - run: mpiexec -n 2 python test/main.py -v -f -x test_doc + run: mpiexec -n 2 python test/main.py -v -f -x TestExcErrhandlerNull if: ${{ true }} timeout-minutes: 10 - name: Test mpi4py (np=3) - run: mpiexec -n 3 python test/main.py -v -f -x test_doc + run: mpiexec -n 3 python test/main.py -v -f -x TestExcErrhandlerNull if: ${{ true }} timeout-minutes: 10 - name: Test mpi4py (np=4) - run: mpiexec -n 4 python test/main.py -v -f -x test_doc + run: mpiexec -n 4 python test/main.py -v -f -x TestExcErrhandlerNull if: ${{ true }} timeout-minutes: 10 - name: Test mpi4py (np=5) - run: mpiexec -n 5 python test/main.py -v -f -x test_doc + run: mpiexec -n 5 python test/main.py -v -f -x TestExcErrhandlerNull if: ${{ true }} timeout-minutes: 10 @@ -151,7 +151,7 @@ jobs: echo LD_LIBRARY_PATH=/opt/ompi/lib >> $GITHUB_ENV - name: Test mpi4py (singleton) - run: python test/main.py -v -x test_doc + run: python test/main.py -v -x TestExcErrhandlerNull if: ${{ true }} timeout-minutes: 10 diff --git a/docs/Makefile.am b/docs/Makefile.am index f6993850939..7d5d315ea2b 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -179,6 +179,7 @@ OMPI_MAN3 = \ MPI_Errhandler_set.3 \ MPI_Error_class.3 \ MPI_Error_string.3 \ + MPI_Errors.3 \ MPI_Exscan.3 \ MPI_Exscan_init.3 \ MPI_Fetch_and_op.3 \ diff --git a/docs/man-openmpi/man3/MPI_Errors.3.rst b/docs/man-openmpi/man3/MPI_Errors.3.rst index bb8f99fcf97..539a7286844 100644 --- a/docs/man-openmpi/man3/MPI_Errors.3.rst +++ b/docs/man-openmpi/man3/MPI_Errors.3.rst @@ -343,6 +343,14 @@ Standard error return classes for Open MPI: - 78 - Invalid session + * - MPI_ERR_VALUE_TOO_LARGE + - 79 + - Value is too large to store. + + * - MPI_ERR_ERRHANDLER + - 89 + - Invalid error handler handle. + * - MPI_ERR_LASTCODE - 93 - Last error code. diff --git a/ompi/errhandler/errcode.c b/ompi/errhandler/errcode.c index 63b55be9fea..ea3fc8c2ab9 100644 --- a/ompi/errhandler/errcode.c +++ b/ompi/errhandler/errcode.c @@ -127,6 +127,7 @@ static ompi_mpi_errcode_t ompi_err_revoked; #endif static ompi_mpi_errcode_t ompi_err_session; static ompi_mpi_errcode_t ompi_err_value_too_large; +static ompi_mpi_errcode_t ompi_err_errhandler; static void ompi_mpi_errcode_construct(ompi_mpi_errcode_t* errcode); static void ompi_mpi_errcode_destruct(ompi_mpi_errcode_t* errcode); @@ -245,6 +246,7 @@ int ompi_mpi_errcode_init (void) #endif CONSTRUCT_ERRCODE( ompi_err_session, MPI_ERR_SESSION, "MPI_ERR_SESSION: Invalid session handle" ); CONSTRUCT_ERRCODE( ompi_err_value_too_large, MPI_ERR_VALUE_TOO_LARGE, "MPI_ERR_VALUE_TOO_LARGE: Value is too large to store" ); + CONSTRUCT_ERRCODE( ompi_err_errhandler, MPI_ERR_ERRHANDLER, "MPI_ERR_ERRHANDLER: Invalid error handler handle" ); /* Per MPI-3 p353:27-32, MPI_LASTUSEDCODE must be >= MPI_ERR_LASTCODE. So just start it as == MPI_ERR_LASTCODE. */ @@ -362,6 +364,7 @@ int ompi_mpi_errcode_finalize (void) #endif OBJ_DESTRUCT(&ompi_err_session); OBJ_DESTRUCT(&ompi_err_value_too_large); + OBJ_DESTRUCT(&ompi_err_errhandler); OBJ_DESTRUCT(&ompi_mpi_errcodes); ompi_mpi_errcode_lastpredefined = 0; opal_mutex_unlock(&errcode_lock); diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index e838fe66061..02a03a651eb 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -752,6 +752,7 @@ enum { #define MPI_ERR_REVOKED 77 #define MPI_ERR_SESSION 78 #define MPI_ERR_VALUE_TOO_LARGE 79 +#define MPI_ERR_ERRHANDLER 80 /* Per MPI-3 p349 47, MPI_ERR_LASTCODE must be >= the last predefined MPI_ERR_ code. Set the last code to allow some room for adding diff --git a/ompi/include/mpif-values.py b/ompi/include/mpif-values.py index f4537762a79..f871a2b4b65 100755 --- a/ompi/include/mpif-values.py +++ b/ompi/include/mpif-values.py @@ -295,6 +295,7 @@ 'MPI_T_ERR_INVALID': 72, 'MPI_ERR_SESSION': 78, 'MPI_ERR_VALUE_TOO_LARGE': 79, + 'MPI_ERR_ERRHANDLER': 80, 'MPI_ERR_LASTCODE': 92, 'MPI_IDENT': 0, 'MPI_CONGRUENT': 1, diff --git a/ompi/mpi/c/comm_create_from_group.c.in b/ompi/mpi/c/comm_create_from_group.c.in index 26e4049fac5..3b36446af40 100644 --- a/ompi/mpi/c/comm_create_from_group.c.in +++ b/ompi/mpi/c/comm_create_from_group.c.in @@ -51,7 +51,7 @@ PROTOTYPE ERROR_CLASS comm_create_from_group (GROUP group, STRING tag, INFO info ( OMPI_ERRHANDLER_TYPE_COMM != errhandler->eh_mpi_object_type && OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) { return ompi_errhandler_invoke (NULL, MPI_COMM_NULL, OMPI_ERRHANDLER_TYPE_COMM, - MPI_ERR_ARG,FUNC_NAME); + MPI_ERR_ERRHANDLER,FUNC_NAME); } if (NULL == tag) { diff --git a/ompi/mpi/c/comm_set_errhandler.c.in b/ompi/mpi/c/comm_set_errhandler.c.in index 9cfabe8e856..4355d23c833 100644 --- a/ompi/mpi/c/comm_set_errhandler.c.in +++ b/ompi/mpi/c/comm_set_errhandler.c.in @@ -14,7 +14,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2024 Triad National Security, LLC. All rights + * Copyright (c) 2024-2025 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -51,7 +51,7 @@ PROTOTYPE ERROR_CLASS comm_set_errhandler(COMM comm, ERRHANDLER errhandler) MPI_ERRHANDLER_NULL == errhandler || ( OMPI_ERRHANDLER_TYPE_COMM != errhandler->eh_mpi_object_type && OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) { - return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ERRHANDLER, FUNC_NAME); } } diff --git a/ompi/mpi/c/errhandler_c2f.c.in b/ompi/mpi/c/errhandler_c2f.c.in index b563a49c333..e0f209510a0 100644 --- a/ompi/mpi/c/errhandler_c2f.c.in +++ b/ompi/mpi/c/errhandler_c2f.c.in @@ -35,7 +35,7 @@ PROTOTYPE FINT errhandler_c2f(ERRHANDLER errhandler) if (MPI_PARAM_CHECK) { /* mapping an invalid handle to a null handle */ if (NULL == errhandler) { - return OMPI_INT_2_FINT(-1); + return OMPI_INT_2_FINT(MPI_ERR_ERRHANDLER); } } diff --git a/ompi/mpi/c/errhandler_free.c.in b/ompi/mpi/c/errhandler_free.c.in index 8f888f1965e..6c9153de1d9 100644 --- a/ompi/mpi/c/errhandler_free.c.in +++ b/ompi/mpi/c/errhandler_free.c.in @@ -39,7 +39,7 @@ PROTOTYPE ERROR_CLASS errhandler_free(ERRHANDLER_OUT errhandler) if (NULL == errhandler || (ompi_errhandler_is_intrinsic(*errhandler) && 1 == (*errhandler)->super.obj_reference_count)) { - return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ERRHANDLER, "MPI_Errhandler_free"); } } diff --git a/ompi/mpi/c/file_set_errhandler.c.in b/ompi/mpi/c/file_set_errhandler.c.in index 12edd9c65b2..36d9508f206 100644 --- a/ompi/mpi/c/file_set_errhandler.c.in +++ b/ompi/mpi/c/file_set_errhandler.c.in @@ -51,7 +51,7 @@ PROTOTYPE ERROR_CLASS file_set_errhandler(FILE file, ERRHANDLER errhandler) MPI_ERRHANDLER_NULL == errhandler || (OMPI_ERRHANDLER_TYPE_FILE != errhandler->eh_mpi_object_type && OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) { - return OMPI_ERRHANDLER_INVOKE(file, MPI_ERR_ARG, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(file, MPI_ERR_ERRHANDLER, FUNC_NAME); } } diff --git a/ompi/mpi/c/intercomm_create_from_groups.c.in b/ompi/mpi/c/intercomm_create_from_groups.c.in index ac1b88f257c..aa868713cd8 100644 --- a/ompi/mpi/c/intercomm_create_from_groups.c.in +++ b/ompi/mpi/c/intercomm_create_from_groups.c.in @@ -55,7 +55,7 @@ PROTOTYPE ERROR_CLASS intercomm_create_from_groups (GROUP local_group, INT local ( OMPI_ERRHANDLER_TYPE_COMM != errhandler->eh_mpi_object_type && OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) { return ompi_errhandler_invoke (NULL, MPI_COMM_NULL, OMPI_ERRHANDLER_TYPE_COMM, - MPI_ERR_ARG,FUNC_NAME); + MPI_ERR_ERRHANDLER,FUNC_NAME); } diff --git a/ompi/mpi/c/session_init.c.in b/ompi/mpi/c/session_init.c.in index bcc71c7eeb4..e113f3b142c 100644 --- a/ompi/mpi/c/session_init.c.in +++ b/ompi/mpi/c/session_init.c.in @@ -25,12 +25,19 @@ PROTOTYPE ERROR_CLASS session_init (INFO info, ERRHANDLER errhandler, SESSION_OU const char ts_level_multi[] = "MPI_THREAD_MULTIPLE"; if ( MPI_PARAM_CHECK ) { - if (NULL == errhandler || NULL == session) { - return MPI_ERR_ARG; + if (NULL == errhandler) { + rc = MPI_ERR_ERRHANDLER; + goto fn_exit; + } + + if (NULL == session) { + rc = MPI_ERR_ARG; + goto fn_exit; } if (NULL == info || ompi_info_is_freed (info)) { - return MPI_ERR_INFO; + rc = MPI_ERR_INFO; + goto fn_exit; } } @@ -46,5 +53,6 @@ PROTOTYPE ERROR_CLASS session_init (INFO info, ERRHANDLER errhandler, SESSION_OU rc = ompi_mpi_instance_init (ts_level, &info->super, errhandler, session, 0, NULL); /* if an error occurred raise it on the null session */ +fn_exit: OMPI_ERRHANDLER_RETURN (rc, MPI_SESSION_NULL, rc, FUNC_NAME); } diff --git a/ompi/mpi/c/session_set_errhandler.c.in b/ompi/mpi/c/session_set_errhandler.c.in index a2ad8e36efe..1e500e90f90 100644 --- a/ompi/mpi/c/session_set_errhandler.c.in +++ b/ompi/mpi/c/session_set_errhandler.c.in @@ -43,7 +43,7 @@ PROTOTYPE ERROR_CLASS session_set_errhandler(SESSION session, ERRHANDLER errhand MPI_ERRHANDLER_NULL == errhandler || ( OMPI_ERRHANDLER_TYPE_INSTANCE != errhandler->eh_mpi_object_type && OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) { - return OMPI_ERRHANDLER_INVOKE(session, MPI_ERR_ARG, + return OMPI_ERRHANDLER_INVOKE(session, MPI_ERR_ERRHANDLER, FUNC_NAME); } } diff --git a/ompi/mpi/c/win_set_errhandler.c.in b/ompi/mpi/c/win_set_errhandler.c.in index 80a71e34aad..2442cc75502 100644 --- a/ompi/mpi/c/win_set_errhandler.c.in +++ b/ompi/mpi/c/win_set_errhandler.c.in @@ -46,7 +46,7 @@ PROTOTYPE ERROR_CLASS win_set_errhandler(WIN win, ERRHANDLER errhandler) MPI_ERRHANDLER_NULL == errhandler || (OMPI_ERRHANDLER_TYPE_WIN != errhandler->eh_mpi_object_type && OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) { - return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ERRHANDLER, FUNC_NAME); } }