Skip to content

Commit ec9c28f

Browse files
markalleawlauria
authored andcommitted
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 <awlauria@us.ibm.com>
1 parent f882930 commit ec9c28f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ompi/mpi/fortran/mpif-h/improbe_f.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void ompi_improbe_f(MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm,
9595

9696
if (MPI_SUCCESS == c_ierr) {
9797
OMPI_SINGLE_INT_2_LOGICAL(flag);
98-
if (OMPI_FORTRAN_VALUE_TRUE == *flag) {
98+
if (1 == OMPI_LOGICAL_2_INT(*flag)) {
9999
OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr)
100100
*message = PMPI_Message_c2f(c_message);
101101
}

0 commit comments

Comments
 (0)