Skip to content
Open
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
46 changes: 25 additions & 21 deletions .github/hubcast.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
Repo:
# Required: organization or user that owns the repo on CZ GitLab
dest_org: sundials

# Required: name of the destination repository on CZ GitLab
dest_name: sundials

# Optional: name of the CI check as reported back to GitHub (default: gitlab-ci)
check_name: llnl-lc-gitlab-ci

# Optional: granularity of CI statuses reported to GitHub (default: [pipeline])
# Set to [pipeline] for overall pipeline status only
# Set to [jobs] for individual job statuses only
# Set to [pipeline, jobs] to report both
check_types: [pipeline, jobs]

# Optional: delete branches from destination when source PR is closed (default: true)
delete_closed: true

# Optional: sync draft PRs/MRs (default: true)
sync_drafts: true
# Hubcast configuration is disabled; CI runs on GitHub-hosted resources only.
# To re-enable mirroring to LLNL CZ GitLab (and the llnl-lc-gitlab-ci checks
# on LLNL clusters), uncomment the block below.
#
# Repo:
# # Required: organization or user that owns the repo on CZ GitLab
# dest_org: sundials
#
# # Required: name of the destination repository on CZ GitLab
# dest_name: sundials
#
# # Optional: name of the CI check as reported back to GitHub (default: gitlab-ci)
# check_name: llnl-lc-gitlab-ci
#
# # Optional: granularity of CI statuses reported to GitHub (default: [pipeline])
# # Set to [pipeline] for overall pipeline status only
# # Set to [jobs] for individual job statuses only
# # Set to [pipeline, jobs] to report both
# check_types: [pipeline, jobs]
#
# # Optional: delete branches from destination when source PR is closed (default: true)
# delete_closed: true
#
# # Optional: sync draft PRs/MRs (default: true)
# sync_drafts: true
3 changes: 2 additions & 1 deletion cmake/SundialsSetupCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@ if(SUNDIALS_ENABLE_BENCHMARKS
OR SUNDIALS_ENABLE_MAGMA
OR SUNDIALS_ENABLE_GINKGO
OR SUNDIALS_ENABLE_KOKKOS
OR SUNDIALS_ENABLE_ADIAK)
OR SUNDIALS_ENABLE_ADIAK
OR SUNDIALS_ENABLE_RESOLVE)
include(SundialsSetupCXX)
endif()

Expand Down
9 changes: 9 additions & 0 deletions cmake/SundialsSetupTPLs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ if(SUNDIALS_ENABLE_RAJA)
list(APPEND SUNDIALS_TPL_LIST "RAJA")
endif()

# ---------------------------------------------------------------
# Find (and test) the ReSolve libraries
# ---------------------------------------------------------------

if(SUNDIALS_ENABLE_RESOLVE)
include(SundialsReSolve)
list(APPEND SUNDIALS_TPL_LIST "RESOLVE")
endif()

# ---------------------------------------------------------------
# Find (and test) the SuperLUDIST libraries
# ---------------------------------------------------------------
Expand Down
18 changes: 18 additions & 0 deletions cmake/SundialsTPLOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,21 @@ sundials_option(
DEPRECATED_NAMES
KOKKOS_KERNELS_WORKS
NEGATE_DEPRECATED)

# ---------------------------------------------------------------
# Enable ReSolve support?
# ---------------------------------------------------------------

sundials_option(SUNDIALS_ENABLE_RESOLVE BOOL "Enable ReSolve support" OFF)

sundials_option(ReSolve_DIR PATH "Path to the root of a ReSolve installation"
"${ReSolve_DIR}")

sundials_option(ReSolve_INCLUDE_DIR PATH "ReSolve include directory"
"${ReSolve_INCLUDE_DIR}" ADVANCED)

sundials_option(ReSolve_LIBRARY_DIR PATH "ReSolve library directory"
"${ReSolve_LIBRARY_DIR}" ADVANCED)

