Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARKODE unit test for number of mass matrix solves #375

Closed
wants to merge 48 commits into from

Conversation

Steven-Roberts
Copy link
Collaborator

Adds a unit test that will allow us to monitor changes to and ensure the correct number of mass matrix solves in ARKODE. I've included comments in each test which explain where the solves arise and if it can be sharpened. The tests cover a range of methods and settings, but let me know if there other combinations worth including. Here is the test output:

Mass Matrix Solve Count Test

Result | Implicit Method               | Explicit Method               | Time-Dep | Deduce Im RHS | Actual | Expected
-------+-------------------------------+-------------------------------+----------+---------------+--------+---------
  Pass | ARKODE_SDIRK_2_1_2            | ARKODE_ERK_NONE               | No       | No            | 2      | 2
  Pass | ARKODE_SDIRK_2_1_2            | ARKODE_ERK_NONE               | No       | Yes           | 2      | 2
  Pass | ARKODE_SDIRK_2_1_2            | ARKODE_ERK_NONE               | Yes      | No            | 2      | 2
  Pass | ARKODE_SDIRK_2_1_2            | ARKODE_ERK_NONE               | Yes      | Yes           | 0      | 0
  Pass | ARKODE_SDIRK_5_3_4            | ARKODE_ERK_NONE               | No       | No            | 1      | 1
  Pass | ARKODE_SDIRK_5_3_4            | ARKODE_ERK_NONE               | No       | Yes           | 1      | 1
  Pass | ARKODE_SDIRK_5_3_4            | ARKODE_ERK_NONE               | Yes      | No            | 5      | 5
  Pass | ARKODE_SDIRK_5_3_4            | ARKODE_ERK_NONE               | Yes      | Yes           | 0      | 0
  Pass | ARKODE_ESDIRK324L2SA_4_2_3    | ARKODE_ERK_NONE               | No       | No            | 2      | 2
  Pass | ARKODE_ESDIRK324L2SA_4_2_3    | ARKODE_ERK_NONE               | No       | Yes           | 2      | 2
  Pass | ARKODE_ESDIRK324L2SA_4_2_3    | ARKODE_ERK_NONE               | Yes      | No            | 4      | 4
  Pass | ARKODE_ESDIRK324L2SA_4_2_3    | ARKODE_ERK_NONE               | Yes      | Yes           | 1      | 1
  Pass | ARKODE_DIRK_NONE              | ARKODE_SHU_OSHER_3_2_3        | No       | No            | 5      | 5
  Pass | ARKODE_DIRK_NONE              | ARKODE_SHU_OSHER_3_2_3        | No       | Yes           | 5      | 5
  Pass | ARKODE_DIRK_NONE              | ARKODE_SHU_OSHER_3_2_3        | Yes      | No            | 3      | 3
  Pass | ARKODE_DIRK_NONE              | ARKODE_SHU_OSHER_3_2_3        | Yes      | Yes           | 3      | 3
  Pass | ARKODE_DIRK_NONE              | ARKODE_BOGACKI_SHAMPINE_4_2_3 | No       | No            | 5      | 5
  Pass | ARKODE_DIRK_NONE              | ARKODE_BOGACKI_SHAMPINE_4_2_3 | No       | Yes           | 5      | 5
  Pass | ARKODE_DIRK_NONE              | ARKODE_BOGACKI_SHAMPINE_4_2_3 | Yes      | No            | 4      | 4
  Pass | ARKODE_DIRK_NONE              | ARKODE_BOGACKI_SHAMPINE_4_2_3 | Yes      | Yes           | 4      | 4
  Pass | ARKODE_ARK2_DIRK_3_1_2        | ARKODE_ARK2_ERK_3_1_2         | No       | No            | 3      | 3
  Pass | ARKODE_ARK2_DIRK_3_1_2        | ARKODE_ARK2_ERK_3_1_2         | No       | Yes           | 3      | 3
  Pass | ARKODE_ARK2_DIRK_3_1_2        | ARKODE_ARK2_ERK_3_1_2         | Yes      | No            | 6      | 6
  Pass | ARKODE_ARK2_DIRK_3_1_2        | ARKODE_ARK2_ERK_3_1_2         | Yes      | Yes           | 4      | 4
  Pass | ARKODE_ARK548L2SA_DIRK_8_4_5  | ARKODE_ARK548L2SA_ERK_8_4_5   | No       | No            | 3      | 3
  Pass | ARKODE_ARK548L2SA_DIRK_8_4_5  | ARKODE_ARK548L2SA_ERK_8_4_5   | No       | Yes           | 3      | 3
  Pass | ARKODE_ARK548L2SA_DIRK_8_4_5  | ARKODE_ARK548L2SA_ERK_8_4_5   | Yes      | No            | 16     | 16
  Pass | ARKODE_ARK548L2SA_DIRK_8_4_5  | ARKODE_ARK548L2SA_ERK_8_4_5   | Yes      | Yes           | 9      | 9

