diff --git a/ompi/mpi/fortran/mpif-h/get_processor_name_f.c b/ompi/mpi/fortran/mpif-h/get_processor_name_f.c index 8773f8ee78..96c34b5f18 100644 --- a/ompi/mpi/fortran/mpif-h/get_processor_name_f.c +++ b/ompi/mpi/fortran/mpif-h/get_processor_name_f.c @@ -88,7 +88,7 @@ void ompi_get_processor_name_f(char *name, MPI_Fint *resultlen, MPI_Fint *ierr, OMPI_SINGLE_INT_2_FINT(resultlen); /* Use the full length of the Fortran string, not *resultlen. - See comment in ompi/mpi/f77/strings.c. */ + See comment in ompi/mpi/fortran/base/strings.c. */ if (OMPI_SUCCESS != (ret = ompi_fortran_string_c2f(c_name, name, name_len))) { ierr_c = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, ret, FUNC_NAME); diff --git a/ompi/mpi/fortran/mpif-h/op_create_f.c b/ompi/mpi/fortran/mpif-h/op_create_f.c index 3a2722ef8b..b192426028 100644 --- a/ompi/mpi/fortran/mpif-h/op_create_f.c +++ b/ompi/mpi/fortran/mpif-h/op_create_f.c @@ -70,8 +70,8 @@ void ompi_op_create_f(ompi_op_fortran_handler_fn_t* function, ompi_fortran_logic int c_ierr; MPI_Op c_op; - /* See the note in src/mpi/f77/prototypes_mpi.h about the use of - (void*) for function pointers in this function */ + /* See the note in src/mpi/fortran/mpif-h/prototypes_mpi.h about + the use of (void*) for function pointers in this function */ c_ierr = MPI_Op_create((MPI_User_function *) function, OMPI_LOGICAL_2_INT(*commute), diff --git a/ompi/mpi/fortran/mpif-h/test_f.c b/ompi/mpi/fortran/mpif-h/test_f.c index 13fa1e4724..a879d0de31 100644 --- a/ompi/mpi/fortran/mpif-h/test_f.c +++ b/ompi/mpi/fortran/mpif-h/test_f.c @@ -80,7 +80,10 @@ void ompi_test_f(MPI_Fint *request, ompi_fortran_logical_t *flag, OMPI_SINGLE_INT_2_LOGICAL(flag); - if (MPI_SUCCESS == c_ierr) { + /* Note that all Fortran compilers have logical FALSE == 0; we + just need to check for any nonzero value (because TRUE is not + always 1). */ + if (MPI_SUCCESS == c_ierr && *flag) { *request = OMPI_INT_2_FINT(c_req->req_f_to_c_index); if (!OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { MPI_Status_c2f(&c_status, status); diff --git a/ompi/mpi/fortran/mpif-h/testall_f.c b/ompi/mpi/fortran/mpif-h/testall_f.c index 3314a8c5c3..57ce86a8f4 100644 --- a/ompi/mpi/fortran/mpif-h/testall_f.c +++ b/ompi/mpi/fortran/mpif-h/testall_f.c @@ -96,9 +96,9 @@ void ompi_testall_f(MPI_Fint *count, MPI_Fint *array_of_requests, ompi_fortran_l if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); OMPI_SINGLE_INT_2_LOGICAL(flag); - /* - * All Fortran Compilers have FALSE == 0 -- we just need a TRUE value, i.e. *flag != 0 - */ + + /* All Fortran Compilers have FALSE == 0, so just check for any + nonzero value (because TRUE is not always == 1) */ if (MPI_SUCCESS == c_ierr && *flag) { for (i = 0; i < OMPI_FINT_2_INT(*count); ++i) { array_of_requests[i] = c_req[i]->req_f_to_c_index; diff --git a/ompi/mpi/fortran/mpif-h/testany_f.c b/ompi/mpi/fortran/mpif-h/testany_f.c index 0ae4237bdd..90e7b25ccb 100644 --- a/ompi/mpi/fortran/mpif-h/testany_f.c +++ b/ompi/mpi/fortran/mpif-h/testany_f.c @@ -100,7 +100,9 @@ void ompi_testany_f(MPI_Fint *count, MPI_Fint *array_of_requests, MPI_Fint *indx OMPI_SINGLE_INT_2_LOGICAL(flag); if (MPI_SUCCESS == c_ierr) { - /* Increment index by one for fortran conventions */ + /* Increment index by one for fortran conventions. Note that + all Fortran compilers have FALSE==0; we just need to check + for any nonzero value (because TRUE is not always 1) */ OMPI_SINGLE_INT_2_FINT(indx); if (*flag &&