diff --git a/src/mpi/f77/comm_set_errhandler_f.c b/src/mpi/f77/comm_set_errhandler_f.c index 91f043c26a..a1cf606b40 100644 --- a/src/mpi/f77/comm_set_errhandler_f.c +++ b/src/mpi/f77/comm_set_errhandler_f.c @@ -7,6 +7,7 @@ #include #include "mpi.h" +#include "errhandler/errhandler.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -56,4 +57,8 @@ void mpi_comm_set_errhandler_f(MPI_Fint *comm, MPI_Fint *errhandler, c_errhandler = MPI_Errhandler_f2c(*errhandler); *ierr = OMPI_INT_2_FINT(MPI_Comm_set_errhandler(c_comm, c_errhandler)); + if ( MPI_SUCCESS == *ierr && + OMPI_ERRHANDLER_TYPE_PREDEFINED != c_errhandler->eh_mpi_object_type ) { + c_errhandler->eh_fortran_function = true ; + } } diff --git a/src/mpi/f77/errhandler_set_f.c b/src/mpi/f77/errhandler_set_f.c index b804ed31c6..2bd18ace98 100644 --- a/src/mpi/f77/errhandler_set_f.c +++ b/src/mpi/f77/errhandler_set_f.c @@ -56,7 +56,8 @@ void mpi_errhandler_set_f(MPI_Fint *comm, MPI_Fint *errhandler, MPI_Fint *ierr) c_errhandler = MPI_Errhandler_f2c(*errhandler); *ierr = OMPI_INT_2_FINT(MPI_Errhandler_set(c_comm, c_errhandler)); - if (MPI_SUCCESS == *ierr) { + if (MPI_SUCCESS == *ierr && + OMPI_ERRHANDLER_TYPE_PREDEFINED != c_errhandler->eh_mpi_object_type ) { c_errhandler->eh_fortran_function = true; } } diff --git a/src/mpi/f77/file_set_errhandler_f.c b/src/mpi/f77/file_set_errhandler_f.c index 44bb902656..1b43899920 100644 --- a/src/mpi/f77/file_set_errhandler_f.c +++ b/src/mpi/f77/file_set_errhandler_f.c @@ -7,6 +7,7 @@ #include #include "mpi.h" +#include "errhandler/errhandler.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -53,4 +54,8 @@ void mpi_file_set_errhandler_f(MPI_Fint *fh, MPI_Fint *errhandler, MPI_Errhandler c_err = MPI_Errhandler_f2c(*errhandler); *ierr = OMPI_INT_2_FINT(MPI_File_set_errhandler(c_fh, c_err)); + if ( MPI_SUCCESS == *ierr && + OMPI_ERRHANDLER_TYPE_PREDEFINED != c_err->eh_mpi_object_type ) { + c_err->eh_fortran_function = true ; + } } diff --git a/src/mpi/f77/win_set_errhandler_f.c b/src/mpi/f77/win_set_errhandler_f.c index 8f47169c82..1204e77f03 100644 --- a/src/mpi/f77/win_set_errhandler_f.c +++ b/src/mpi/f77/win_set_errhandler_f.c @@ -7,6 +7,7 @@ #include #include "mpi.h" +#include "errhandler/errhandler.h" #include "mpi/f77/bindings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER @@ -53,4 +54,8 @@ void mpi_win_set_errhandler_f(MPI_Fint *win, MPI_Fint *errhandler, MPI_Errhandler c_err = MPI_Errhandler_f2c(*errhandler); *ierr = OMPI_INT_2_FINT(MPI_Win_set_errhandler(c_win, c_err)); + if ( MPI_SUCCESS == *ierr && + OMPI_ERRHANDLER_TYPE_PREDEFINED != c_err->eh_mpi_object_type ) { + c_err->eh_fortran_function = true ; + } }