* add amgx package

* add amgx variants for mkl and magma support

* fix typo in cmake option

* flake8 fix formatting

* Apply suggestions from code review - use mkl virtual provider

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* Apply suggestions from code review - fix copypasta

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Jeffrey Salmond 2020-04-28 20:36:55 +01:00 committed by GitHub
parent 00d83cd79d
commit 703111c01b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,58 @@
# Copyright 2013-2020 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 Amgx(CMakePackage, CudaPackage):
"""AmgX provides a simple path to accelerated core solver technology on
NVIDIA GPUs. AmgX provides up to 10x acceleration to the computationally
intense linear solver portion of simulations, and is especially well
suited for implicit unstructured methods. It is a high performance,
state-of-the-art library and includes a flexible solver composition
system that allows a user to easily construct complex nested solvers and
preconditioners."""
homepage = "https://developer.nvidia.com/amgx"
url = "https://github.com/nvidia/amgx/archive/v2.1.0.tar.gz"
maintainers = ['js947']
version('2.1.0', sha256='6245112b768a1dc3486b2b3c049342e232eb6281a6021fffa8b20c11631f63cc')
version('2.0.1', sha256='6f9991f1836fbf4ba2114ce9f49febd0edc069a24f533bd94fd9aa9be72435a7')
version('2.0.0', sha256='8ec7ea8412be3de216fcf7243c4e2a8bcf76878e6865468e4238630a082a431b')
variant('cuda', default=True, description='Build with CUDA')
variant('mpi', default=True, description='Enable MPI support')
variant('mkl', default=False, description='Enable MKL support')
variant('magma', default=False, description='Enable Magma support')
depends_on('mpi', when='+mpi')
depends_on('mkl', when='+mkl')
depends_on('magma', when='+magma')
def cmake_args(self):
args = []
args.append("-DCMAKE_NO_MPI={0}".format(
'1' if '+mpi' not in self.spec else '0'))
if '+cuda' in self.spec:
args.append('-DWITH_CUDA=ON')
cuda_arch = self.spec.variants['cuda_arch'].value
if cuda_arch is not None:
args.append('-DCUDA_ARCH={0}'.format(cuda_arch[0]))
else:
args.append('-DWITH_CUDA=OFF')
if '+mkl' in self.spec:
args.append('-DMKL_ROOT_DIR={0}'.format(
self.spec['mkl'].prefix))
if '+magma' in self.spec:
args.append('-DMAGMA_ROOT_DIR={0}'.format(
self.spec['magma'].prefix))
return args