Commit a22df6f0 authored by William Gropp's avatar William Gropp
Browse files

[svn-r8164] Fixes for Fortran support of int not the same as MPI_Fint when --disable-cxx used

parent c73de10d
...@@ -366,9 +366,23 @@ int MPIR_Allreduce_intra ( ...@@ -366,9 +366,23 @@ int MPIR_Allreduce_intra (
datatype, datatype,
uop ); uop );
} }
else else {
#endif #endif
#if defined(HAVE_FORTRAN_BINDING) && !defined(HAVE_FINT_IS_INT)
if (is_f77_uop) {
MPI_Fint lcount = (MPI_Fint)count;
MPI_Fint ldtype = (MPI_Fint)datatype;
(*uop)(tmp_buf, recvbuf, &lcount, &ldtype);
}
else {
(*uop)(tmp_buf, recvbuf, &count, &datatype);
}
#else
(*uop)(tmp_buf, recvbuf, &count, &datatype); (*uop)(tmp_buf, recvbuf, &count, &datatype);
#endif
#ifdef HAVE_CXX_BINDING
}
#endif
/* change the rank */ /* change the rank */
newrank = rank / 2; newrank = rank / 2;
...@@ -422,9 +436,24 @@ int MPIR_Allreduce_intra ( ...@@ -422,9 +436,24 @@ int MPIR_Allreduce_intra (
datatype, datatype,
uop ); uop );
} }
else else {
#endif #endif
#if defined(HAVE_FORTRAN_BINDING) && !defined(HAVE_FINT_IS_INT)
if (is_f77_uop) {
MPI_Fint lcount = (MPI_Fint)count;
MPI_Fint ldtype = (MPI_Fint)datatype;
(*uop)(tmp_buf, recvbuf, &lcount, &ldtype);
}
else {
(*uop)(tmp_buf, recvbuf, &count, &datatype);
}
#else
(*uop)(tmp_buf, recvbuf, &count, &datatype); (*uop)(tmp_buf, recvbuf, &count, &datatype);
#endif
#ifdef HAVE_CXX_BINDING
}
#endif
} }
else { else {
/* op is noncommutative and the order is not right */ /* op is noncommutative and the order is not right */
...@@ -435,9 +464,23 @@ int MPIR_Allreduce_intra ( ...@@ -435,9 +464,23 @@ int MPIR_Allreduce_intra (
datatype, datatype,
uop ); uop );
} }
else else {
#endif #endif
#if defined(HAVE_FORTRAN_BINDING) && !defined(HAVE_FINT_IS_INT)
if (is_f77_uop) {
MPI_Fint lcount = (MPI_Fint)count;
MPI_Fint ldtype = (MPI_Fint)datatype;
(*uop)(recvbuf, tmp_buf, &lcount, &ldtype);
}
else {
(*uop)(recvbuf, tmp_buf, &count, &datatype);
}
#else
(*uop)(recvbuf, tmp_buf, &count, &datatype); (*uop)(recvbuf, tmp_buf, &count, &datatype);
#endif
#ifdef HAVE_CXX_BINDING
}
#endif
/* copy result back into recvbuf */ /* copy result back into recvbuf */
mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype, mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
......
...@@ -207,7 +207,9 @@ static int MPIR_Reduce_binomial ( ...@@ -207,7 +207,9 @@ static int MPIR_Reduce_binomial (
#else #else
(*uop)(tmp_buf, recvbuf, &count, &datatype); (*uop)(tmp_buf, recvbuf, &count, &datatype);
#endif #endif
#ifdef HAVE_CXX_BINDING
} }
#endif
} }
else { else {
#ifdef HAVE_CXX_BINDING #ifdef HAVE_CXX_BINDING
...@@ -231,7 +233,9 @@ static int MPIR_Reduce_binomial ( ...@@ -231,7 +233,9 @@ static int MPIR_Reduce_binomial (
#else #else
(*uop)(recvbuf, tmp_buf, &count, &datatype); (*uop)(recvbuf, tmp_buf, &count, &datatype);
#endif #endif
#ifdef HAVE_CXX_BINDING
} }
#endif
mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype, mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
recvbuf, count, datatype); recvbuf, count, datatype);
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); } if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment