From ec9c28f95b56e3880862bf146b8d1ac064a9fc4c Mon Sep 17 00:00:00 2001 From: Mark Allen Date: Wed, 25 Oct 2017 16:36:41 -0400 Subject: [PATCH] Fortran logical fix. I don't have a testcase for this, I just found the bug while inspecting OMPI's use of OMPI_FORTRAN_VALUE_TRUE. The following line: if (OMPI_FORTRAN_VALUE_TRUE == *flag) ... is okay in the model where users build a whole new OMPI depending on what fortran compiler they're using. But for a general purpose build, it requires OMPI_LOGICAL_2_INT(), which converts the incoming fortran-logical to 0 or 1 for C, eg if (1 == OMPI_LOGICAL_2_INT(*flag)) ... Signed-off-by: Austen Lauria --- ompi/mpi/fortran/mpif-h/improbe_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ompi/mpi/fortran/mpif-h/improbe_f.c b/ompi/mpi/fortran/mpif-h/improbe_f.c index 936cc4e399c..af5fa2b01fe 100644 --- a/ompi/mpi/fortran/mpif-h/improbe_f.c +++ b/ompi/mpi/fortran/mpif-h/improbe_f.c @@ -95,7 +95,7 @@ void ompi_improbe_f(MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, if (MPI_SUCCESS == c_ierr) { OMPI_SINGLE_INT_2_LOGICAL(flag); - if (OMPI_FORTRAN_VALUE_TRUE == *flag) { + if (1 == OMPI_LOGICAL_2_INT(*flag)) { OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr) *message = PMPI_Message_c2f(c_message); }