Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/docker_build_tpls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ jobs:
TPL_DOCKERFILE: docker/tpl-ubuntu-gcc.Dockerfile
DOCKER_COMPILER_BUILD_ARG: "--build-arg GCC_MAJOR_VERSION=12"
RUNS_ON: ubuntu-latest
- name: Ubuntu (22.04, gcc 12.3.0, open-mpi 4.1.2, +hypredrive)
DOCKER_ROOT_IMAGE: ubuntu:22.04
DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc12-hypredrive
TPL_DOCKERFILE: docker/tpl-ubuntu-gcc.Dockerfile
DOCKER_COMPILER_BUILD_ARG: "--build-arg GCC_MAJOR_VERSION=12"
SPEC: "~pygeosx +docs +hypredrive %gcc-12"
RUNS_ON: ubuntu-latest
- name: Ubuntu (22.04, clang 15.0.7 + gcc 11.4.0, open-mpi 4.1.2)
DOCKER_ROOT_IMAGE: ubuntu:22.04
DOCKER_REPOSITORY: geosx/ubuntu22.04-clang15
Expand Down
7 changes: 7 additions & 0 deletions docker/rocky-spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ spack:
packages:
all:
target: [x86_64]
providers:
zlib-api: [zlib]

mpi:
require:
Expand Down Expand Up @@ -150,3 +152,8 @@ spack:
externals:
- spec: [email protected]
prefix: /usr
zlib:
buildable: false
externals:
- spec: [email protected]
prefix: /usr
4 changes: 4 additions & 0 deletions docker/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ spack:
require:
- [email protected]

zlib-api:
require:
- zlib

blas:
require:
- "netlib-lapack"
Expand Down
7 changes: 5 additions & 2 deletions docker/tpl-rockylinux-clang-cuda-12.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh
FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain
ARG SRC_DIR
ARG BLD_DIR
ARG SPEC

RUN dnf -y install \
tbb-devel \
Expand Down Expand Up @@ -79,9 +80,11 @@ RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \
# Create symlinks to blas/lapack libraries
ln -s /usr/lib64/libblas.so.3 /usr/lib64/libblas.so && \
ln -s /usr/lib64/liblapack.so.3 /usr/lib64/liblapack.so && \
GEOSX_SPEC="${SPEC}" && \
if [ -z "${GEOSX_SPEC}" ] || [ "${GEOSX_SPEC}" = "undefined" ]; then GEOSX_SPEC="+cuda~uncrustify~openmp~pygeosx cuda_arch=86 %clang-17 ^[email protected]+allow-unsupported-compilers ^caliper~gotcha~sampler~libunwind~libdw~papi"; fi && \
scl enable gcc-toolset-13 ' \
./scripts/uberenv/uberenv.py \
--spec "+cuda~uncrustify~openmp~pygeosx cuda_arch=86 %clang-17 ^[email protected]+allow-unsupported-compilers ^caliper~gotcha~sampler~libunwind~libdw~papi" \
--spec "'"${GEOSX_SPEC}"'" \
--spack-env-file=${SRC_DIR}/docker/rocky-spack.yaml \
--project-json=.uberenv_config.json \
--prefix ${GEOSX_TPL_DIR} \
Expand Down Expand Up @@ -126,4 +129,4 @@ RUN dnf clean all && \

# Run the installation script
RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-sccache.sh
ENV SCCACHE=/opt/sccache/bin/sccache
ENV SCCACHE=/opt/sccache/bin/sccache
5 changes: 4 additions & 1 deletion docker/tpl-rockylinux-gcc-cuda-12.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh
FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain
ARG SRC_DIR
ARG BLD_DIR
ARG SPEC

