-
Notifications
You must be signed in to change notification settings - Fork 894
configury: test Fortran complex(real16) #13198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Recent NVHPC compilers now support the REAL16 intrinsic from the ISO_FORTRAN_ENV module. Though they do support real(REAL16), they do not support complex(REAL16), causing a compilation error in the MPI_Sizeof() Fortran subroutine. This patch does test complex(REAL16) on top of real(REAL16), and issue a warning and disable ISO_FORTRAN_ENV:REAL16 support if the former is not supported but the latter is. Thanks Jorge Cabrera for reporting this. Refs open-mpi#13190 Signed-off-by: Gilles Gouaillardet <[email protected]>
90de4d7
to
58960cc
Compare
[AC_MSG_RESULT([no]) | ||
AC_MSG_WARN([*** Fortran compiler supports real(REAL16) but]) | ||
AC_MSG_WARN([*** does *not* support complex(REAL16)]) | ||
AC_MSG_WARN([*** Disabling support for ISO_FORTRAN_ENV:REAL16]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just create another type / plumb through complex(real16) such that we can support real16 and not support complex(real16)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffhammond explained former PGI based NVHPC compiler won't support complex(REAL16)
, but the future is with flang
(LLVM) based compilers.
I don't think this is worth the hassle unless there is a real use-case for that.
#13190 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw @jeffhammond's comment, but I thought that that was exactly why we would want to do this. I.e., other compilers support REAL16 and support COMPLEX(REAL16). But the NV compiler doesn't -- and won't -- support REAL16 and COMPLEX(REAL16) -- it'll only support REAL16.
So if we test for both, and have proper test results for both, then we can handle any compiler that supports one or both. In reality, it'll only be the NV compiler that only supports one, but that's fine -- it's a generalized test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just turn OMPI_HAVE_FORTRAN_COMPLEX32 off and the datatype and op code should deal with having REAL16 but not COMPLEX32.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I'm fine with the solution proposed here, either you have both or none.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a quick grep and unless I missed something, this is only used in MPI_Sizeof()
.
So though it would be ideal to handle compilers (e.g. NVHPC
) that support real(REAL16)
but not complex(REAL16)
, I do not think this is worth the hassle and fixing compilation by disabling ISO_FORTRAN_ENV:REAL16
altogether is good enough for the time being.
Of course anyone is free to improve this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is also used in the datatype and in the MPI Op via OMPI_HAVE_FORTRAN_COMPLEX32. But I would be surprised if it had any users. For the outcome, I'm with you this PR is good enough.
Recent NVHPC compilers now support the REAL16 intrinsic from the ISO_FORTRAN_ENV module. Though they do support real(REAL16), they do not support complex(REAL16), causing a compilation error in the MPI_Sizeof() Fortran subroutine.
This patch does test complex(REAL16) on top of real(REAL16), and issue a warning and disable ISO_FORTRAN_ENV:REAL16 support if the former is not supported but the latter is.
Refs #13190