[PATCH] gnu: Add ELPA.

  • Done
  • quality assurance status badge
Details
2 participants
  • ericbavier
  • Ludovic Courtès
Owner
unassigned
Submitted by
ericbavier
Severity
normal

Debbugs page

ericbavier wrote 6 years ago
(address . guix-patches@gnu.org)(name . Eric Bavier)(address . bavier@cray.com)
20190124061649.3896-1-ericbavier@centurylink.net
From: Eric Bavier <bavier@cray.com>

* gnu/packages/maths.scm (elpa, elpa-openmpi): New variables.
---
gnu/packages/maths.scm | 86 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 85 insertions(+), 1 deletion(-)

Toggle diff (106 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 2f52b4a0ff..5dff1c4d0a 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
@@ -3990,6 +3990,90 @@ as equations, scalars, vectors, and matrices.")
theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
(license license:expat)))
+(define-public elpa
+ (package
+ (name "elpa")
+ (version "2018.11.001")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
+ version "/elpa-" version ".tar.gz"))
+ (sha256
+ (base32
+ "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("fortran" ,gfortran)
+ ("perl" ,perl))) ;for configure and deps
+ (inputs
+ `(("blas" ,openblas)))
+ (arguments
+ `(#:configure-flags
+ `(;"--enable-openmp"
+ "--with-mpi=no"
+ ;; ELPA unfortunately does not support runtime dispatch, so we can
+ ;; only enable the "generic" kernels. See the "Cross compilation"
+ ;; section of INSTALL.md.
+ "--enable-generic"
+ "--disable-sse" "--disable-sse-assembly" ;Require SSE3
+ "--disable-avx" "--disable-avx2" "--disable-avx512"
+ ,(string-append "CFLAGS=-O3 "
+ "-funsafe-loop-optimizations -funsafe-math-optimizations "
+ "-ftree-vect-loop-version -ftree-vectorize "
+ ,(let ((system (or (%current-target-system)
+ (%current-system))))
+ (cond
+ ((or (string-prefix? "x86_64" system)
+ (string-prefix? "i686" system))
+ "-msse2")
+ (else "")))))
+ #:parallel-tests? #f ;tests are multi-threaded, via BLAS
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'patch-header-generation
+ (lambda _
+ (substitute* "configure"
+ (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
+ (string-append & " CPP=\"$CPP\"")))
+ #t))
+ (add-before 'check 'setup-tests
+ (lambda _
+ ;; Decrease test time and RAM use by computing fewer eigenvalues.
+ ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
+ ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
+ ;; for Fortran. This also causes several tests to pass that
+ ;; otherwise would otherwise fail with matrix size 5000; possibly
+ ;; due to floating point tolerances that are too tight.
+ (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
+ (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
+ (substitute* "Makefile"
+ ;; Test scripts are generated, patch the shebang
+ (("#!/bin/bash") (string-append "#!" (which "sh"))))
+ #t)))))
+ (home-page "http://elpa.mpcdf.mpg.de")
+ (synopsis "Eigenvalue solvers for symmetric matrices")
+ (description
+ "The ELPA library provides efficient and scalable direct eigensolvers for
+symmetric matrices.")
+ (license license:lgpl3)))
+
+(define-public elpa-openmpi
+ (package (inherit elpa)
+ (name "elpa-openmpi")
+ (inputs
+ `(("mpi" ,openmpi)
+ ("scalapack" ,scalapack)
+ ,@(package-inputs elpa)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments elpa)
+ ((#:configure-flags cf '())
+ `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
+ ((#:phases phases '%standard-phases)
+ `(modify-phases ,phases
+ (add-before 'check 'mpi-setup
+ ,%openmpi-setup))))) ;XXX: Need to adjust OMP_NUM_THREADS?
+ (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
+
(define-public elemental
(package
(name "elemental")
--
2.20.1
Ludovic Courtès wrote 6 years ago
(address . ericbavier@centurylink.net)
87y36uiity.fsf@gnu.org
Hello,

ericbavier@centurylink.net skribis:

Toggle quote (4 lines)
> From: Eric Bavier <bavier@cray.com>
>
> * gnu/packages/maths.scm (elpa, elpa-openmpi): New variables.

[...]

Toggle quote (4 lines)
> + (arguments
> + `(#:configure-flags
> + `(;"--enable-openmp"

No OpenMP support, yet the ‘setup-tests’ phase sets OMP_NUM_THREADS.
Did you mean to uncomment it?

Toggle quote (8 lines)
> + "--with-mpi=no"
> + ;; ELPA unfortunately does not support runtime dispatch, so we can
> + ;; only enable the "generic" kernels. See the "Cross compilation"
> + ;; section of INSTALL.md.
> + "--enable-generic"
> + "--disable-sse" "--disable-sse-assembly" ;Require SSE3
> + "--disable-avx" "--disable-avx2" "--disable-avx512"

For a future patch, do you think you can enable function
multi-versioning (FMV) for this code using the scripts at

Toggle quote (6 lines)
> + (synopsis "Eigenvalue solvers for symmetric matrices")
> + (description
> + "The ELPA library provides efficient and scalable direct eigensolvers for
> +symmetric matrices.")
> + (license license:lgpl3)))

v3 only?

Also, should we add a ‘supported-systems’ field or is it supposed to
work on any architecture?

Apart from that it LGTM, thank you!

Ludo’.
Eric Bavier wrote 6 years ago
(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)
20190205091255.2d67f5ad@centurylink.net
On Tue, 05 Feb 2019 12:19:05 +0100
Ludovic Courtès <ludovic.courtes@inria.fr> wrote:

Toggle quote (17 lines)
> Hello,
>
> ericbavier@centurylink.net skribis:
>
> > From: Eric Bavier <bavier@cray.com>
> >
> > * gnu/packages/maths.scm (elpa, elpa-openmpi): New variables.
>
> [...]
>
> > + (arguments
> > + `(#:configure-flags
> > + `(;"--enable-openmp"
>
> No OpenMP support, yet the ‘setup-tests’ phase sets OMP_NUM_THREADS.
> Did you mean to uncomment it?

Oops, right, I had meant to uncomment this.

Toggle quote (13 lines)
>
> > + "--with-mpi=no"
> > + ;; ELPA unfortunately does not support runtime dispatch, so we can
> > + ;; only enable the "generic" kernels. See the "Cross compilation"
> > + ;; section of INSTALL.md.
> > + "--enable-generic"
> > + "--disable-sse" "--disable-sse-assembly" ;Require SSE3
> > + "--disable-avx" "--disable-avx2" "--disable-avx512"
>
> For a future patch, do you think you can enable function
> multi-versioning (FMV) for this code using the scripts at
> <https://github.com/clearlinux/make-fmv-patch>? That’d be pretty cool.

It would be cool. And this package might be a good candidate to test,
since we can also compare the achieved performance against the
hand-rolled assembly.

Toggle quote (9 lines)
>
> > + (synopsis "Eigenvalue solvers for symmetric matrices")
> > + (description
> > + "The ELPA library provides efficient and scalable direct eigensolvers for
> > +symmetric matrices.")
> > + (license license:lgpl3)))
>
> v3 only?

Indeed. There is no "or later" verbiage in file headers.

Toggle quote (4 lines)
>
> Also, should we add a ‘supported-systems’ field or is it supposed to
> work on any architecture?

It should work on any system, especially given that the "generic"
kernels are used.

Toggle quote (4 lines)
>
> Apart from that it LGTM, thank you!
>

Thanks for the review. I'll send an updated patch soon.

`~Eric
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEoMXjUi7471xkzbfw/XPKxxnTJWYFAlxZp/cACgkQ/XPKxxnT
JWYIvQ//aeU74lmt0lnE5WR8EPRdocdeTQDWe7KbqdHSYDDK3NGyyeXpxe1L28xM
gDaWnEKGigTRJScS9BtrFnB7h8Yc7ZjZfHU/aCQ9al6A2Z+WSMiRJGFupOEPbRq5
bgZ8MADb+rkUHpnEtV4O1z/KIW/q8s/mmscqlY470rrV6CdBYL045ZKTj1ztdESG
8Ed/WKqaYuq1Bqm9zKYm5vhSWSWJy7w9iZGE8utWTD/rdiWYJlqcNORRc9/QgIjb
j5s8YMV+dEIi74IkKbr/PdJjhGHuazfYchqXsOIyxTj2RRaVCGmMcRQZ/1VGMNCM
JuqZ04xP/rmBd0NWUTl1XGTqeolMdpwFquy8vTrWpy9ZQ75ocqrg8QJP3b49zNRZ
GeToPDvPv/wGOkoI3uwWgUrxzX6uQfuuH7hnK24Fe78EvQUB9gvnqr+jnViTtoBo
GrmzIywbC1ReFBuyNrKrAqKUqGUzUflG4859XJOoErLTAihfCKh8S6iZPmg53L18
UhrO1FnF53Dz0gScVoFIwQ78asDAiY8DULPrwD1OeY7U/Un5udfX8hDOMgKGNJqN
LR6A3+DjvnJAS1PKr68k6ii5belvyJPVN/qUHivZKYD3rw4o+tf36Zq39SPeMDLQ
B8ySPh8YE8M54SyicrwP1lxmYL3Z3vLiITDPlwpZJphvFJG51/Y=
=6NbA
-----END PGP SIGNATURE-----


Eric Bavier wrote 6 years ago
(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)
20190213141307.480b4750@centurylink.net
On Tue, 5 Feb 2019 09:12:55 -0600
Eric Bavier <ericbavier@centurylink.net> wrote:

Toggle quote (17 lines)
> >
> > > + "--with-mpi=no"
> > > + ;; ELPA unfortunately does not support runtime dispatch, so we can
> > > + ;; only enable the "generic" kernels. See the "Cross compilation"
> > > + ;; section of INSTALL.md.
> > > + "--enable-generic"
> > > + "--disable-sse" "--disable-sse-assembly" ;Require SSE3
> > > + "--disable-avx" "--disable-avx2" "--disable-avx512"
> >
> > For a future patch, do you think you can enable function
> > multi-versioning (FMV) for this code using the scripts at
> > <https://github.com/clearlinux/make-fmv-patch>? That’d be pretty cool.
>
> It would be cool. And this package might be a good candidate to test,
> since we can also compare the achieved performance against the
> hand-rolled assembly.

Most of the computational bits are implemented in Fortran90, and it
turns out gfortran does not support FMV. In order to use it, the
kernels would need to be wrapped with a higher-level interface written
in C. This is doable, but for a later time.

Pushed in 6d433d6ef7c33b8599199481e1c1faff6584d1ac

`~Eric
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEoMXjUi7471xkzbfw/XPKxxnTJWYFAlxkelMACgkQ/XPKxxnT
JWbg/w/+L62aiDX3tjnsyvAkLsQ5cXnvcBzdZ6jkBJoriTquCQIg/vDek7UkZw2c
X8Rdsx92U+UBtT3eBV0h9QQLvmklmqAgKyCmI7F7G4tEyWgItHEYQLOV/xxi8TiP
r87gdxcmwqY8g140FGZDx+qz2KobK90Xe+JueMqg/t8xh+7Zy33XqjWqT3564DZT
PVxhQ4cvjBGG+MRdM/c5LozxnYDsePYmrQbY9YzsB787Jl75dqLqr3plvu1mI2Fz
anr3pb6k9s8WRqBuOcWn4SJyvZhaBjBuIYjIWFG+aDJr2OieZheN/zKG4PFc3zaC
Tfbcx1d9Wg6LA9aGl/2JyjycKSl8kRxtpmhQv/WTTdyCh5XFxG6/+dMGp37dfo1F
GeU5tkYcqKamYUy+J/ZjbgqrX7FqyIhbSaRo95kL+QLLC3ms0X6MQPdCe1oSQsxq
sdPrLirC+TQUbIWDIZ5qiR0AMLxDr5UCWi6JLUxVdx1BiODr24glVq9GLKuq84I4
aq6XB02F1Nhp7S+RyY6w58s2abfCtY9utsAl1nnb+7wJjjY7uyInZ+bO3PZDx1yy
rPQnp5xLSN6ZGY1zdLrBCjb7N8Nkn3XtNO9d6rKhWQTjeZaIfK9iKN6yqkDcbbQp
XYvwsJPEgr8HKqSVXBI6bKY5rHAu3Bu80lDPDimmrHQz/8bgwIk=
=lyP7
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 34188@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 34188
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help