# Install additional required packages
RUN dnf clean all && \
Expand All @@ -66,8 +67,10 @@ RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \
# Create symlinks to blas/lapack libraries
ln -s /usr/lib64/libblas.so.3 /usr/lib64/libblas.so && \
ln -s /usr/lib64/liblapack.so.3 /usr/lib64/liblapack.so && \
GEOSX_SPEC="${SPEC}" && \
if [ -z "${GEOSX_SPEC}" ] || [ "${GEOSX_SPEC}" = "undefined" ]; then GEOSX_SPEC="+cuda~uncrustify~openmp~pygeosx lai=hypre cuda_arch=86 %gcc-13 ^[email protected]+allow-unsupported-compilers ^caliper~gotcha~sampler~libunwind~libdw~papi"; fi && \
./scripts/uberenv/uberenv.py \
--spec "+cuda~uncrustify~openmp~pygeosx lai=hypre cuda_arch=86 %gcc-13 ^[email protected]+allow-unsupported-compilers ^caliper~gotcha~sampler~libunwind~libdw~papi" \
--spec "${GEOSX_SPEC}" \
--spack-env-file=${SRC_DIR}/docker/rocky-spack.yaml \
--project-json=.uberenv_config.json \
--prefix ${GEOSX_TPL_DIR} \
Expand Down
7 changes: 5 additions & 2 deletions docker/tpl-ubuntu-clang-cuda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh
FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain
ARG SRC_DIR
ARG BLD_DIR
ARG SPEC

RUN apt-get install -y --no-install-recommends \
libtbb-dev \
Expand All @@ -61,9 +62,11 @@ RUN apt-get install -y --no-install-recommends \
# -k flag is to ignore SSL errors
RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \
mkdir -p ${GEOSX_TPL_DIR} && \
GEOSX_SPEC="${SPEC}" && \
if [ -z "${GEOSX_SPEC}" ] || [ "${GEOSX_SPEC}" = "undefined" ]; then GEOSX_SPEC="+cuda~uncrustify~openmp~pygeosx cuda_arch=86 %clang-10 ^[email protected]+allow-unsupported-compilers ^caliper~gotcha~sampler~libunwind~libdw~papi"; fi && \
./scripts/uberenv/uberenv.py \
--spec "+cuda~uncrustify~openmp~pygeosx cuda_arch=86 %clang-10 ^[email protected]+allow-unsupported-compilers ^caliper~gotcha~sampler~libunwind~libdw~papi" \
--spack-env-file=${SRC_DIR}/docker/ubuntu20-clang-cuda-spack.yaml \
--spec "${GEOSX_SPEC}" \
--spack-env-file=${SRC_DIR}/docker/ubuntu20-clang-cuda-spack.yaml \
--project-json=.uberenv_config.json \
--prefix ${GEOSX_TPL_DIR} \
-k && \
Expand Down
5 changes: 4 additions & 1 deletion docker/tpl-ubuntu-clang.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh
FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain
ARG SRC_DIR
ARG BLD_DIR
ARG SPEC

ARG GCC_MAJOR_VERSION

Expand Down Expand Up @@ -87,8 +88,10 @@ RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \
mkdir -p ${GEOSX_TPL_DIR} && \
# Create symlinks to g++ libraries
ln -s /usr/bin/g++-${GCC_MAJOR_VERSION} /usr/bin/g++ && \
GEOSX_SPEC="${SPEC}" && \
if [ -z "${GEOSX_SPEC}" ] || [ "${GEOSX_SPEC}" = "undefined" ]; then GEOSX_SPEC="~shared~openmp+docs %clang-${CLANG_MAJOR_VERSION} ^caliper~gotcha~sampler~libunwind~libdw~papi"; fi && \
./scripts/uberenv/uberenv.py \
--spec "~shared~openmp+docs %clang-${CLANG_MAJOR_VERSION} ^caliper~gotcha~sampler~libunwind~libdw~papi" \
--spec "${GEOSX_SPEC}" \
--spack-env-file=${SRC_DIR}/docker/spack.yaml \
--project-json=.uberenv_config.json \
--prefix ${GEOSX_TPL_DIR} \
Expand Down
5 changes: 4 additions & 1 deletion docker/tpl-ubuntu-gcc.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ ENV OMPI_CC=$CC \
FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain
ARG SRC_DIR
ARG BLD_DIR
ARG SPEC

# This is the version from the `docker build` command line.
# It is repeated because docker forgets about the ARGs after FROM statements.
Expand All @@ -110,8 +111,10 @@ RUN apt-get install -y --no-install-recommends \
# -k flag is to ignore SSL errors
RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \
mkdir -p ${GEOSX_TPL_DIR} && \
GEOSX_SPEC="${SPEC}" && \
if [ -z "${GEOSX_SPEC}" ] || [ "${GEOSX_SPEC}" = "undefined" ]; then GEOSX_SPEC="~pygeosx +docs %gcc-${GCC_MAJOR_VERSION}"; fi && \
./scripts/uberenv/uberenv.py \
--spec "~pygeosx +docs %gcc-${GCC_MAJOR_VERSION}" \
--spec "${GEOSX_SPEC}" \
--spack-env-file=${SRC_DIR}/docker/spack.yaml \
--project-json=${SRC_DIR}/.uberenv_config.json \
--prefix ${GEOSX_TPL_DIR} \
Expand Down
5 changes: 4 additions & 1 deletion docker/ubuntu20-clang-cuda-spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ spack:
require:
- [email protected]

