Skip to content

Commit

Permalink
Make use of the full range of AUX matrices
Browse files Browse the repository at this point in the history
The gist of it is that we have this signature `mr2d_malloc(Int n)`,
bounding the internal `malloc` to `Int`, which is Scalapack's indexing type.
This is not how `malloc` is defined and means that maximum AUX matrix
size is artifically limited on 64-bit systems to 2GB.

This PR operates this transformation: `mr2d_malloc(Int n) -> mr2d_malloc(size_t n)`,
yet ensures `Int -> size_t` conversion does not involve Int-negative values
and ensures that no 64-bit values are passed to `malloc` on 32-bit systems.

The main advantage of this on 64-bit system allows the use of
the **full** _signed_ 32-bit indexing range instead of `range / element size`.
E.g. the max AUX matrix size is now 16GB instead of 2GB previously.

With this, "standard" 32-bit Scalapack and Blas/Lapack can still be used
in programs like GPAW.

Details (and full commit history) are in
Reference-ScaLAPACK/scalapack#85
which does not seem to receive much attention.

This patch is a way to provide that feature to conda users in the meantime.
  • Loading branch information
gdonval authored and minrk committed Nov 1, 2024
1 parent bae2b68 commit ebcf1e0
Show file tree
Hide file tree
Showing 2 changed files with 620 additions and 1 deletion.
Loading

0 comments on commit ebcf1e0

Please sign in to comment.