summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-11-05 09:34:40 +0100
committerGitHub <noreply@github.com>2021-11-05 02:34:40 -0600
commite93a2db8b78a5b0d97f0b9d15b42e72c2de93d86 (patch)
treea24e62052bf6ff9074e07a09e9af7bc8cef97350 /var
parente13e697067d004107655bc206ac18e9191abf26c (diff)
downloadspack-e93a2db8b78a5b0d97f0b9d15b42e72c2de93d86.tar.gz
spack-e93a2db8b78a5b0d97f0b9d15b42e72c2de93d86.tar.bz2
spack-e93a2db8b78a5b0d97f0b9d15b42e72c2de93d86.tar.xz
spack-e93a2db8b78a5b0d97f0b9d15b42e72c2de93d86.zip
hpx: simplify instrumentation_args function (#27226)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hpx/package.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/hpx/package.py b/var/spack/repos/builtin/packages/hpx/package.py
index 1ee5fdf9bb..ab3160fc12 100644
--- a/var/spack/repos/builtin/packages/hpx/package.py
+++ b/var/spack/repos/builtin/packages/hpx/package.py
@@ -51,9 +51,9 @@ class Hpx(CMakePackage, CudaPackage, ROCmPackage):
description='Max number of OS-threads for HPX applications',
values=lambda x: isinstance(x, str) and x.isdigit())
- variant('instrumentation', values=any_combination_of(
- 'apex', 'google_perftools', 'papi', 'valgrind'
- ), description='Add support for various kind of instrumentation')
+ instrumentation_values = ('apex', 'google_perftools', 'papi', 'valgrind')
+ variant('instrumentation', values=any_combination_of(*instrumentation_values),
+ description='Add support for various kind of instrumentation')
variant(
"networking",
@@ -164,10 +164,7 @@ class Hpx(CMakePackage, CudaPackage, ROCmPackage):
def instrumentation_args(self):
args = []
- for value in self.variants['instrumentation'][0].values:
- if value == 'none':
- continue
-
+ for value in self.instrumentation_values:
condition = 'instrumentation={0}'.format(value)
args.append(self.define(
'HPX_WITH_{0}'.format(value.upper()), condition in self.spec