zlib-api:
require:
- zlib

blas:
require:
- "netlib-lapack"
Expand Down Expand Up @@ -161,4 +165,3 @@ spack:
externals:
- spec: [email protected]
prefix: /usr

5 changes: 5 additions & 0 deletions scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ spack:
mpi:
require:
- spectrum-mpi

zlib-api:
require:
- zlib

blas:
require:
- essl
Expand Down
1 change: 1 addition & 0 deletions scripts/spack_configs/darwin/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ packages:
mpi: [openmpi]
blas: [netlib-lapack]
lapack: [netlib-lapack]
zlib-api: [zlib]

openmpi:
buildable: False
Expand Down
1 change: 1 addition & 0 deletions scripts/spack_configs/macOS/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ spack:
mpi: [openmpi]
blas: [openblas]
lapack: [openblas]
zlib-api: [zlib]
variants: "~openmp"

openblas:
Expand Down
5 changes: 5 additions & 0 deletions scripts/spack_configs/pangea-4/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ spack:
require:
- hpcx-mpi
buildable: false

zlib-api:
require:
- zlib

blas:
require:
- "intel-oneapi-mkl"
Expand Down
1 change: 1 addition & 0 deletions scripts/spack_configs/summit/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ packages:
mpi: [spectrum-mpi]
blas: [openblas]
lapack: [openblas]
zlib-api: [zlib]

openblas:
buildable: False
Expand Down
1 change: 1 addition & 0 deletions scripts/spack_configs/summit_python/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ packages:
mpi: [spectrum-mpi]
blas: [openblas]
lapack: [openblas]
zlib-api: [zlib]

openblas:
buildable: False
Expand Down
4 changes: 4 additions & 0 deletions scripts/spack_configs/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ packages:
hypre:
require: "@git.8b0093306228fef1b92384d9face7fbe5a63b460=master"

# master - 03/28/26
hypredrive:
require: "@git.d062c48cc8d26a9bee92f33f3c588d071c230d30=master"

# master - 04/12/20
uncrustify:
require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2"
9 changes: 9 additions & 0 deletions scripts/spack_packages/packages/geosx/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Geosx(CMakePackage, CudaPackage, ROCmPackage):
variant('vtk', default=True, description='Build VTK support.')
variant('trilinos', default=True, description='Build Trilinos support.')
variant('hypre', default=True, description='Build HYPRE support.')
variant('hypredrive', default=False, description='Build hypredrive support.')
variant('petsc', default=False, description='Build PETSc support.')
variant('scotch', default=True, description='Build Scotch support.')
variant('uncrustify', default=True, description='Build Uncrustify support.')
Expand Down Expand Up @@ -188,6 +189,11 @@ class Geosx(CMakePackage, CudaPackage, ROCmPackage):
depends_on("hypre +pic", when="~shared")
depends_on("hypre +shared", when="+shared")

with when("+hypredrive"):
depends_on("hypredrive +pic", when="~shared")
depends_on("hypredrive +shared", when="+shared")
depends_on("hypredrive +caliper", when="+caliper")

depends_on('[email protected]~hdf5~hypre+int64', when='+petsc')
depends_on('petsc+ptscotch', when='+petsc+scotch')

Expand Down Expand Up @@ -579,6 +585,7 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None):
('suite-sparse', 'SUITESPARSE', True),
('trilinos', 'TRILINOS', '+trilinos' in spec),
('hypre', 'HYPRE', '+hypre' in spec),
('hypredrive', 'HYPREDRV', '+hypredrive' in spec),
('petsc', 'PETSC', '+petsc' in spec)
)
# yapf: enable
Expand All @@ -588,6 +595,8 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None):
cfg.write('#{0}\n\n'.format('-' * 80))
for tpl, cmake_name, enable in math_tpls:
if enable:
if tpl == 'hypredrive':
cfg.write(cmake_cache_option('ENABLE_HYPREDRV', True))
cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix))

