Remove filter operation for superlu-dist to avoid permission issues on read-only systems (#30970)

* added package gptune with all its dependencies: adding py-autotune, pygmo, py-pyaml, py-autotune, py-gpy, py-lhsmdu, py-hpbandster, pagmo2, py-opentuner; modifying superlu-dist, py-scikit-optimize

* adding gptune package

* minor fix for macos spack test

* update patch for py-scikit-optimize; update test files for gptune

* fixing gptune package style error

* fixing unit tests

* a few changes reviewed in the PR

* improved gptune package.py with a few newly added/improved dependencies

* fixed a few style errors

* minor fix on package name py-pyro4

* fixing more style errors

* Update var/spack/repos/builtin/packages/py-scikit-optimize/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* resolved a few issues in the PR

* fixing file permissions

* a few minor changes

* style correction

* minor correction to jq package file

* Update var/spack/repos/builtin/packages/py-pyro4/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* fixing a few issues in the PR

* adding py-selectors34 required by py-pyro4

* improved the superlu-dist package

* improved the superlu-dist package

* moree changes to gptune and py-selectors34 based on the PR

* Update var/spack/repos/builtin/packages/py-selectors34/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* improved gptune package: 1. addressing comments of tldahlgren in PR 26936; 2. adding variant openmpi

* fixing style issue of gptune

* changing file mode

* improved gptune package: add variant mpispawn which depends on openmpi; add variant superlu and hypre for installing the drivers; modified hypre package file to add a gptune variant

* fixing style error

* corrected pddrive_spawn path in gptune test; enforcing gcc>7

* fixing style error

* setting environment variables when loading gptune

* removing debug print in hypre/package.py

* adding superlu-dist v7.2.0; fixing an issue with CMAKE_INSTALL_LIBDIR

* changing site_packages_dir to python_platlib

* not using python3.9 for py-gpy, which causes due to dropped support of tp_print

* more replacement of site_packages_dir

* fixing a few dependencies in gptune; added a gptune version

* adding url for gptune

* minor correction of gptune

* updating versions in butterflypack

* added a version for openturns

* added a url for openturns

* minor fix for openturns

* Update var/spack/repos/builtin/packages/openturns/package.py

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>

* added version2.1.1 for butterflypack

* fixing a tag in butterflypack

* minor fix for superlu-dist

* removed file filter for superlu-dist

* Update var/spack/repos/builtin/packages/superlu-dist/package.py

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>

* superlu-dist: add version detection for the testing; removing unused lines

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
This commit is contained in:
liuyangzhuan 2022-06-13 08:48:55 -07:00 committed by GitHub
parent e50d08ce48
commit 2ca32fbc8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,51 +129,25 @@ def flag_handler(self, name, flags):
return (None, None, flags) return (None, None, flags)
examples_src_dir = 'EXAMPLE' examples_src_dir = 'EXAMPLE'
mk_hdr = 'make.inc'
mk_hdr_in = mk_hdr + '.in'
@run_after('install') @run_after('install')
def cache_test_sources(self): def cache_test_sources(self):
"""Copy the example source files after the package is installed to an """Copy the example matrices after the package is installed to an
install test subdirectory for use during `spack test run`.""" install test subdirectory for use during `spack test run`."""
self.cache_extra_test_sources([self.examples_src_dir, self.mk_hdr]) self.cache_extra_test_sources([self.examples_src_dir])
def test(self): def test(self):
mk_file = join_path(self.install_test_root, self.mk_hdr)
# Replace 'SRC' with 'lib' in the library's path
filter_file(r'^(DSUPERLULIB.+)SRC(.+)', '\\1lib\\2', mk_file)
# Set library flags for all libraries superlu-dist depends on
filter_file(r'^LIBS.+\+=.+', '', mk_file)
filter_file(r'^LIBS[^\+]+=.+', 'LIBS = $(DSUPERLULIB)' +
' {0}'.format(self.spec['blas'].libs.ld_flags) +
' {0}'.format(self.spec['lapack'].libs.ld_flags) +
' {0}'.format(self.spec['parmetis'].libs.ld_flags) +
' {0}'.format(self.spec['metis'].libs.ld_flags) +
' $(CUDALIBS)',
mk_file)
cuda_lib_opts = ''
if '+cuda' in self.spec:
cuda_lib_opts = ',-rpath,{0}'.format(
self.spec['cuda'].libs.directories[0])
# Set the rpath for all the libs
filter_file(r'^LOADOPTS.+', 'LOADOPTS = -Wl' +
',-rpath,{0}'.format(self.prefix.lib) +
',-rpath,{0}'.format(self.spec['blas'].prefix.lib) +
',-rpath,{0}'.format(self.spec['lapack'].prefix.lib) +
',-rpath,{0}'.format(self.spec['parmetis'].prefix.lib) +
',-rpath,{0}'.format(self.spec['metis'].prefix.lib) +
cuda_lib_opts,
mk_file)
test_dir = join_path(self.install_test_root, self.examples_src_dir) test_dir = join_path(self.install_test_root, self.examples_src_dir)
test_exe = 'pddrive' superludriver = join_path(self.prefix.lib, 'EXAMPLE', 'pddrive')
with working_dir(test_dir, create=False): with working_dir(test_dir, create=False):
make(test_exe)
# Smoke test input parameters: -r 2 -c 2 g20.rua # Smoke test input parameters: -r 2 -c 2 g20.rua
test_args = ['-n', '4', test_exe, '-r', '2', '-c', '2', 'g20.rua'] test_args = ['-n', '4', superludriver, '-r', '2', '-c', '2', 'g20.rua']
# Find the correct mpirun command # Find the correct mpirun command
mpiexe_f = which('srun', 'mpirun', 'mpiexec') mpiexe_f = which('srun', 'mpirun', 'mpiexec')
if mpiexe_f: if mpiexe_f:
self.run_test(mpiexe_f.command, test_args, work_dir='.', if self.spec.satisfies('@7.2.0:'):
purpose='superlu-dist smoke test') self.run_test(mpiexe_f.command, test_args, work_dir='.',
make('clean') purpose='superlu-dist smoke test')
else:
self.run_test('echo', options=['skip test'], work_dir='.',
purpose='superlu-dist smoke test')