petsc: add a +mkl-pardiso variant (#21219)
* petsc: add a +mkl-pardiso variant mkl_pardiso solver is distributed with intel-mkl * petsc: depend on mkl instead of intel-mkl Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
parent
8f45b27836
commit
88cafacd09
1 changed files with 15 additions and 0 deletions
|
@ -92,6 +92,8 @@ class Petsc(Package):
|
|||
description='Activates support for SuperluDist (only parallel)')
|
||||
variant('trilinos', default=False,
|
||||
description='Activates support for Trilinos (only parallel)')
|
||||
variant('mkl-pardiso', default=False,
|
||||
description='Activates support for MKL Pardiso')
|
||||
variant('int64', default=False,
|
||||
description='Compile with 64bit indices')
|
||||
variant('clanguage', default='C', values=('C', 'C++'),
|
||||
|
@ -243,6 +245,7 @@ class Petsc(Package):
|
|||
depends_on('trilinos@12.6.2:+mpi', when='@3.7.0:+trilinos+mpi')
|
||||
depends_on('trilinos@xsdk-0.2.0+mpi', when='@xsdk-0.2.0+trilinos+mpi')
|
||||
depends_on('trilinos@develop+mpi', when='@xdevelop+trilinos+mpi')
|
||||
depends_on('mkl', when='+mkl-pardiso')
|
||||
depends_on('fftw+mpi', when='+fftw+mpi')
|
||||
depends_on('suite-sparse', when='+suite-sparse')
|
||||
depends_on('libx11', when='+X')
|
||||
|
@ -449,6 +452,11 @@ def install(self, spec, prefix):
|
|||
else:
|
||||
options.append('--with-zlib=0')
|
||||
|
||||
if '+mkl-pardiso' in spec:
|
||||
options.append(
|
||||
'--with-mkl_pardiso-dir=%s' % spec['mkl'].prefix
|
||||
)
|
||||
|
||||
python('configure', '--prefix=%s' % prefix, *options)
|
||||
|
||||
# PETSc has its own way of doing parallel make.
|
||||
|
@ -497,6 +505,13 @@ def install(self, spec, prefix):
|
|||
'-pc_type', 'hypre',
|
||||
'-pc_hypre_type', 'boomeramg')
|
||||
|
||||
if 'mkl-pardiso' in spec:
|
||||
run('ex50',
|
||||
'-da_grid_x', '4',
|
||||
'-da_grid_y', '4',
|
||||
'-pc_type', 'lu',
|
||||
'-pc_factor_mat_solver_package', 'mkl_pardiso')
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
# configure fails if these env vars are set outside of Spack
|
||||
env.unset('PETSC_DIR')
|
||||
|
|
Loading…
Reference in a new issue