if tpl == 'hypre' and '+cuda' in spec:
Expand Down
105 changes: 105 additions & 0 deletions scripts/spack_packages/packages/hypredrive/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack_repo.builtin.build_systems.cmake import CMakePackage

from spack.package import *


class Hypredrive(CMakePackage):
"""Hypredrive is a high-level interface to the hypre library for solving
sparse linear systems of equations. It provides a command-line driver
(hypredrive-cli) accepting YAML input files and a C API library
(libHYPREDRV)."""

homepage = "https://hypredrive.readthedocs.io"
url = "https://github.com/hypre-space/hypredrive/archive/v0.1.0.tar.gz"
git = "https://github.com/hypre-space/hypredrive.git"

maintainers("victorapm")

license("MIT", checked_by="victorapm")

version("develop", branch="master")
version("0.2.0", sha256="2fe6c5b2779de41fbd294cb4647c7bbd210ec95934639117e56a790e56c32e41")
version("0.1.0", sha256="39db73b75e37457035c64b4c8831abe716bf2f596c4ca79a32293d9bd51ca8d6")

variant("shared", default=False, description="Build shared libraries")
variant("pic", default=False, description="Build position independent code")
variant("examples", default=False, description="Build and install example programs")
variant("hwloc", default=False, description="Enable hwloc support for system topology")
variant("caliper", default=False, description="Enable Caliper performance profiling")
variant("compression", default=False, description="Enable lossless compression backends")

depends_on("c", type="build")
depends_on("cxx", type="build", when="+caliper")

depends_on("[email protected]:", type="build")
depends_on("mpi")
depends_on("[email protected]: +mpi")
depends_on("hwloc", when="+hwloc")
depends_on("caliper", when="+caliper")
depends_on("zlib-api", when="+compression")
depends_on("zstd", when="+compression")
depends_on("lz4", when="+compression")

def cmake_args(self):
spec = self.spec
from_variant = self.define_from_variant

args = [
from_variant("BUILD_SHARED_LIBS", "shared"),
from_variant("HYPREDRV_ENABLE_EXAMPLES", "examples"),
from_variant("HYPREDRV_ENABLE_HWLOC", "hwloc"),
from_variant("HYPREDRV_ENABLE_CALIPER", "caliper"),
from_variant("HYPREDRV_ENABLE_COMPRESSION", "compression"),
from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
self.define("HYPRE_ROOT", spec["hypre"].prefix),
self.define("HYPREDRV_ENABLE_TESTING", self.run_tests),
self.define("HYPREDRV_ENABLE_COVERAGE", False),
self.define("HYPREDRV_ENABLE_ANALYSIS", False),
self.define("HYPREDRV_ENABLE_DOCS", False),
]

return args

@property
def headers(self):
"""Export the main HYPREDRV header.
Sample usage: spec['hypredrive'].headers.cpp_flags
"""
hdrs = find_headers("HYPREDRV", self.prefix.include, recursive=False)
return hdrs or None

@property
def libs(self):
"""Export the HYPREDRV library.
Sample usage: spec['hypredrive'].libs.ld_flags
"""
is_shared = self.spec.satisfies("+shared")
libs = find_libraries("libHYPREDRV", root=self.prefix, shared=is_shared, recursive=True)
return libs or None

def test_installed_binary(self):
"""verify hypredrive-cli binary exists"""
hypredrive_cli = which(self.prefix.bin.join("hypredrive-cli"))
if hypredrive_cli is None:
raise SkipTest("hypredrive-cli not found in install prefix")

def test_installed_library(self):
"""verify HYPREDRV library is findable"""
if not self.libs:
raise RuntimeError("Could not find libHYPREDRV in install prefix")

def test_laplacian_example(self):
"""run the laplacian example (requires +examples)"""
if not self.spec.satisfies("+examples"):
raise SkipTest("Package must be installed with +examples")

laplacian = which(self.prefix.bin.laplacian)
if laplacian is None:
raise SkipTest("laplacian example binary not found")

mpirun = which("mpirun", "mpiexec", required=True)
mpirun("-np", "1", laplacian, "-n", "6", "6", "6", "-s", "7", "-ns", "1", "-v", "1")
Loading