johnwparent and others added 28 commits September 12, 2023 20:23
example_utilities.hpp requires `stoi` and similar methods. These are
declared in `<string>`, but `<string>` is not included. This means this
file will break any TU it's included in.

Resolves #330

Co-authored-by: Cody Balos <[email protected]>
Fixes #333. Some other typedefs already had specialized (towards idas or
cvodes) prefixed names, it won't harm to generalize this.

---------

Co-authored-by: Cody Balos <[email protected]>
Add scripts for comparing benchmark and example timings against release timings and a notebook using Thicket to visualize data

---------

Co-authored-by: David J. Gardner <[email protected]>
Co-authored-by: Cody J. Balos <[email protected]>
Fixes part of #253 by avoiding nested loops that take `O(M*N)` operations.

Also fixes #256.

---------

Signed-off-by: phannebohm <[email protected]>
Co-authored-by: Cody Balos <[email protected]>
Fix missing soversion on some SUNLinSol and SUNNonlinSol targets

---------

Signed-off-by: Julien Schueller <[email protected]>
Co-authored-by: Cody Balos <[email protected]>
1. Adds missing implicit tables to the ARKODE constants docs
2. Makes formatting of constants consistent in ARKODE docs
3. Groups implicit tables by order

---------

Co-authored-by: David Gardner <[email protected]>
Update ARKStepSetTableNum to recognize ARK2-3-1-2 as a valid ARK pair.
Fixes #339: A regression was introduced by the stop time bug fix in
v6.6.1 causing integrators to return at the stop time rather than the
requested output time if the stop time was reached in the same step in
which the output time was passed.

