Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/fortran-32…
Browse files Browse the repository at this point in the history
…index-build
  • Loading branch information
balos1 committed May 30, 2024
2 parents 240a563 + a995c04 commit 88bfe93
Show file tree
Hide file tree
Showing 226 changed files with 18,761 additions and 6,495 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ EmptyLineAfterAccessModifier : Never
EmptyLineBeforeAccessModifier : Always
ExperimentalAutoDetectBinPacking : false
FixNamespaceComments : true
IncludeBlocks : Regroup
IncludeBlocks : Preserve
IncludeCategories :
- Regex : '^(<|"(gtest|gmock|isl|json)/)'
Priority : 1
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/macos-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ jobs:
- uses: actions/checkout@v3

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
# Configure CMake in a 'build' subdirectory.
run: |
cmake \
-B ${{github.workspace}}/build \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D ENABLE_ALL_WARNINGS=ON \
-D ENABLE_WARNINGS_AS_ERRORS=ON
- name: Build
# Build your program with the given configuration
Expand Down
31 changes: 23 additions & 8 deletions .github/workflows/ubuntu-clang-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
fail-fast: false
max-parallel: 2
matrix:
# 2 is what all other builds use (its the default), so skip it here
logging_level: [0, 1, 3, 4, 5]
# Level 2 is also used in other builds (it's the default) but include it
# here to ensure it's tested with all warning flags
logging_level: [0, 1, 2, 3, 4, 5]

steps:
- name: Install LLVM and Clang
Expand All @@ -33,9 +34,16 @@ jobs:
- uses: actions/checkout@v3

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) -DSUNDIALS_LOGGING_LEVEL=${{matrix.logging_level}}
# Configure CMake in a 'build' subdirectory.
run: |
cmake \
-B ${{github.workspace}}/build \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D CMAKE_C_COMPILER=$(which clang) \
-D CMAKE_CXX_COMPILER=$(which clang++) \
-D SUNDIALS_LOGGING_LEVEL=${{matrix.logging_level}} \
-D ENABLE_ALL_WARNINGS=ON \
-D ENABLE_WARNINGS_AS_ERRORS=ON
- name: Build
# Build your program with the given configuration
Expand All @@ -57,9 +65,16 @@ jobs:
- uses: actions/checkout@v3

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) -DSUNDIALS_BUILD_WITH_PROFILING=${{matrix.profiling}}
# Configure CMake in a 'build' subdirectory.
run: |
cmake \
-B ${{github.workspace}}/build \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D CMAKE_C_COMPILER=$(which clang) \
-D CMAKE_CXX_COMPILER=$(which clang++) \
-D SUNDIALS_BUILD_WITH_PROFILING=${{matrix.profiling}} \
-D ENABLE_ALL_WARNINGS=ON \
-D ENABLE_WARNINGS_AS_ERRORS=ON
- name: Build
# Build your program with the given configuration
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ build:
- graphviz

# Build documentation in the doc/ directory with Sphinx
# TODO(DJG): Once multiple references are fixed, add fail_on_warning: true
sphinx:
configuration: doc/superbuild/source/conf.py

Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Added the following MRI coupling tables
Added `ARKodeButcherTable_ERKIDToName` and `ARKodeButcherTable_DIRKIDToName` to
convert a Butcher table ID to a string representation.

Added the function ``ARKodeSetAutonomous`` in ARKODE to indicate that the
implicit right-hand side function does not explicitly depend on time. When using
the trivial predictor, an autonomous problem may reuse implicit function
evaluations across stage solves to reduce the total number of function
evaluations.

