diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2022-07-30 15:19:18 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2022-07-31 13:29:20 -0700 |
commit | f52f6e99dbf1131886a80112b8c79dfc414afb7c (patch) | |
tree | 05cb7d64b2395922f2f24683da49f472075be12c /var/spack/repos/builtin/packages/arborx/package.py | |
parent | 549ba1ed32372c67fc57271cde3797d58b7dec6e (diff) | |
download | spack-f52f6e99dbf1131886a80112b8c79dfc414afb7c.tar.gz spack-f52f6e99dbf1131886a80112b8c79dfc414afb7c.tar.bz2 spack-f52f6e99dbf1131886a80112b8c79dfc414afb7c.tar.xz spack-f52f6e99dbf1131886a80112b8c79dfc414afb7c.zip |
black: reformat entire repository with black
Diffstat (limited to 'var/spack/repos/builtin/packages/arborx/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/arborx/package.py | 128 |
1 files changed, 68 insertions, 60 deletions
diff --git a/var/spack/repos/builtin/packages/arborx/package.py b/var/spack/repos/builtin/packages/arborx/package.py index ac8a3a8d33..cf9d0cc084 100644 --- a/var/spack/repos/builtin/packages/arborx/package.py +++ b/var/spack/repos/builtin/packages/arborx/package.py @@ -10,45 +10,48 @@ class Arborx(CMakePackage, CudaPackage, ROCmPackage): """ArborX is a performance-portable library for geometric search""" homepage = "https://github.com/arborx/arborx" - url = "https://github.com/arborx/arborx/archive/v1.1.tar.gz" - git = "https://github.com/arborx/arborx.git" + url = "https://github.com/arborx/arborx/archive/v1.1.tar.gz" + git = "https://github.com/arborx/arborx.git" - tags = ['e4s', 'ecp'] + tags = ["e4s", "ecp"] - maintainers = ['aprokop'] + maintainers = ["aprokop"] - version('master', branch='master') - version('1.2', sha256='ed1939110b2330b7994dcbba649b100c241a2353ed2624e627a200a398096c20') - version('1.1', sha256='2b5f2d2d5cec57c52f470c2bf4f42621b40271f870b4f80cb57e52df1acd90ce') - version('1.0', sha256='9b5f45c8180622c907ef0b7cc27cb18ba272ac6558725d9e460c3f3e764f1075') - version('0.9-beta', sha256='b349b5708d1aa00e8c20c209ac75dc2d164ff9bf1b85adb5437346d194ba6c0d', deprecated=True) + version("master", branch="master") + version("1.2", sha256="ed1939110b2330b7994dcbba649b100c241a2353ed2624e627a200a398096c20") + version("1.1", sha256="2b5f2d2d5cec57c52f470c2bf4f42621b40271f870b4f80cb57e52df1acd90ce") + version("1.0", sha256="9b5f45c8180622c907ef0b7cc27cb18ba272ac6558725d9e460c3f3e764f1075") + version( + "0.9-beta", + sha256="b349b5708d1aa00e8c20c209ac75dc2d164ff9bf1b85adb5437346d194ba6c0d", + deprecated=True, + ) # ArborX relies on Kokkos to provide devices, providing one-to-one matching # variants. The only way to disable those devices is to make sure Kokkos # does not provide them. kokkos_backends = { - 'serial': (True, "enable Serial backend (default)"), - 'openmp': (False, "enable OpenMP backend"), - 'sycl': (False, "enable SYCL backend") + "serial": (True, "enable Serial backend (default)"), + "openmp": (False, "enable OpenMP backend"), + "sycl": (False, "enable SYCL backend"), } - variant('mpi', default=True, description='enable MPI') + variant("mpi", default=True, description="enable MPI") for backend in kokkos_backends: deflt, descr = kokkos_backends[backend] variant(backend.lower(), default=deflt, description=descr) - variant('trilinos', default=False, description='use Kokkos from Trilinos') + variant("trilinos", default=False, description="use Kokkos from Trilinos") - depends_on('cmake@3.12:', type='build') - depends_on('cmake@3.16:', type='build', when='@1.0:') - depends_on('mpi', when='+mpi') - depends_on('rocthrust', when='+rocm') + depends_on("cmake@3.12:", type="build") + depends_on("cmake@3.16:", type="build", when="@1.0:") + depends_on("mpi", when="+mpi") + depends_on("rocthrust", when="+rocm") # Standalone Kokkos - depends_on('kokkos@3.1.00:', when='~trilinos') - depends_on('kokkos@3.4.00:', when='@1.2:~trilinos') + depends_on("kokkos@3.1.00:", when="~trilinos") + depends_on("kokkos@3.4.00:", when="@1.2:~trilinos") for backend in kokkos_backends: - depends_on('kokkos+%s' % backend.lower(), when='~trilinos+%s' % - backend.lower()) + depends_on("kokkos+%s" % backend.lower(), when="~trilinos+%s" % backend.lower()) for arch in CudaPackage.cuda_arch_values: cuda_dep = "+cuda cuda_arch={0}".format(arch) @@ -58,40 +61,38 @@ class Arborx(CMakePackage, CudaPackage, ROCmPackage): rocm_dep = "+rocm amdgpu_target={0}".format(arch) depends_on("kokkos {0}".format(rocm_dep), when=rocm_dep) - depends_on('kokkos+cuda_lambda', when='~trilinos+cuda') + depends_on("kokkos+cuda_lambda", when="~trilinos+cuda") # Trilinos/Kokkos # Notes: # - current version of Trilinos package does not allow disabling Serial # - current version of Trilinos package does not allow enabling CUDA - depends_on('trilinos+kokkos', when='+trilinos') - depends_on('trilinos+openmp', when='+trilinos+openmp') - depends_on('trilinos@13.2.0:', when='@1.2:+trilinos') - conflicts('~serial', when='+trilinos') - conflicts('+cuda', when='+trilinos') + depends_on("trilinos+kokkos", when="+trilinos") + depends_on("trilinos+openmp", when="+trilinos+openmp") + depends_on("trilinos@13.2.0:", when="@1.2:+trilinos") + conflicts("~serial", when="+trilinos") + conflicts("+cuda", when="+trilinos") def cmake_args(self): spec = self.spec options = [ - '-DKokkos_ROOT=%s' % (spec['kokkos'].prefix if '~trilinos' in spec - else spec['trilinos'].prefix), - self.define_from_variant('ARBORX_ENABLE_MPI', 'mpi') + "-DKokkos_ROOT=%s" + % (spec["kokkos"].prefix if "~trilinos" in spec else spec["trilinos"].prefix), + self.define_from_variant("ARBORX_ENABLE_MPI", "mpi"), ] - if '+cuda' in spec: + if "+cuda" in spec: # Only Kokkos allows '+cuda' for now - options.append( - '-DCMAKE_CXX_COMPILER=%s' % spec["kokkos"].kokkos_cxx) - if '+rocm' in spec: - options.append( - '-DCMAKE_CXX_COMPILER=%s' % spec["hip"].hipcc) + options.append("-DCMAKE_CXX_COMPILER=%s" % spec["kokkos"].kokkos_cxx) + if "+rocm" in spec: + options.append("-DCMAKE_CXX_COMPILER=%s" % spec["hip"].hipcc) return options examples_src_dir = "examples" - @run_after('install') + @run_after("install") def setup_build_tests(self): """Copy the example source files after the package is installed to an install test subdirectory for use during `spack test run`.""" @@ -100,37 +101,44 @@ class Arborx(CMakePackage, CudaPackage, ROCmPackage): @property def cached_tests_work_dir(self): """The working directory for cached test sources.""" - return join_path(self.test_suite.current_test_cache_dir, - self.examples_src_dir) + return join_path(self.test_suite.current_test_cache_dir, self.examples_src_dir) def build_tests(self): """Build the stand-alone/smoke test.""" - arborx_dir = self.spec['arborx'].prefix + arborx_dir = self.spec["arborx"].prefix cmake_prefix_path = "-DCMAKE_PREFIX_PATH={0}".format(arborx_dir) - if '+mpi' in self.spec: - cmake_prefix_path += ";{0}".format(self.spec['mpi'].prefix) - - cmake_args = [".", - cmake_prefix_path, - "-DCMAKE_CXX_COMPILER={0}".format(self.compiler.cxx), - self.define('Kokkos_ROOT', self.spec['kokkos'].prefix - if '~trilinos' in self.spec - else self.spec['trilinos'].prefix)] + if "+mpi" in self.spec: + cmake_prefix_path += ";{0}".format(self.spec["mpi"].prefix) + + cmake_args = [ + ".", + cmake_prefix_path, + "-DCMAKE_CXX_COMPILER={0}".format(self.compiler.cxx), + self.define( + "Kokkos_ROOT", + self.spec["kokkos"].prefix + if "~trilinos" in self.spec + else self.spec["trilinos"].prefix, + ), + ] - self.run_test("cmake", cmake_args, - purpose="test: calling cmake", - work_dir=self.cached_tests_work_dir) + self.run_test( + "cmake", cmake_args, purpose="test: calling cmake", work_dir=self.cached_tests_work_dir + ) - self.run_test("make", [], - purpose="test: building the tests", - work_dir=self.cached_tests_work_dir) + self.run_test( + "make", [], purpose="test: building the tests", work_dir=self.cached_tests_work_dir + ) def test(self): """Perform stand-alone/smoke tests on the installed package.""" self.build_tests() - self.run_test("ctest", ["-V"], - purpose="test: running the tests", - installed=False, - work_dir=self.cached_tests_work_dir) + self.run_test( + "ctest", + ["-V"], + purpose="test: running the tests", + installed=False, + work_dir=self.cached_tests_work_dir, + ) |