Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/sunadjoint-core-modules'…
Browse files Browse the repository at this point in the history
… into feature/sunadjoint-arkode
  • Loading branch information
balos1 committed Feb 11, 2025
2 parents 5122668 + b5b1385 commit b1acafc
Show file tree
Hide file tree
Showing 193 changed files with 8,167 additions and 7,449 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-ci-containers-e4s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v6.12.0
uses: docker/build-push-action@v6.13.0
with:
context: "./docker/sundials-ci/e4s-base"
build-args: e4s_version=22.05
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v6.12.0
uses: docker/build-push-action@v6.13.0
with:
context: "./docker/sundials-ci/e4s-quarterly"
build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ci-containers-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v6.12.0
uses: docker/build-push-action@v6.13.0
with:
context: "./docker/sundials-ci/spack-nightly"
build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml
Expand Down
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ instead of `SameMajorVersion`. This fixes the issue seen
[here](https://github.com/AMReX-Codes/amrex/pull/3835).

Fixed a CMake bug that caused an MPI linking error for our C++ examples in some
instances. Fixes [GitHub Issue
# 464](https://github.com/LLNL/sundials/issues/464).
instances. Fixes [GitHub Issue #464](https://github.com/LLNL/sundials/issues/464).

Fixed the runtime library installation path for windows systems. This fix
changes the default library installation path from
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/advection_reaction_3D/kokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(BUILD_ARKODE
set(benchmark_target "advection_reaction_3D_kokkos.${backend}")

# benchmark source files
add_executable(
sundials_add_executable(
${benchmark_target}
advection_reaction_3D.cpp
arkode_driver.cpp
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/advection_reaction_3D/raja/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if(BUILD_ARKODE
# MPI only
# ----------------------------------------------------------------------------

add_executable(
sundials_add_executable(
advection_reaction_3D_raja
advection_reaction_3D.cpp
arkode_driver.cpp
Expand Down Expand Up @@ -94,7 +94,7 @@ if(BUILD_ARKODE
set_source_files_properties(cvode_driver.cpp PROPERTIES LANGUAGE CUDA)
set_source_files_properties(ida_driver.cpp PROPERTIES LANGUAGE CUDA)

add_executable(
sundials_add_executable(
advection_reaction_3D_raja_mpicuda
advection_reaction_3D.cpp
arkode_driver.cpp
Expand Down Expand Up @@ -149,7 +149,7 @@ if(BUILD_ARKODE

if(BUILD_NVECTOR_HIP)

add_executable(
sundials_add_executable(
advection_reaction_3D_raja_mpihip
advection_reaction_3D.cpp
advection_reaction_3D.hpp
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/diffusion_2D/mpi_gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ foreach(test_tuple ${tests})

endif()

add_executable(${target} ${sources})
sundials_add_executable(${target} ${sources})

# if("${backend}" STREQUAL "USE_CUDA") sundials_add_benchmark(${target}
# ${target} diffusion_2D ENABLE_GPU NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} )
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/diffusion_2D/mpi_serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ foreach(test_tuple ${tests})
set(target ${package}_diffusion_2D_mpi)

# create executable
add_executable(${target} ${sources})
sundials_add_executable(${target} ${sources})

add_dependencies(benchmark ${target})

Expand Down
7 changes: 3 additions & 4 deletions benchmarks/nvector/openmpdev/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS}")

add_executable(
test_nvector_performance_openmpdev
test_nvector_performance_openmpdev.c ../test_nvector_performance.c
../../../src/sundials/sundials_nvector.c)
sundials_add_executable(
test_nvector_performance_openmpdev test_nvector_performance_openmpdev.c
../test_nvector_performance.c ../../../src/sundials/sundials_nvector.c)

# folder to organize targets in an IDE
set_target_properties(test_nvector_performance_openmp PROPERTIES FOLDER
Expand Down
8 changes: 8 additions & 0 deletions cmake/SundialsBuildOptionsPre.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ endif()
set(DOCSTR "Integer type to use for indices in SUNDIALS")
sundials_option(SUNDIALS_INDEX_TYPE STRING "${DOCSTR}" "" ADVANCED)

# ---------------------------------------------------------------
# Option to specify counter type
# ---------------------------------------------------------------

set(DOCSTR "Integer type to use for counters in SUNDIALS")
sundials_option(SUNDIALS_COUNTER_TYPE LIST "${DOCSTR}" "int64_t" ADVANCED)


# ---------------------------------------------------------------
# Option to enable monitoring
# ---------------------------------------------------------------
Expand Down
32 changes: 13 additions & 19 deletions cmake/macros/SundialsAddExecutable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,25 @@
# SPDX-License-Identifier: BSD-3-Clause
# SUNDIALS Copyright End
# ---------------------------------------------------------------
# CMake macro for adding executables.
# CMake function that wraps the add_executable command.
#
# It adds one extra single-value argument, SCALAR_TYPE. Otherwise
# this function behaves exactly as add_executable does.
#
# ---------------------------------------------------------------

macro(sundials_add_nvector_benchmark NAME)
function(sundials_add_executable NAME)

set(options)
set(singleValueArgs)
set(multiValueArgs SOURCES SUNDIALS_TARGETS LINK_LIBRARIES INSTALL_SUBDIR)
set(singleValueArgs SCALAR_TYPE)
set(multiValueArgs)

cmake_parse_arguments(arg "${options}" "${singleValueArgs}"
"${multiValueArgs}" ${ARGN})

set(BENCHMARKS_DIR ${PROJECT_SOURCE_DIR}/benchmarks)

add_executable(${NAME} ${BENCHMARKS_DIR}/nvector/test_nvector_performance.c
${arg_SOURCES})

set_target_properties(${NAME} PROPERTIES FOLDER "Benchmarks")

target_include_directories(${NAME} PRIVATE ${BENCHMARKS_DIR}/nvector)

target_link_libraries(${NAME} PRIVATE ${arg_SUNDIALS_TARGETS}
${arg_LINK_LIBRARIES} -lm)

install(TARGETS ${NAME}
DESTINATION "${BENCHMARKS_INSTALL_PATH}/${arg_INSTALL_SUBDIR}")
string(TOUPPER "${arg_SCALAR_TYPE}" _scalarUpper)
if(NOT _scalarUpper OR _scalarUpper STREQUAL SUNDIALS_SCALAR_TYPE)
add_executable(${NAME} ${arg_UNPARSED_ARGUMENTS})
endif()

endmacro(sundials_add_nvector_benchmark)
endfunction()
41 changes: 41 additions & 0 deletions cmake/macros/SundialsAddNvectorBenchmark.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# ---------------------------------------------------------------
# Programmer(s): Cody J. Balos @ LLNL
# ---------------------------------------------------------------
# SUNDIALS Copyright Start
# Copyright (c) 2002-2025, Lawrence Livermore National Security
# and Southern Methodist University.
# All rights reserved.
#
# See the top-level LICENSE and NOTICE files for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# SUNDIALS Copyright End
# ---------------------------------------------------------------
# CMake macro for adding nvector benchmark executables.
# ---------------------------------------------------------------

function(sundials_add_nvector_benchmark NAME)

set(options)
set(singleValueArgs)
set(multiValueArgs SOURCES SUNDIALS_TARGETS LINK_LIBRARIES INSTALL_SUBDIR)

cmake_parse_arguments(arg "${options}" "${singleValueArgs}"
"${multiValueArgs}" ${ARGN})

set(BENCHMARKS_DIR ${PROJECT_SOURCE_DIR}/benchmarks)

add_executable(${NAME} ${BENCHMARKS_DIR}/nvector/test_nvector_performance.c
${arg_SOURCES})

set_target_properties(${NAME} PROPERTIES FOLDER "Benchmarks")

target_include_directories(${NAME} PRIVATE ${BENCHMARKS_DIR}/nvector)

target_link_libraries(${NAME} PRIVATE ${arg_SUNDIALS_TARGETS}
${arg_LINK_LIBRARIES} -lm)

install(TARGETS ${NAME}
DESTINATION "${BENCHMARKS_INSTALL_PATH}/${arg_INSTALL_SUBDIR}")

endfunction(sundials_add_nvector_benchmark)
1 change: 1 addition & 0 deletions cmake/macros/SundialsCMakeMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ include(SundialsInstallExamples)
include(SundialsInstallExamplesGinkgo)
include(SundialsOption)
include(SundialsAddBenchmark)
include(SundialsAddNvectorBenchmark)
Loading

0 comments on commit b1acafc

Please sign in to comment.