Add amg2023 package; remove amg package (#39105)

Add amg2023 package

Consolidate existing amg and amg2013 packages (they reference the
same code) under the amg2013 name to minimize confusion between
amg2023 and amg2013.

Co-authored-by: Riyaz Haque <haque1@llnl.gov>
This commit is contained in:
Greg Becker 2023-08-23 19:48:44 -04:00 committed by GitHub
parent a95e061fed
commit 53d2ffaf83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 103 additions and 86 deletions

View File

@ -1,58 +0,0 @@
# Copyright 2013-2023 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.package import *
class Amg(MakefilePackage):
"""AMG is a parallel algebraic multigrid solver for linear systems arising
from problems on unstructured grids. The driver provided with AMG
builds linear systems for various 3-dimensional problems.
"""
tags = ["proxy-app", "ecp-proxy-app"]
homepage = "https://computing.llnl.gov/projects/co-design/amg2013"
git = "https://github.com/LLNL/AMG.git"
version("develop", branch="master")
version("1.2", tag="1.2")
version("1.1", tag="1.1")
version("1.0", tag="1.0")
variant("openmp", default=True, description="Build with OpenMP support")
variant("optflags", default=False, description="Additional optimizations")
variant("int64", default=False, description="Use 64-bit integers for global variables")
depends_on("mpi")
@property
def build_targets(self):
targets = []
include_cflags = ["-DTIMER_USE_MPI"]
include_lflags = ["-lm"]
if "+openmp" in self.spec:
include_cflags.append("-DHYPRE_USING_OPENMP")
include_cflags.append(self.compiler.openmp_flag)
include_lflags.append(self.compiler.openmp_flag)
if "+optflags" in self.spec:
include_cflags.append("-DHYPRE_USING_PERSISTENT_COMM")
include_cflags.append("-DHYPRE_HOPSCOTCH")
if "+int64" in self.spec:
include_cflags.append("-DHYPRE_BIGINT")
targets.append("INCLUDE_CFLAGS={0}".format(" ".join(include_cflags)))
targets.append("INCLUDE_LFLAGS={0}".format(" ".join(include_lflags)))
targets.append("CC={0}".format(self.spec["mpi"].mpicc))
return targets
def install(self, spec, prefix):
mkdirp(prefix.bin)
install("test/amg", prefix.bin)
install_tree("docs", prefix.docs)

View File

@ -7,29 +7,23 @@
class Amg2013(MakefilePackage):
"""AMG2013 is a parallel algebraic multigrid solver for linear
systems arising from problems on unstructured grids.
It has been derived directly from the BoomerAMG solver in the
hypre library, a large linear solver library that is being developed
in the Center for Applied Scientific Computing (CASC) at LLNL.
"""AMG is a parallel algebraic multigrid solver for linear systems arising
from problems on unstructured grids. The driver provided with AMG
builds linear systems for various 3-dimensional problems.
"""
tags = ["proxy-app"]
homepage = "https://computing.llnl.gov/projects/co-design/amg2013"
url = "https://computing.llnl.gov/projects/co-design/download/amg2013.tgz"
tags = ["proxy-app", "ecp-proxy-app"]
version(
"master",
sha256="b03771d84a04e3dbbbe32ba5648cd7b789e5853b938dd501e17d23d43f13c50f",
url="https://computing.llnl.gov/projects/co-design/download/amg2013.tgz",
)
homepage = "https://computing.llnl.gov/projects/co-design/amg2013"
git = "https://github.com/LLNL/AMG.git"
version("develop", branch="master")
version("1.2", tag="1.2")
version("1.1", tag="1.1")
version("1.0", tag="1.0")
variant("openmp", default=True, description="Build with OpenMP support")
variant(
"assumedpartition",
default=False,
description="Use assumed partition (for thousands of processors)",
)
variant("optflags", default=False, description="Additional optimizations")
variant("int64", default=False, description="Use 64-bit integers for global variables")
depends_on("mpi")
@ -45,12 +39,12 @@ def build_targets(self):
include_cflags.append("-DHYPRE_USING_OPENMP")
include_cflags.append(self.compiler.openmp_flag)
include_lflags.append(self.compiler.openmp_flag)
if "+assumedpartition" in self.spec:
include_cflags.append("-DHYPRE_NO_GLOBAL_PARTITION")
if "+optflags" in self.spec:
include_cflags.append("-DHYPRE_USING_PERSISTENT_COMM")
include_cflags.append("-DHYPRE_HOPSCOTCH")
if "+int64" in self.spec:
include_cflags.append("-DHYPRE_LONG_LONG")
include_cflags.append("-DHYPRE_BIGINT")
targets.append("INCLUDE_CFLAGS={0}".format(" ".join(include_cflags)))
targets.append("INCLUDE_LFLAGS={0}".format(" ".join(include_lflags)))
@ -60,7 +54,5 @@ def build_targets(self):
def install(self, spec, prefix):
mkdirp(prefix.bin)
install("test/amg2013", prefix.bin)
install("test/amg", prefix.bin)
install_tree("docs", prefix.docs)
install("COPYRIGHT", prefix.docs)
install("COPYING.LESSER", prefix.docs)

View File

@ -0,0 +1,83 @@
# Copyright 2013-2023 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.package import *
class Amg2023(MakefilePackage):
"""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.27.0 or higher.
"""
tags = ["benchmark"]
homepage = "https://github.com/LLNL/AMG2023"
git = "https://github.com/LLNL/AMG2023.git"
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")
variant("adiak", default=False, description="Enable Adiak metadata gathering")
depends_on("caliper", when="+caliper")
depends_on("adiak", when="+adiak")
depends_on("hypre+caliper", when="+caliper")
depends_on("hypre@2.27.0:")
depends_on("mpi", when="+mpi")
def flag_handler(self, name, flags):
if name == "ldlibs":
if self.spec.satisfies("+caliper"):
flags.append("-lcaliper")
if self.spec.satisfies("+adiak"):
flags.append("-ladiak")
return (flags, None, None)
def edit(self, spec, prefix):
makefile = FileFilter("Makefile")
if "+mpi" in spec:
makefile.filter(r"CC\s*=.*", f"CC = {spec['mpi'].mpicc}")
makefile.filter(r"CXX\s*=.*", f"CXX = {spec['mpi'].mpicxx}")
makefile.filter(r"#MPIPATH = .*", f"MPIPATH = {spec['mpi'].prefix}")
makefile.filter(r"#MPIINCLUDE", "MPIINCLUDE")
if spec["mpi"].extra_attributes and "ldflags" in spec["mpi"].extra_attributes:
makefile.filter(
"#MPILIBS = .*",
"MPILIBS = {0}".format(spec["mpi"].extra_attributes["ldflags"]),
)
else:
makefile.filter("#MPILIBDIRS", "MPILIBDIRS")
makefile.filter("#MPILIBS", "MPILIBS")
makefile.filter("#MPIFLAGS", "MPIFLAGS")
else:
makefile.filter(r"CC\s*=.*", "CC = {0}".format(spack_cc))
makefile.filter(r"CXX\s*=.*", "CXX = {0}".format(spack_cxx))
makefile.filter(r"HYPRE_DIR = .*", f'HYPRE_DIR = {spec["hypre"].prefix}')
if spec["hypre"].satisfies("+cuda"):
makefile.filter(
"HYPRE_CUDA_PATH = .*", "HYPRE_CUDA_PATH = %s" % (spec["cuda"].prefix)
)
makefile.filter("HYPRE_CUDA_INCLUDE = #", "HYPRE_CUDA_INCLUDE = ")
makefile.filter("HYPRE_CUDA_LIBS = #", "HYPRE_CUDA_LIBS = ")
makefile.filter("HYPRE_HIP_PATH =", "#HYPRE_HIP_PATH =")
makefile.filter("HYPRE_HIP_INCLUDE =", "#HYPRE_HIP_INCLUDE =")
makefile.filter("HYPRE_HIP_LIBS =", "#HYPRE_HIP_LIBS =")
if spec["hypre"].satisfies("+rocm"):
makefile.filter("HYPRE_HIP_PATH = .*", "HYPRE_HIP_PATH = ${ROCM_PATH}")
else:
makefile.filter("HYPRE_HIP_PATH =", "#HYPRE_HIP_PATH =")
makefile.filter("HYPRE_HIP_INCLUDE =", "#HYPRE_HIP_INCLUDE =")
makefile.filter("HYPRE_HIP_LIBS =", "#HYPRE_HIP_LIBS =")
def install(self, spec, prefix):
make()
mkdirp(prefix.bin)
install("amg", prefix.bin)

View File

@ -43,7 +43,7 @@ class EcpProxyApps(BundlePackage):
depends_on("laghos@3.0", when="@3.0:")
# Added with release 2.1
depends_on("amg@1.2", when="@2.1:")
depends_on("amg2013@1.2", when="@2.1:")
depends_on("miniamr@1.4.3", when="@2.1")
# Added with release 2.0
@ -60,7 +60,7 @@ class EcpProxyApps(BundlePackage):
depends_on("xsbench@18", when="@2.0:2.1")
# Dependencies for version 2.0
depends_on("amg@1.1", when="@2.0")
depends_on("amg2013@1.1", when="@2.0")
depends_on("miniamr@1.4.1", when="@2.0:2.1")
# Added with release 1.1
@ -70,7 +70,7 @@ class EcpProxyApps(BundlePackage):
depends_on("swfft@1.0", when="@1.0:")
# Dependencies for versions 1.0:1.1
depends_on("amg@1.0", when="@1.0:1.1")
depends_on("amg2013@1.0", when="@1.0:1.1")
depends_on("candle-benchmarks@0.0", when="+candle @1.0:1.1")
depends_on("laghos@1.0", when="@1.0:1.1")
depends_on("macsio@1.0", when="@1.0:1.1")