#990290 petsc: add support for 64-bit integer lapack/blas

Package:
src:petsc
Source:
petsc
Submitter:
Giacomo Mulas
Date:
2021-09-17 13:39:02 UTC
Severity:
wishlist
Tags:
#990290#5
Date:
2021-06-24 17:05:23 UTC
From:
To:
Dear Maintainer,

I am the developer of a quantum chemistry code that deals with very large
matrices.  As such, it uses at the same time slepc/petsc, scalapack, and
elpa libraries.  Since matrices may easily become larger than the maximum
size that can be indexed by standard scalapack (and underlying blas/lapack),
I need to use the versions with long integer indices (i.e.  lapack64,
blas64, mkl scalapack with ilp64 interface), as well as a custom compiled
version of elpa, also with support for the same versions of lapack/blas
(i.e.  compiled with the --64bit-integer-math-support configure option).  Of
course, I cannot link the same code with two different versions of
lapack/blas, so I also need to compile petsc so that it uses the same
versions of lapack/blas.  Luckily, recent versions of the upstream package
do support this, with the --with-64-bit-indices and
--with-64-bit-blas-indices configure options.

Now, since the current debian/rules already has all the machinery to produce
the "petsc64" versions of all packages, using only the --with-64-bit-indices
option, I thought I might hack it to also produce additional real packages
also with the --with-64-bit-blas-indices option, producing additional
packages that can coexist smootly with the other ones.

The quick (and partial) hack that I put together successfully did the trick,
producing real interface petsc libraries that passed all the tests and
appear to work without problems.  I am sending you all the modified/added
files, in case you may want to add official support for this in debian, in
some future.  The hacked version also enables cuda in my custom compiled
packages (not the 64bit blas ones), which would be a welcome addition as
well (for me).

Let me know if this is of any use, and/or if I may help producing a more
complete and cleaner version of this.


Best regards, and thanks for all the great work.
Giacomo Mulas

#990290#10
Date:
2021-09-17 12:50:49 UTC
From:
To:
Grazie per il tuo lavoro, Giacomo.

Would you be able to provide a patch for your changes, i.e. a diff
file?  The simplest way might be to clone the git repo
(https://salsa.debian.org/science-team/petsc) and use `git diff`.

Step by step other components of the numerical library stack are
getting 64-bit support added (Hypre is the most recent upgrade), so a
diff will help identify the key changes we need to make for the BLAS
integers you need, relative to the other 64-bit that are in progress.

You might want to work from petsc 3.15, which is currently in the
debian experimental branch (I'm about to update it now)

Drew

#990290#15
Date:
2021-09-17 13:27:22 UTC
From:
To:
Excellent Italian! :D

well, as in many cases in open source, it was just selfish: i did what I
needed, it costed me nothing to make it available afterwards.

I will give it a spin for sure.  Not right now, I have some impending
deadlines I must meet.  But I hope I will be able to carve some time for
this next week.  I'll let you know as soon as I have something.

bye
Giacomo

#990290#20
Date:
2021-09-17 13:32:07 UTC
From:
To:
I accepted a position at University of Cagliari this year :)  gradually
learning the language...

No problem.  A diff against petsc 3.14 can also be useful.


Drew