Users may now disable interpolated output in ARKODE by passing `ARK_INTERP_NONE`
to `ARKodeSetInterpolantType`. When interpolation is disabled, rootfinding is
not supported, implicit methods must use the trivial predictor (the default
Expand Down Expand Up @@ -120,6 +126,11 @@ Deprecated the `ARKStepSetOptimalParams` function. Since this function does not
ARKODE-wide equivalent, instructions have been added to the user guide for how
to retain the current functionality using other user-callable functions.

The unsupported implementations of `N_VGetArrayPointer` and `N_VSetArrayPointer`
for the *hypre* and PETSc vectors are now deprecated. Users should access the
underlying wrapped external library vector objects instead with
`N_VGetVector_ParHyp` and `N_VGetVector_Petsc`, respectively.

## Changes to SUNDIALS in release v7.0.0

### Major Feature
Expand Down
6 changes: 6 additions & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ endif()

sundials_option(BENCHMARK_NVECTOR BOOL "NVector benchmarks are on" ON)

# Disable some warnings for benchmarks
if(ENABLE_ALL_WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
endif()

#----------------------------------------
# Add specific benchmarks
#----------------------------------------
Expand Down
28 changes: 26 additions & 2 deletions cmake/SundialsSetupCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,21 @@ if(ENABLE_ALL_WARNINGS)
set(CMAKE_CXX_FLAGS "-Wmissing-declarations -Wcast-qual ${CMAKE_CXX_FLAGS}")
endif()

set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wno-unused-parameter -Wno-unused-function ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wno-unused-parameter -Wno-unused-function ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wshadow ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wshadow ${CMAKE_CXX_FLAGS}")

# TODO(DJG): Add -fcheck=all,no-pointer,no-recursion once Jenkins is updated
# to use gfortran > 5.5 which segfaults with -fcheck=array-temps,bounds,do,mem
# no- options were added in gfortran 6
#
# Exclude run-time pointer checks (no-pointer) because passing null objects
# to SUNDIALS functions (e.g., sunmat => null() to SetLinearSolver) causes a
# run-time error with this check
#
# Exclude checks for subroutines and functions not marked as recursive
# (no-recursion) e.g., ark_brusselator1D_task_local_nls_f2003 calls
# SUNNonlinsolFree from within a custom nonlinear solver implementation of
# SUNNonlinsolFree which causes a run-time error with this check
set(CMAKE_Fortran_FLAGS "-Wall -Wpedantic -Wno-unused-dummy-argument -Wno-c-binding-type -ffpe-summary=none ${CMAKE_Fortran_FLAGS}")
endif()

Expand Down Expand Up @@ -205,6 +218,17 @@ if(NOT (SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME OR SUNDIALS_C_COMPILER_HAS_BUIL
" SUNDIALS_C_COMPILER_HAS_ASSUME)
endif()

# ---------------------------------------------------------------
# Check for unused extension
# ---------------------------------------------------------------

check_c_source_compiles("
int main(void) {
__attribute__((unused)) double a = 0.0;
return 0;
}
" SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_UNUSED)

# ---------------------------------------------------------------
# Check for POSIX timers
# ---------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions doc/arkode/examples/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# -----------------------------------------------------------------------------

import sys, os
sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py')))
from versions import *
sys.path.append(os.path.dirname(os.path.abspath('../../../shared/sundials_vars.py')))
from sundials_vars import *

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
75 changes: 43 additions & 32 deletions doc/arkode/guide/source/ARKodeButcherTable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,66 @@
Butcher Table Data Structure
==============================

To store the Butcher table defining a Runge--Kutta method ARKODE provides the
:c:type:`ARKodeButcherTable` type and several related utility routines. We use
the following Butcher table notation (shown for a 3-stage method):
To store a Butcher table, :math:`B`, defining a Runge--Kutta method ARKODE
provides the :c:type:`ARKodeButcherTable` type and several related utility
routines. We use the following notation

.. math::
B \; \equiv \;
\begin{array}{r|c}
c & A \\
\hline
q & b \\
p & \tilde{b}
\end{array}
\quad = \quad
\begin{array}{r|ccc}
c_1 & a_{1,1} & a_{1,2} & a_{1,3} \\
c_2 & a_{2,1} & a_{2,2} & a_{2,3} \\
c_3 & a_{3,1} & a_{3,2} & a_{3,3} \\
\hline
q & b_1 & b_2 & b_3 \\
p & \tilde{b}_1 & \tilde{b}_2 & \tilde{b}_3
\end{array}
where the method and embedding share stage :math:`A` and abscissa :math:`c`
values, but use their stages :math:`z_i` differently through the coefficients
:math:`b` and :math:`\tilde{b}` to generate methods of orders :math:`q` (the
main method) and :math:`p` (the embedding, typically :math:`q = p+1`, though
sometimes this is reversed). :c:type:`ARKodeButcherTable` is defined as
\; = \;
\begin{array}{c|cccc}
c_1 & a_{1,1} & \cdots & a_{1,s-1} & a_{1,s} \\
c_2 & a_{2,1} & \cdots & a_{2,s-1} & a_{2,s} \\
\vdots & \vdots & \vdots & \vdots & \vdots \\
c_s & a_{s,1} & \cdots & a_{s,s-1} & a_{s,s} \\
\hline
q & b_1 & \cdots & b_{s-1} & b_s \\
p & \tilde{b}_1 & \cdots & \tilde{b}_{s-1} & \tilde{b}_s
\end{array}.
An :c:type:`ARKodeButcherTable` is a pointer to the
:c:struct:`ARKodeButcherTableMem` structure:

.. c:type:: ARKodeButcherTableMem* ARKodeButcherTable
where ``ARKodeButcherTableMem`` is the structure
.. c:struct:: ARKodeButcherTableMem
Structure for storing a Butcher table

.. c:member:: int q
The method order of accuracy

.. c:member:: int p
The embedding order of accuracy, typically :math:`q = p + 1`

.. c:member:: int stages
The number of stages in the method, :math:`s`

.. c:member:: sunrealtype **A
The method coefficients :math:`A \in \mathbb{R}^s`

.. c:member:: sunrealtype *c
.. code-block:: c
The method abscissa :math:`c \in \mathbb{R}^s`

typedef struct ARKodeButcherTableMem {
.. c:member:: sunrealtype *b
int q;
int p;
int stages;
sunrealtype **A;
sunrealtype *c;
sunrealtype *b;
sunrealtype *d;
The method coefficients :math:`b \in \mathbb{R}^s`

};
.. c:member:: sunrealtype *d
where ``stages`` is the number of stages in the RK method, the variables ``q``,
``p``, ``A``, ``c``, and ``b`` have the same meaning as in the Butcher table
above, and ``d`` is used to store :math:`\tilde{b}`.
The method embedding coefficients :math:`\tilde{b} \in \mathbb{R}^s`

.. _ARKodeButcherTable.Functions:

Expand Down
16 changes: 9 additions & 7 deletions doc/arkode/guide/source/Butcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ Knoth-Wolke-3-3
.. index:: Knoth-Wolke-3-3 ERK method

Accessible via the constant ``ARKODE_KNOTH_WOLKE_3_3`` to
:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` or
:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum`, or
:c:func:`ARKodeButcherTable_LoadERK`.
Accessible via the string ``"ARKODE_KNOTH_WOLKE_3_3"`` to
:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or
:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName`, or
:c:func:`ARKodeButcherTable_LoadERKByName`.
This is the default 3th order slow and fast MRIStep method (from
:cite:p:`KnWo:98`).
Expand Down Expand Up @@ -511,10 +511,10 @@ Zonneveld-5-3-4
.. index:: Zonneveld-5-3-4 ERK method

Accessible via the constant ``ARKODE_ZONNEVELD_5_3_4`` to
:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum`
or :c:func:`ARKodeButcherTable_LoadERK`.
:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum`, or
:c:func:`ARKodeButcherTable_LoadERK`.
Accessible via the string ``"ARKODE_ZONNEVELD_5_3_4"`` to
:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or
:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName`, or
:c:func:`ARKodeButcherTable_LoadERKByName`.
This is the default 4th order explicit method
(from :cite:p:`Zon:63`).
Expand Down Expand Up @@ -2227,9 +2227,11 @@ Symplectic Partitioned Butcher tables
-------------------------------------

In the category of symplectic partitioned Runge-Kutta (SPRK) methods, ARKODE
includes methods that have orders :math:`q = \{1,2,3,4,5,6,8,10\}`. Each of
the ARKODE SPRK tables are specified via a unique ID and name.
includes methods that have orders :math:`q = \{1,2,3,4,5,6,8,10\}`.

.. c:enum:: ARKODE_SPRKMethodID
Each of the ARKODE SPRK tables are specified via a unique ID and name.

ARKODE_SPRK_EULER_1_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
10 changes: 10 additions & 0 deletions doc/arkode/guide/source/Constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,18 @@ contains the ARKODE output constants.
| | | :c:type:`SUNLinearSolver` module. |
+-------------------------------------+------+------------------------------------------------------------+

.. c:enum:: ARKRelaxSolver
Nonlinear solver identifiers used to specify the method for solving
:eq:`ARKODE_RELAX_NLS` when relaxation is enabled.

.. c:enumerator:: ARK_RELAX_NEWTON
Newton's method

.. c:enumerator:: ARK_RELAX_BRENT
Brent's method
..
Commented-out table rows:
Expand Down
6 changes: 2 additions & 4 deletions doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,10 @@ relaxation.
Sets the nonlinear solver method used to compute the relaxation parameter.
The default value is ``ARK_RELAX_NEWTON``.
The default value is :c:enumerator:`ARK_RELAX_NEWTON`
:param arkode_mem: the ARKStep memory structure
:param solver: the nonlinear solver to use: ``ARK_RELAX_BRENT`` or
``ARK_RELAX_NEWTON``
:param solver: the nonlinear solver to use
:retval ARK_SUCCESS: the value was successfully set
:retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``
:retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was
Expand Down
14 changes: 7 additions & 7 deletions doc/arkode/guide/source/Usage/ARKStep/XBraid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,15 @@ to store a snapshot of solution data at a single point in time and this
structure simply contains an N_Vector. Specifically, the structure is defined
as follows:

.. code-block:: C
.. c:type:: struct _braid_Vector_struct *SUNBraidVector;
struct _braid_Vector_struct
{
N_Vector y;
};
Pointer to vector wrapper (same as braid_Vector)

.. c:struct:: _braid_Vector_struct
.. c:member:: N_Vector y
/* Poiner to vector wrapper (same as braid_Vector) */
typedef struct _braid_Vector_struct *SUNBraidVector;
SUNDIALS N_Vector wrapped by the ``braid_Vector``

To assist in creating creating and destroying this structure the following
utility functions are provided.
Expand Down
6 changes: 2 additions & 4 deletions doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,10 @@ relaxation.
Sets the nonlinear solver method used to compute the relaxation parameter.
The default value is ``ARK_RELAX_NEWTON``.
The default value is :c:enumerator:`ARK_RELAX_NEWTON`
:param arkode_mem: the ERKStep memory structure
:param solver: the nonlinear solver to use: ``ARK_RELAX_BRENT`` or
``ARK_RELAX_NEWTON``
:param solver: the nonlinear solver to use
:retval ARK_SUCCESS: the value was successfully set
:retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``
:retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was
Expand Down
Loading

0 comments on commit 88bfe93

Please sign in to comment.