-
Notifications
You must be signed in to change notification settings - Fork 60
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
ILP64 support #19
ILP64 support #19
Conversation
The code now uses preprocessor macro `Int` instead of the `int` type to allow for flexibility in compilation of the library. `Int` is the internal integer type used for most operations. Also, it is the type used (expected) by the library interface. By default `Int` is `int`. However, it is possible to redefine it on the command line to a larger integer type `long` if desired. Any change to `Int` needs to be accompanied with the appropriate promotion of the Fortran integers (`-fdefault-integer-8`, `-i8` etc.). When compiling ILP64 version of ScaLAPACK, the following needs to be satisfied: 1. Use ILP64 BLAS (e.g. OpenBLAS with `-DINTERFACE64=ON`). 2. Promote integer types (`-DInt=long`, `-fdefault-integer-8`). 3. Change hardcoded `INTSZ` and `INTGSZ` in the test sources from 4 to 8.
Thank you so much for this much needed contribution. |
Sorry, but this is just wrong. The MPI standard uses The MPI standard has I don't have strong feelings about |
@jeffhammond Thanks for raising this issue! My knowledge of MPI implementations improved a lot since I wrote this code years ago and I agree now that there is no real use case for |
Some scientific Fortran based programs make use of global integer promotion to 8 bytes ("ILP64 mode"), which then requires compatible Fortran integer interface in BLAS, LAPACK and ScaLAPACK. For instance, OpenBLAS provides the 8-byte interface when compiled with an appropriate configuration flag. Intel MKL is offered in both LP64 and ILP64 versions, too.
This voluminous pull request adds the possibility to compile ScaLAPACK with long integers. This is achieved by replacing most
int
declarations by a macroInt
, which by default evaluates toint
, but can be overridden by the user in a different way using a compile-time definition. Compiling ScaLAPACK in the ILP64 mode (in Unix-like systems) then requires the following:-DInt=long
to the C compiler flags-fdefault-integer-8
(or analogous, compiler-specific) to the Fortran compiler flagsINTERFACE64=1
)When the above is not done, the build process will work exactly as is did before, resulting in a LP64 library.
Furthermore, the MPI C interface is newly assumed to expect the type
MpiInt
, which is a macro again, by default evaluates toint
, but can be (in hypothetical and very unlikely circumstances) overridden by the user as well. However, I know of no MPI C library providing other than LP64 interface, so this freedom will be most likely never used.The test suite, as it is, contains hardcoded sizes of integers (4 bytes). Because ScaLAPACK is a Fortran 77 library, I have not taken the liberty to replace the fixed sizes by calls to the Fortran 95 function
bit_size()
, or the Fortran 2008 functionstorage_size()
. Instead, to compile and run the test suite in the ILP64 mode, one needs to replace those hardcoded numbers manually (as stated in the README):All tests then succeed except for "xssep", "xsgsep" and "xssyevr", whose workspace handling is unfortunately written with the assumption that the byte size of an integer does not exceed the byte size of a (default, single precision) real, which is not true in case of the ILP64 configuration.
Apart from the ScaLAPACK test suite, I have been using this branch for two years now for large-scale
pdsyevd
runs without any issues. Other functionality is not so well tested.