-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright 2023 Lawrence Livermore National Security, LLC and other | ||
# Benchpark Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from spack.package import * | ||
|
||
|
||
class Amg2023(CMakePackage, CudaPackage, ROCmPackage): | ||
"""AMG2023 is a parallel algebraic multigrid solver for linear systems | ||
arising from problems on unstructured grids. The driver provided here | ||
builds linear systems for various 3-dimensional problems. It requires | ||
an installation of hypre-2.31.0 or higher. | ||
""" | ||
|
||
tags = ["benchmark"] | ||
homepage = "https://github.com/LLNL/AMG2023" | ||
git = "https://github.com/LLNL/AMG2023.git" | ||
|
||
license("Apache-2.0") | ||
|
||
version("develop", branch="main") | ||
|
||
variant("mpi", default=True, description="Enable MPI support") | ||
variant("openmp", default=False, description="Enable OpenMP support") | ||
variant("caliper", default=False, description="Enable Caliper monitoring") | ||
|
||
depends_on("mpi", when="+mpi") | ||
depends_on("hypre+mpi", when="+mpi") | ||
requires("+mpi", when="^hypre+mpi") | ||
depends_on("caliper", when="+caliper") | ||
depends_on("adiak", when="+caliper") | ||
depends_on("hypre+caliper", when="+caliper") | ||
depends_on("[email protected]:") | ||
depends_on("hypre+cuda", when="+cuda") | ||
requires("+cuda", when="^hypre+cuda") | ||
depends_on("hypre+rocm", when="+rocm") | ||
requires("+rocm", when="^hypre+rocm") | ||
|
||
def cmake_args(self): | ||
cmake_options = [] | ||
cmake_options.append(self.define_from_variant("AMG_WITH_CALIPER", "caliper")) | ||
cmake_options.append(self.define_from_variant("AMG_WITH_OMP", "openmp")) | ||
cmake_options.append(self.define("HYPRE_PREFIX", self.spec["hypre"].prefix)) | ||
if self.spec["hypre"].satisfies("+cuda"): | ||
cmake_options.append("-DAMG_WITH_CUDA=ON") | ||
if self.spec["hypre"].satisfies("+rocm"): | ||
cmake_options.append("-DAMG_WITH_HIP=ON") | ||
if self.spec["hypre"].satisfies("+mpi"): | ||
cmake_options.append("-DAMG_WITH_MPI=ON") | ||
|
||
return cmake_options |