summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Dias Costa <migueldiascosta@gmail.com>2022-12-06 06:37:19 +0800
committerGitHub <noreply@github.com>2022-12-05 23:37:19 +0100
commitf27be808a40557f41869a2355cbf7658a7d587a1 (patch)
treeda0295c33aac7a6ef2d5b2bef4c1f7c0f7b30d9b
parent855d3519b6c90fee288a8fc2a4a8098eb5ae8494 (diff)
downloadspack-f27be808a40557f41869a2355cbf7658a7d587a1.tar.gz
spack-f27be808a40557f41869a2355cbf7658a7d587a1.tar.bz2
spack-f27be808a40557f41869a2355cbf7658a7d587a1.tar.xz
spack-f27be808a40557f41869a2355cbf7658a7d587a1.zip
berkeleygw: add back python dependencies and tweak testsuite (#34125)
* slightly raise tolerance of some tests
-rw-r--r--var/spack/repos/builtin/packages/berkeleygw/package.py33
1 files changed, 28 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/berkeleygw/package.py b/var/spack/repos/builtin/packages/berkeleygw/package.py
index 899395ff4f..6f3c1c4768 100644
--- a/var/spack/repos/builtin/packages/berkeleygw/package.py
+++ b/var/spack/repos/builtin/packages/berkeleygw/package.py
@@ -40,6 +40,7 @@ class Berkeleygw(MakefilePackage):
# https://github.com/spack/spack/pull/33948#issuecomment-1323805817
variant("mpi", default=True, description="Build with MPI and ScaLAPACK support")
variant("elpa", default=True, description="Build with ELPA support")
+ variant("python", default=True, description="Build with Python support")
variant("openmp", default=True, description="Build with OpenMP support")
variant("hdf5", default=True, description="Builds with HDF5 support")
variant("debug", default=False, description="Builds with DEBUG flag")
@@ -56,6 +57,12 @@ class Berkeleygw(MakefilePackage):
depends_on("fftw-api@3+openmp", when="+openmp")
depends_on("fftw-api@3~openmp", when="~openmp")
+ # in order to run the installed python scripts
+ depends_on("python", type=("build", "run"), when="+python")
+ depends_on("py-numpy", type=("build", "run"), when="+python")
+ depends_on("py-setuptools", type=("build", "run"), when="+python")
+ depends_on("py-h5py", type=("build", "run"), when="+hdf5+python")
+
depends_on("perl", type="test")
conflicts("+elpa", when="~mpi", msg="elpa is a parallel library and needs MPI support")
@@ -91,7 +98,10 @@ class Berkeleygw(MakefilePackage):
# use parallelization in tests
filter_file(
r"cd testsuite \&\& \$\(MAKE\) check$",
- "cd testsuite && $(MAKE) check-parallel",
+ "cd testsuite && export BGW_TEST_MPI_NPROCS=2 OMP_NUM_THREADS=2 \
+ SAVETESTDIRS=yes TEMPDIRPATH=%s && \
+ $(MAKE) check-parallel"
+ % join_path(self.build_directory, "tmp"),
"Makefile",
)
@@ -102,10 +112,23 @@ class Berkeleygw(MakefilePackage):
"testsuite/run_testsuite.sh",
)
- def setup_build_environment(self, env):
- if self.run_tests:
- env.set("OMP_NUM_THREADS", "2")
- env.set("BGW_TEST_MPI_NPROCS", "2")
+ # slightly raise tolerance of some tests
+ si_epm_tests = ["Si", "Si_cplx_spin"]
+ if self.version >= Version("3.0"):
+ si_epm_tests.append("Si_hdf5")
+ for test in si_epm_tests:
+ filter_file(
+ "Precision : 6e-15",
+ "Precision : 7e-15",
+ join_path("testsuite", "Si-EPM", test + ".test"),
+ )
+ for test in ["Si_subspace", "Si_subspace_cplx", "Si_subspace_cplx_spin"]:
+ filter_file(
+ "Precision : 6e-15",
+ "Precision : 7e-15",
+ join_path("testsuite", "Si-EPM_subspace", test + ".test"),
+ )
+ filter_file("Precision : 8e-15", "Precision : 9e-15", "testsuite/GaAs-EPM/GaAs.test")
def build(self, spec, prefix):