-
Notifications
You must be signed in to change notification settings - Fork 901
Missing C declaration for MPI_REAL2 and implementation for MPI_COMPLEX4 #2653
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
Comments
As there is no guarantee that the C half-precision is the same type as the REAL2 in Fortran, we have decided that language specific types should only be defined in that specific language. I know there is a growing need for application for support for half-precision types, but the correct solution is a little bit more complex and extremely compiler-dependent. |
That makes sense. While IEEE 754-2008 does specify a format for half-precision floating point types (binary16), it is not standardized in C, though it has been implemented as extensions in some compilers (for instance, I think GCC supports As for the second part, If a particular environment supports |
This is actually pretty funny... program main
COMPLEX*4 :: bogus_variable
end program generates a compilation error:
while program main
COMPLEX*8 :: bogus_variable
end program compiles just fine. |
That just means that the compiler doesn't support #define OMPI_HAVE_FORTRAN_REAL2 0 so my compiler (GNU Fortran 6.3.0) doesn't support it either (and trying the same tests as you nets the same results). However, if one does have a compiler with support for |
According to the gcc documentation COMPLEX*4 should always exist. Moreover, according to the same page, the kind for a complex type refers to each of it's components (imaginary and real part) so this is just puzzling. |
I think I've figured out what's going on. When using old-style kind specifications, GCC states that
For modern declarations (using KIND), it is as you stated,
So COMPLEX*32 :: bogus_variable is equivalent to COMPLEX(KIND=16) :: bogus_variable The GCC documentation states that it supports KIND parameters 4, 8, 10, and 16, with 4 being the default (unless |
The Intel documentation says the same thing. It does not appear to support |
#6205 resolved the issue. |
ompi/include/mpi.h.in is missing a declaration for
MPI_REAL2
. The datatype exists (ompi_mpi_real2
), but the macro is missing.It should be as simple as adding the following:
A related issue is the missing
MPI_COMPLEX4
type. This isn't as trivial as the above, but should follow the same patterns as for the other complex types. Of course, as per the MPI standard, it is optional; but sinceMPI_REAL2
is clearly supported, I don't think there's a reason for not supportingMPI_COMPLEX4
.The text was updated successfully, but these errors were encountered: