summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorRĂ©mi Lacroix <remi.lacroix@idris.fr>2021-04-23 18:19:15 +0200
committerGitHub <noreply@github.com>2021-04-23 18:19:15 +0200
commit44136223f79dd61642f8f56a2056c21378b1952d (patch)
tree79bdbb412f6103a07fbc9100d82302ee3a2b9a87 /var
parent2c9068ead8e35be9bc9d9e6a8d23e7d6b7497798 (diff)
downloadspack-44136223f79dd61642f8f56a2056c21378b1952d.tar.gz
spack-44136223f79dd61642f8f56a2056c21378b1952d.tar.bz2
spack-44136223f79dd61642f8f56a2056c21378b1952d.tar.xz
spack-44136223f79dd61642f8f56a2056c21378b1952d.zip
MUMPS: allow for more optimized builds (#23161)
* MUMPS: Use GEMMT BLAS extension when possible. This should improve the performance and is recommanded by the developers. * MUMPS: Add a new "openmp" variant. * MUMPS: Add a "blr_mt" variant. This improves performance when using OpenMP but might not be compatible with all multithreaded BLAS.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/mumps/package.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py
index d7acaf4c90..b82d143013 100644
--- a/var/spack/repos/builtin/packages/mumps/package.py
+++ b/var/spack/repos/builtin/packages/mumps/package.py
@@ -43,6 +43,11 @@ class Mumps(Package):
variant('int64', default=False,
description='Use int64_t/integer*8 as default index type')
variant('shared', default=True, description='Build shared libraries')
+ variant('openmp', default=False,
+ description='Compile MUMPS with OpenMP support')
+ variant('blr_mt', default=False,
+ description='Allow BLAS calls in OpenMP regions ' +
+ '(warning: might not be supported by all multithread BLAS)')
depends_on('scotch + esmumps', when='~ptscotch+scotch')
depends_on('scotch + esmumps ~ metis + mpi', when='+ptscotch')
@@ -66,6 +71,8 @@ class Mumps(Package):
msg="You cannot use the parmetis variant without metis")
conflicts('+ptscotch', when='~mpi',
msg="You cannot use the ptscotch variant without mpi")
+ conflicts('+blr_mt', when='~openmp',
+ msg="You cannot use the blr_mt variant without openmp")
def write_makefile_inc(self):
# The makefile variables LIBBLAS, LSCOTCH, LMETIS, and SCALAP are only
@@ -173,6 +180,23 @@ class Mumps(Package):
if using_xlf:
optf.append('-qfixed')
+ # As of version 5.2.0, MUMPS is able to take advantage
+ # of the GEMMT BLAS extension. MKL is currently the only
+ # known BLAS implementation supported.
+ if '@5.2.0: ^mkl' in self.spec:
+ optf.append('-DGEMMT_AVAILABLE')
+
+ if '+openmp' in self.spec:
+ optc.append(self.compiler.openmp_flag)
+ optf.append(self.compiler.openmp_flag)
+ optl.append(self.compiler.openmp_flag)
+
+ # Using BLR_MT might not be supported by all multithreaded BLAS
+ # (MKL is known to work) but it is not something we can easily
+ # check so we trust that the user knows what he/she is doing.
+ if '+blr_mt' in self.spec:
+ optf.append('-DBLR_MT')
+
makefile_conf.extend([
'OPTC = {0}'.format(' '.join(optc)),
'OPTF = {0}'.format(' '.join(optf)),