sundials_option(SUNDIALS_ENABLE_RESOLVE_CHECKS BOOL
"Enable ReSolve compatibility checks" ON ADVANCED)
106 changes: 106 additions & 0 deletions cmake/tpl/FindReSolve.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# ------------------------------------------------------------------------------
# Programmer(s): Slaven Peles @ ORNL
# ------------------------------------------------------------------------------
# SUNDIALS Copyright Start
# Copyright (c) 2025-2026, Lawrence Livermore National Security,
# University of Maryland Baltimore County, and the SUNDIALS contributors.
# Copyright (c) 2013-2025, Lawrence Livermore National Security
# and Southern Methodist University.
# Copyright (c) 2002-2013, Lawrence Livermore National Security.
# All rights reserved.
#
# See the top-level LICENSE and NOTICE files for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# SUNDIALS Copyright End
# ------------------------------------------------------------------------------
# ReSolve find module that creates an imported target for ReSolve.
# The target is SUNDIALS::ReSolve.
#
# The variable ReSolve_DIR can be used to control where the module
# looks for the library (path to the root of a ReSolve installation or
# to a directory containing ReSolveConfig.cmake).
#
# The variable ReSolve_INCLUDE_DIR can be used to set the include path.
# The variable ReSolve_LIBRARY_DIR can be used to set the library path.
#
# This module also defines variables, but it is best to use the defined
# target to ensure includes and compile/link options are correctly passed
# to consumers.
#
# ReSolve_FOUND - system has the ReSolve library
# ReSolve_LIBRARY - the ReSolve library
# ReSolve_INCLUDE_DIR - the ReSolve include path
# ReSolve_LIBRARIES - all libraries needed for ReSolve
# ------------------------------------------------------------------------------

# Prefer the upstream CMake config file if the user did not point to a specific
# include/library directory.
if(NOT
(ReSolve_INCLUDE_DIR
OR ReSolve_LIBRARY_DIR
OR ReSolve_LIBRARY))

find_package(
ReSolve
CONFIG
QUIET
PATHS
"${ReSolve_DIR}"
PATH_SUFFIXES
lib/cmake/ReSolve
cmake/ReSolve)

if(ReSolve_FOUND AND TARGET ReSolve::ReSolve)
if(NOT TARGET SUNDIALS::ReSolve)
add_library(SUNDIALS::ReSolve ALIAS ReSolve::ReSolve)
endif()
return()
endif()

endif()

# Fall back to manual detection using ReSolve_DIR, ReSolve_INCLUDE_DIR, and
# ReSolve_LIBRARY_DIR.

# Find the include directory
find_path(
ReSolve_INCLUDE_DIR resolve/SystemSolver.hpp
PATHS "${ReSolve_DIR}"
PATH_SUFFIXES include
DOC "ReSolve include directory")

if(ReSolve_LIBRARY)
get_filename_component(ReSolve_LIBRARY_DIR "${ReSolve_LIBRARY}" PATH)
set(ReSolve_LIBRARY_DIR
"${ReSolve_LIBRARY_DIR}"
CACHE PATH "" FORCE)
else()
find_library(
ReSolve_LIBRARY resolve
PATHS "${ReSolve_DIR}" "${ReSolve_LIBRARY_DIR}"
PATH_SUFFIXES lib lib64
DOC "ReSolve library")
endif()
mark_as_advanced(ReSolve_LIBRARY)

set(ReSolve_LIBRARIES "${ReSolve_LIBRARY}")

# Set package variables including ReSolve_FOUND
find_package_handle_standard_args(
ReSolve REQUIRED_VARS ReSolve_LIBRARY ReSolve_LIBRARIES ReSolve_INCLUDE_DIR)

# Create the SUNDIALS::ReSolve imported target
if(ReSolve_FOUND)

if(NOT TARGET SUNDIALS::ReSolve)
add_library(SUNDIALS::ReSolve UNKNOWN IMPORTED)
endif()

set_target_properties(
SUNDIALS::ReSolve
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ReSolve_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ReSolve_LIBRARIES}"
IMPORTED_LOCATION "${ReSolve_LIBRARY}")

endif()
89 changes: 89 additions & 0 deletions cmake/tpl/SundialsReSolve.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# -----------------------------------------------------------------------------
# Programmer(s): Slaven Peles @ ORNL
# -----------------------------------------------------------------------------
# SUNDIALS Copyright Start
# Copyright (c) 2025-2026, Lawrence Livermore National Security,
# University of Maryland Baltimore County, and the SUNDIALS contributors.
# Copyright (c) 2013-2025, Lawrence Livermore National Security
# and Southern Methodist University.
# Copyright (c) 2002-2013, Lawrence Livermore National Security.
# All rights reserved.
#
# See the top-level LICENSE and NOTICE files for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# SUNDIALS Copyright End
# -----------------------------------------------------------------------------
# Module to find and setup ReSolve.
# ReSolve is a GPU-friendly linear solver library developed at ORNL:
# https://github.com/ORNL/ReSolve
# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# Section 1: Include guard
# -----------------------------------------------------------------------------

include_guard(GLOBAL)

# -----------------------------------------------------------------------------
# Section 2: Check to make sure options are compatible
# -----------------------------------------------------------------------------

