diff mbox series

[bug#49096] gnu: petsc: Link against OpenBLAS rather than LAPACK.

Message ID 20210618161204.32542-1-ludo@gnu.org
State Accepted
Headers show
Series [bug#49096] gnu: petsc: Link against OpenBLAS rather than LAPACK. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Ludovic Courtès June 18, 2021, 4:12 p.m. UTC
From: Ludovic Courtès <ludovic.courtes@inria.fr>

OpenBLAS performs better than LAPACK, the reference implementation.
This is also consistent with the choice of BLAS/LAPACK implementations
made in most other packages.

* gnu/packages/maths.scm (petsc)[inputs]: Replace LAPACK by OPENBLAS.
[arguments]: Pass "--with-openmp=1".
---
 gnu/packages/maths.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Hi!

Usually there’s no reason to depend on the reference (“Netlib”) BLAS/LAPACK
implementations because they perform poorly.  This change is one way to
bring consistency here.

Thoughts?

Ludo’.

Comments

Efraim Flashner June 21, 2021, 1 p.m. UTC | #1
On Fri, Jun 18, 2021 at 06:12:04PM +0200, Ludovic Courtès wrote:
> From: Ludovic Courtès <ludovic.courtes@inria.fr>
> 
> OpenBLAS performs better than LAPACK, the reference implementation.
> This is also consistent with the choice of BLAS/LAPACK implementations
> made in most other packages.
> 
> * gnu/packages/maths.scm (petsc)[inputs]: Replace LAPACK by OPENBLAS.
> [arguments]: Pass "--with-openmp=1".
> ---
>  gnu/packages/maths.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Hi!
> 
> Usually there’s no reason to depend on the reference (“Netlib”) BLAS/LAPACK
> implementations because they perform poorly.  This change is one way to
> bring consistency here.
> 
> Thoughts?
> 
> Ludo’.

It sounds reasonable to me.

As long as you're open to thoughts, perhaps we want to have a discussion
(in a new thread) about renaming the input labels for lapack/openblas so
it's easier to do 'guix build foo
--with-inputs=blas=openblas-tuned-for-my-machine'

> 
> diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
> index a79d546abd..8d47f91310 100644
> --- a/gnu/packages/maths.scm
> +++ b/gnu/packages/maths.scm
> @@ -2417,7 +2417,7 @@ September 2004}")
>       `(("python" ,python-2)))
>      (inputs
>       `(("gfortran" ,gfortran)
> -       ("lapack" ,lapack)
> +       ("openblas" ,openblas)
>         ("superlu" ,superlu)
>         ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
>         ;; leaving out opengl, as configuration seems to only be for mac
> @@ -2428,6 +2428,7 @@ September 2004}")
>         #:configure-flags
>         `("--with-mpi=0"
>           "--with-openmp=1"
> +         "--with-openblas=1"
>           "--with-superlu=1")
>         #:make-flags
>         ;; Honor (parallel-job-count) for build.  Do not use --with-make-np,
> -- 
> 2.32.0
> 
> 
> 
>
Ludovic Courtès June 22, 2021, 7:29 a.m. UTC | #2
Hi,

Efraim Flashner <efraim@flashner.co.il> skribis:

> On Fri, Jun 18, 2021 at 06:12:04PM +0200, Ludovic Courtès wrote:

[...]

>> Usually there’s no reason to depend on the reference (“Netlib”) BLAS/LAPACK
>> implementations because they perform poorly.  This change is one way to
>> bring consistency here.
>> 
>> Thoughts?
>> 
>> Ludo’.
>
> It sounds reasonable to me.

Cool, thanks for taking a look.

> As long as you're open to thoughts, perhaps we want to have a discussion
> (in a new thread) about renaming the input labels for lapack/openblas so
> it's easier to do 'guix build foo
> --with-inputs=blas=openblas-tuned-for-my-machine'

We’ve very much interested in that.  However, input labels don’t have a
role here since ‘--with-input’ matches packages by name.

So most likely, we’d (1) use OpenBLAS by default everywhere instead of
netlib blas/lapack, and (2) you’d use:

  --with-input=openblas=openblas-tuned

WDYT?

Ludo’.
Ludovic Courtès June 22, 2021, 3:57 p.m. UTC | #3
Efraim Flashner <efraim@flashner.co.il> skribis:

> On Fri, Jun 18, 2021 at 06:12:04PM +0200, Ludovic Courtès wrote:
>> From: Ludovic Courtès <ludovic.courtes@inria.fr>
>> 
>> OpenBLAS performs better than LAPACK, the reference implementation.
>> This is also consistent with the choice of BLAS/LAPACK implementations
>> made in most other packages.
>> 
>> * gnu/packages/maths.scm (petsc)[inputs]: Replace LAPACK by OPENBLAS.
>> [arguments]: Pass "--with-openmp=1".

[...]

> It sounds reasonable to me.

Pushed as c7a5c3e0bba2ac3d197b219d21527863308b75dd.

Ludo'.
Simon Tournier June 23, 2021, 12:34 p.m. UTC | #4
Hi,

On Tue, 22 Jun 2021 at 09:31, Ludovic Courtès <ludo@gnu.org> wrote:
> Efraim Flashner <efraim@flashner.co.il> skribis:
> > On Fri, Jun 18, 2021 at 06:12:04PM +0200, Ludovic Courtès wrote:
>
> [...]
>
> >> Usually there’s no reason to depend on the reference (“Netlib”) BLAS/LAPACK
> >> implementations because they perform poorly.  This change is one way to
> >> bring consistency here.
> >>
> >> Thoughts?
> >>
> >> Ludo’.
> >
> > It sounds reasonable to me.
>
> Cool, thanks for taking a look.

LGTM.


> > As long as you're open to thoughts, perhaps we want to have a discussion
> > (in a new thread) about renaming the input labels for lapack/openblas so
> > it's easier to do 'guix build foo
> > --with-inputs=blas=openblas-tuned-for-my-machine'
>
> We’ve very much interested in that.  However, input labels don’t have a
> role here since ‘--with-input’ matches packages by name.
>
> So most likely, we’d (1) use OpenBLAS by default everywhere instead of
> netlib blas/lapack, and (2) you’d use:
>
>   --with-input=openblas=openblas-tuned

Yeah, it make sense. :-)

Cheers,
simon
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index a79d546abd..8d47f91310 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2417,7 +2417,7 @@  September 2004}")
      `(("python" ,python-2)))
     (inputs
      `(("gfortran" ,gfortran)
-       ("lapack" ,lapack)
+       ("openblas" ,openblas)
        ("superlu" ,superlu)
        ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
        ;; leaving out opengl, as configuration seems to only be for mac
@@ -2428,6 +2428,7 @@  September 2004}")
        #:configure-flags
        `("--with-mpi=0"
          "--with-openmp=1"
+         "--with-openblas=1"
          "--with-superlu=1")
        #:make-flags
        ;; Honor (parallel-job-count) for build.  Do not use --with-make-np,