summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJoe Kaushal <joe.kaushal@gmail.com>2022-01-18 16:20:33 +0000
committerGitHub <noreply@github.com>2022-01-18 09:20:33 -0700
commit58c598ffe6a63ba62e19987ff9ed15d4cfd078e6 (patch)
tree0053257eb4075b714a490e6aa930fbeec4177e63 /var
parent2f7a32a74ddbba942ab0060d25993153fbcc5140 (diff)
downloadspack-58c598ffe6a63ba62e19987ff9ed15d4cfd078e6.tar.gz
spack-58c598ffe6a63ba62e19987ff9ed15d4cfd078e6.tar.bz2
spack-58c598ffe6a63ba62e19987ff9ed15d4cfd078e6.tar.xz
spack-58c598ffe6a63ba62e19987ff9ed15d4cfd078e6.zip
new package: op2-dsl (#28396)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/op2-dsl/package.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/op2-dsl/package.py b/var/spack/repos/builtin/packages/op2-dsl/package.py
new file mode 100644
index 0000000000..9679404d5c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/op2-dsl/package.py
@@ -0,0 +1,58 @@
+# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class Op2Dsl(MakefilePackage, CudaPackage):
+ """OP2 is a high-level embedded domain specific language for writing
+ unstructured mesh algorithms with automatic parallelisation on multi-core
+ and many-core architectures."""
+
+ homepage = "https://op-dsl.github.io/"
+ git = "https://github.com/OP-DSL/OP2-Common.git"
+
+ maintainers = ['gihanmudalige', 'reguly', 'bozbez']
+
+ version('master', branch='master')
+ version('1.1.0', tag='v1.1.0')
+
+ build_directory = 'op2'
+
+ variant('mpi', default=False, description='Enable MPI support')
+
+ variant('parmetis', default=True, when='+mpi',
+ description='Enable ParMETIS partitioning support')
+
+ variant('scotch', default=True, when='+mpi',
+ description='Enable PT-Scotch partitioning support')
+
+ depends_on('mpi', when='+mpi')
+
+ depends_on('parmetis', when='+parmetis')
+ depends_on('scotch', when='+scotch')
+
+ depends_on('hdf5+fortran+mpi', when='+mpi')
+ depends_on('hdf5+fortran~mpi', when='~mpi')
+
+ def edit(self, spec, prefix):
+ compiler_map = {
+ 'gcc': 'gnu',
+ 'cce': 'cray',
+ 'intel': 'intel',
+ 'nvhpc': 'nvhpc',
+ 'xl': 'xl',
+ }
+
+ if self.spec.compiler.name in compiler_map:
+ env['OP2_COMPILER'] = compiler_map[self.spec.compiler.name]
+
+ if '+cuda' in self.spec and spec.variants['cuda_arch'].value[0] != 'none':
+ env['CUDA_GEN'] = ','.join(spec.variants['cuda_arch'].value)
+
+ def install(self, spec, prefix):
+ install_tree('op2/lib', prefix.lib)
+ install_tree('op2/include', prefix.include)
+ install_tree('op2/mod', prefix.mod)