Also fixes a missing check in ARKODE to interpolate (or not) the
solution at the stop time.
Fix CVodeQuadSStolerances docs, add CVodeQuadSVtolerances docs (Fixes #340)
Only adding the `Sofroniou-Spaletta-5-3-4` method but not changing the
defaults like #345

---------

Co-authored-by: Daniel R. Reynolds <[email protected]>
Co-authored-by: David Gardner <[email protected]>
This PR adds the ginkgo dpcpp support in the examples: sunmatrix,
sunlinsol, and cvode/cv_heat2D

I currently only know `queue->wait_and_throw()` to synchronize which
requires queue unlike `cudaDeviceSynchronize` or `hipDeviceSynchronize`
In sunlinsol and cv_heat2D, some function signatures are also used in
other files such that I can not pass an additional parameter.
I use global variable to store ginkgo executor and then get the queue
when SYCL needs sync or submit the kernel in those functions.

---------

Signed-off-by: Yu-Hsiang M. Tsai <[email protected]>
Co-authored-by: Cody Balos <[email protected]>
Always append hipblas and hipsparse CMake targets with HIP backend as these
libraries are not reliably included in the pkgconfig file.

Replace cublas and cusparse with the CMake targets because the library path in
the pkgconfig file is not reliable. Specifically, the path is wrong on systems
using the NVIDIA HPC SDK.

---------

Co-authored-by: David Gardner <[email protected]>
Added Fortran support for the LAPACK dense SUNLinearSolver implementation.

---------

Co-authored-by: Daniel R. Reynolds <[email protected]>
 Additional embedded explicit Runge--Kutta
methods to ARKODE.

---------

Co-authored-by: Steven Roberts <[email protected]>
Co-authored-by: David J. Gardner <[email protected]>
Updated `SUNProfiler` to note rely on `MPI_WTime`. Fixes #312 

---------

Co-authored-by: David Gardner <[email protected]>
Fix the description of `ONE_STEP` mode in ARKODE. The solution at the
end of the step is always returned and interpolation is not performed.
Upload artifact with just output files so the artifact is smaller

---------

Co-authored-by: David Gardner <[email protected]>
Remove unused files from the repo
* Cancel existing workflow on new push
* Add dispatch trigger for all actions
* Upload all outputs from testing directory

---------

Co-authored-by: Cody Balos <[email protected]>
Remove F77 interface examples from `develop` branch. Once this PR is
merged, a new `archive` branch can be created for easy reference until
#302 is merged and the `archive` branch can be deleted.

---------

Co-authored-by: Cody Balos <[email protected]>
Simplify tarscript to include directories rather than individual files

---------

Co-authored-by: Cody Balos <[email protected]>
Fixed a bug in ERKStep where methods with `c[s-1] = 1` but `a[s-1,j] !=
b[j]` were incorrectly treated as having the first same as last (FSAL)
property.

Fixed a bug in `MRIStepCoupling_Write` where explicit coupling tables
were not written to the output file pointer.

ARKStep, ERKStep, MRIStep, and SPRKStep were updated to remove a
potentially unnecessary right-hand side evaluation at the end of an
integration. ARKStep was additionally updated to remove extra right-hand
side evaluations when using an explicit method or an implicit method
with an explicit first stage.

The `MRIStepInnerStepper` class in MRIStep was updated to make supplying
an `MRIStepInnerFullRhsFn` optional.

---------

Co-authored-by: Daniel R. Reynolds <[email protected]>
Co-authored-by: Cody Balos <[email protected]>
New object-oriented infrastructure for time step adaptivity controllers.

---------

Co-authored-by: David J. Gardner <[email protected]>
Co-authored-by: Balos, Cody, J <[email protected]>
Co-authored-by: Cody Balos <[email protected]>
Add developer docs to RTD superbuild
Add instructions for updating answers in the developer docs.

---------

Co-authored-by: David Gardner <[email protected]>
Remove deprecated functions

---------

Co-authored-by: Daniel R. Reynolds <[email protected]>
Remove `realtype`, `booleantype`, and related deprecated macros.

---------

Co-authored-by: Daniel R. Reynolds <[email protected]>
Co-authored-by: Steven Roberts <[email protected]>
Co-authored-by: David J. Gardner <[email protected]>
drreynolds
drreynolds previously approved these changes Nov 17, 2023
Copy link
Collaborator

@drreynolds drreynolds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comment typos, but otherwise this looks great.

test/unit_tests/arkode/C_serial/ark_test_mass.c Outdated Show resolved Hide resolved
test/unit_tests/arkode/C_serial/ark_test_mass.c Outdated Show resolved Hide resolved
test/unit_tests/arkode/C_serial/ark_test_mass.c Outdated Show resolved Hide resolved
test/unit_tests/arkode/C_serial/ark_test_mass.c Outdated Show resolved Hide resolved
test/unit_tests/arkode/C_serial/ark_test_mass.c Outdated Show resolved Hide resolved
test/unit_tests/arkode/C_serial/ark_test_mass.c Outdated Show resolved Hide resolved
@balos1
Copy link
Member

balos1 commented Nov 17, 2023

This looks good, but lets hold it until after some of the other PRs are merged.

gardner48 and others added 2 commits November 17, 2023 08:31
Add graphviz to Read the Docs config to display graphviz figures
Co-authored-by: Daniel R. Reynolds <[email protected]>
@balos1 balos1 added this to the SUNDIALS 7.0.0 milestone Nov 27, 2023
Addresses #275. Requires MPI to be linked to SUNDIALS core if it is enabled thus all-in-one MPI and non-MPI builds are no longer supported. Instead user will have to separately build and install with and without MPI.

---------

Co-authored-by: Daniel R. Reynolds <[email protected]>
Co-authored-by: Steven Roberts <[email protected]>
Co-authored-by: David J. Gardner <[email protected]>
@balos1 balos1 removed this from the SUNDIALS 7.0.0 milestone Dec 6, 2023
balos1 and others added 7 commits December 7, 2023 12:51
Add core error handling functions and macros 

---------

Co-authored-by: Daniel R. Reynolds <[email protected]>
Co-authored-by: David J. Gardner <[email protected]>
Apply clang-format and clang-tidy. There are changes/additions
in the following files:

- .clang-format
- .clang-tidy
- .github/actions/free-space-ubuntu/action.yml
- .github/workflows/build-llvm-container.yml
- .github/workflows/check-clang-format.yml
- cmake/SundialsSetupCompilers.cmake
- scripts/format.sh
- scripts/tidy_and_format.sh

---------

Co-authored-by: Daniel R. Reynolds <[email protected]>
Co-authored-by: David J. Gardner <[email protected]>
Abort a running Pipeline build if a new one is started
Fix DIRK table names in IMEX pairs and loop over IMEX table pairs

---------

Co-authored-by: Cody Balos <[email protected]>
Updated table showing N_Vector requirements from ARKODE. This is in
support of some SciDAC partnerships, who are beginning to create custom
N_Vector implementations to interface with ARKODE, and who want an
up-to-date list of the minimum N_Vector routines they'll need to
implement.

---------

Co-authored-by: Cody Balos <[email protected]>
The SYCL 2020 standard specifies `sycl/sycl.hpp` as the standard header
to include however, implementations may still define the old
`CL/sycl.hpp` header for backwards compatibility. We already require
SYCL 2020 but were still using the old header.

---------

Co-authored-by: Cody Balos <[email protected]>
@balos1 balos1 removed the dont-merge label Feb 6, 2024
balos1 pushed a commit that referenced this pull request Apr 19, 2024
Replaces #375 which has become too outdated to easily merge develop
into.
@gardner48 gardner48 deleted the feature/mass-test branch May 16, 2024 17:56
gardner48 pushed a commit that referenced this pull request Jun 20, 2024
Replaces #375 which has become too outdated to easily merge develop
into.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.