diff options
author | Hironori-Yamaji <52182908+Hironori-Yamaji@users.noreply.github.com> | 2019-09-03 23:15:34 +0900 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2019-09-03 09:15:34 -0500 |
commit | 6ea27cabd6391d90b6f7f3780611ceca6dca1e22 (patch) | |
tree | f35731e700dca30760acdeaa244c4d05f308a8f4 | |
parent | da7fed86a825f6ffafd121505053f0b62e5f2155 (diff) | |
download | spack-6ea27cabd6391d90b6f7f3780611ceca6dca1e22.tar.gz spack-6ea27cabd6391d90b6f7f3780611ceca6dca1e22.tar.bz2 spack-6ea27cabd6391d90b6f7f3780611ceca6dca1e22.tar.xz spack-6ea27cabd6391d90b6f7f3780611ceca6dca1e22.zip |
ccs-qcd: new package (#12681)
* ccs-qcd: new package
* ccs-qcd: fix variant and replacement string
-rw-r--r-- | var/spack/repos/builtin/packages/ccs-qcd/package.py | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/ccs-qcd/package.py b/var/spack/repos/builtin/packages/ccs-qcd/package.py new file mode 100644 index 0000000000..5233609c94 --- /dev/null +++ b/var/spack/repos/builtin/packages/ccs-qcd/package.py @@ -0,0 +1,68 @@ +# Copyright 2013-2019 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 * +from spack.error import SpackError + + +def class_validator(pkg_name, variant_name, values): + values = int(values[0]) + if values < 1 or values > 6: + error_msg = ("class: Choose one of the following:\n" + "1 - 8x8x8x32 (default MPI config: 1x1x1)\n" + "2 - 32x32x32x32 (default MPI config: 4x4x4)\n" + "3 - 64x64x64x32 (default MPI config: 8x8x8)\n" + "4 - 160x160x160x160 (default MPI config: 20x20x20)\n" + "5 - 256x256x256x256 (default MPI config: 32x32x32)\n" + "6 - 192x192x192x192 (default MPI config: 24x24x24)") + raise SpackError(error_msg) + + +class CcsQcd(MakefilePackage): + """This program benchmarks the performance of a linear equation solver + with a large sparse coefficient matrix appering in a lattice QCD + probrem. Lattice QCD describes the property of protons, neutrons and + neucleons in terms of more fundamental interacting elementary particles + gluon and quarks.""" + + homepage = "https://github.com/fiber-miniapp/ccs-qcd" + git = "https://github.com/fiber-miniapp/ccs-qcd.git" + + version('master', branch='master') + version('1.2.1', commit='d7c6b6923f35a824e997ba8db5bd12dc20dda45c') + + variant( + 'class', values=int, default=1, + description='This miniapp has five problem classes, for which the' + + ' first three are relatively small problems just for testing' + + ' this miniapp itself. The remaining two are the target problem' + + ' sizes for the HPCI FS evaluation.', + multi=False, validator=class_validator + ) + + depends_on('mpi') + + def edit(self, spec, prefix): + if '%fj' in spec: + filter_file('mpifrtpx', spec['mpi'].mpifc, './src/make.fx10.inc') + filter_file('mpifccpx', spec['mpi'].mpicc, './src/make.fx10.inc') + else: + filter_file('mpif90', spec['mpi'].mpifc, './src/make.gfortran.inc') + filter_file('mpicc', spec['mpi'].mpicc, './src/make.gfortran.inc') + + def build(self, spec, prefix): + ccs_class = 'CLASS=' + spec.variants['class'].value + with working_dir('src'): + make('CONFIG_GEN', ccs_class) + + if '%fj' in spec: + make('MAKE_INC=make.fx10.inc', ccs_class) + else: + make('MAKE_INC=make.gfortran.inc', ccs_class) + + def install(self, spec, prefix): + mkdirp(prefix.bin) + install('./src/ccs_qcd_solver_bench_class' + + spec.variants['class'].value, prefix.bin) |