# ReSolve is a C++ library; CXX must be enabled (SundialsSetupCompilers.cmake
# gates include(SundialsSetupCXX) on SUNDIALS_ENABLE_RESOLVE).
if(NOT CMAKE_CXX_COMPILER_LOADED)
message(FATAL_ERROR "ReSolve requires C++ but no C++ compiler was found. "
"Enable a C++ compiler or set CMAKE_CXX_COMPILER.")
endif()

if(CMAKE_CXX_STANDARD LESS "14")
message(FATAL_ERROR "CMAKE_CXX_STANDARD must be >= 14 when using ReSolve")
endif()

# -----------------------------------------------------------------------------
# Section 3: Find the TPL
# -----------------------------------------------------------------------------

find_package(ReSolve REQUIRED)

message(STATUS "ReSolve_LIBRARIES: ${ReSolve_LIBRARIES}")
message(STATUS "ReSolve_INCLUDE_DIR: ${ReSolve_INCLUDE_DIR}")

# -----------------------------------------------------------------------------
# Section 4: Test the TPL
# -----------------------------------------------------------------------------

if(SUNDIALS_ENABLE_RESOLVE_CHECKS)

message(CHECK_START "Testing ReSolve")

set(TEST_DIR ${PROJECT_BINARY_DIR}/RESOLVE_TEST)

# Use the self-contained Common.hpp rather than SystemSolver.hpp; the latter
# has missing internal includes in some ReSolve versions.
file(
WRITE ${TEST_DIR}/test.cpp
"\#include <resolve/Common.hpp>\n" "int main(void) {\n"
" ReSolve::real_type x = ReSolve::constants::ONE;\n" " (void)x;\n"
" return 0;\n" "}\n")

try_compile(
COMPILE_OK ${TEST_DIR}
${TEST_DIR}/test.cpp
LINK_LIBRARIES ReSolve::ReSolve
OUTPUT_VARIABLE COMPILE_OUTPUT)

if(COMPILE_OK)
message(CHECK_PASS "success")
else()
message(CHECK_FAIL "failed")
file(WRITE ${TEST_DIR}/compile.out "${COMPILE_OUTPUT}")
message(
FATAL_ERROR
"Could not compile ReSolve test. Check output in ${TEST_DIR}/compile.out"
)
endif()

else()
message(STATUS "Skipped ReSolve checks.")
endif()
1 change: 1 addition & 0 deletions docker/sundials-ci/spack-nightly/int32-double/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spack:
- superlu-dist~int64 ^parmetis~int64 arch=x86_64 %gcc@9.4.0
- trilinos+tpetra gotype=int arch=x86_64 %gcc@9.4.0
- xbraid arch=x86_64 %gcc@9.4.0
- resolve~cuda~rocm arch=x86_64 %gcc@9.4.0
config:
install_tree: /opt/software
mirrors:
Expand Down
1 change: 1 addition & 0 deletions docker/sundials-ci/spack-nightly/int64-double/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spack:
- superlu-dist+int64 ^parmetis+int64 ^netlib-lapack arch=x86_64 %gcc@9.4.0
- trilinos+tpetra gotype=long_long arch=x86_64 %gcc@9.4.0
- xbraid arch=x86_64 %gcc@9.4.0
- resolve~cuda~rocm arch=x86_64 %gcc@9.4.0
config:
install_tree: /opt/software
mirrors:
Expand Down
24 changes: 24 additions & 0 deletions test/config_cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,30 @@ def main():
dependson="--xbraid",
)

# ReSolve
group = parser.add_argument_group("ReSolve Options")

add_arg(
group,
"--resolve",
"SUNDIALS_RESOLVE",
"SUNDIALS_ENABLE_RESOLVE",
"OFF",
"BOOL",
"SUNDIALS ReSolve support",
)

add_arg(
group,
"--resolve-dir",
"RESOLVE_ROOT",
"ReSolve_DIR",
None,
"PATH",
"ReSolve install directory",
dependson="--resolve",
)

# --------
# Testing
# --------
Expand Down
12 changes: 12 additions & 0 deletions test/env/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,15 @@ else
export SUNDIALS_XBRAID=OFF
unset XBRAID_ROOT
fi

# -------
# resolve
# -------

if [ "$SUNDIALS_PRECISION" == "double" ]; then
export SUNDIALS_RESOLVE=ON
export RESOLVE_ROOT=/opt/view
else
export SUNDIALS_RESOLVE=OFF
unset RESOLVE_ROOT
fi
Loading