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 support for SUNDIALS 6 #2517

Merged
merged 10 commits into from
Mar 4, 2022
Merged

Add support for SUNDIALS 6 #2517

merged 10 commits into from
Mar 4, 2022

Conversation

dschwoerer
Copy link
Contributor

Enable support for sundials 6

Does not address #2501 as this is cmake-only

older version not tested, but should still work
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/solver/impls/arkode/arkode.cxx Outdated Show resolved Hide resolved
src/solver/impls/arkode/arkode.cxx Outdated Show resolved Hide resolved
src/solver/impls/arkode/arkode.cxx Outdated Show resolved Hide resolved
src/solver/impls/arkode/arkode.cxx Outdated Show resolved Hide resolved
src/solver/impls/arkode/arkode.cxx Outdated Show resolved Hide resolved
src/solver/impls/ida/ida.cxx Outdated Show resolved Hide resolved
src/solver/impls/ida/ida.cxx Outdated Show resolved Hide resolved
src/solver/impls/ida/ida.cxx Outdated Show resolved Hide resolved
src/solver/impls/ida/ida.cxx Outdated Show resolved Hide resolved

#if SUNDIALS_VERSION_MAJOR >= 6
#else
#define SUN_MODIFIED_GS MODIFIED_GS
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: macro SUN_MODIFIED_GS used to declare a constant; consider using a constexpr constant [cppcoreguidelines-macro-usage]

#define SUN_MODIFIED_GS MODIFIED_GS
        ^

ZedThree and others added 6 commits March 3, 2022 18:10
Adds a header for common backports shared between the different
SUNDIALS solvers such that the main code only needs to differentiate
between SUNDIALS pre/post 3.0.0
Add backports and shims for SUNDIALS 6
@ZedThree
Copy link
Member

ZedThree commented Mar 4, 2022

Bah, Fedora still failing -- some issue with their mirrors?

Also, I forgot clang-tidy-review doesn't seem to like OpenMP for some reason. Might be easiest to just turn off OpenMP for that

* next: (27 commits)
  Also avoid warning from CMP0127
  ensure zoidberg is installed for documentation
  Using python based on version is a pain.
  Add comments
  Update filename for cmake
  Ensure all files get formatted
  Add bout++Config.cmake check to CI
  Fix NLS detection
  use git submodule for cloning on RTD
  CI: Cancel previous workflows on same branch
  CI: Apply clang-format changes immediately
  CI: Only run clang-tidy on changes to C++ files
  CI: Turn off Python for clang-tidy
  CI: Better fix for clang-format?
  CI: Fix clang-tidy-review version
  CI: Fix for actions/checkout not fetching other branches
  CI: Tweak some build names
  CI: Make CMake build use release flags
  CI: Remove unneeded HDF5 flag from build
  CI: Remove OpenMP build
  ...
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/solver/impls/arkode/arkode.cxx Show resolved Hide resolved
src/solver/impls/cvode/cvode.cxx Show resolved Hide resolved
src/solver/impls/ida/ida.cxx Show resolved Hide resolved
Comment on lines +140 to 141
if ((uvec = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr)
throw BoutException("SUNDIALS memory allocation failed\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [readability-braces-around-statements]

Suggested change
if ((uvec = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr)
throw BoutException("SUNDIALS memory allocation failed\n");
if ((uvec = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr) {
throw BoutException("SUNDIALS memory allocation failed\n");
}

Comment on lines +142 to 143
if ((duvec = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr)
throw BoutException("SUNDIALS memory allocation failed\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [readability-braces-around-statements]

Suggested change
if ((duvec = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr)
throw BoutException("SUNDIALS memory allocation failed\n");
if ((duvec = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr) {
throw BoutException("SUNDIALS memory allocation failed\n");
}

Comment on lines +144 to 145
if ((id = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr)
throw BoutException("SUNDIALS memory allocation failed\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [readability-braces-around-statements]

Suggested change
if ((id = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr)
throw BoutException("SUNDIALS memory allocation failed\n");
if ((id = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr) {
throw BoutException("SUNDIALS memory allocation failed\n");
}

Comment on lines +160 to 161
if ((idamem = IDACreate(suncontext)) == nullptr)
throw BoutException("IDACreate failed\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [readability-braces-around-statements]

Suggested change
if ((idamem = IDACreate(suncontext)) == nullptr)
throw BoutException("IDACreate failed\n");
if ((idamem = IDACreate(suncontext)) == nullptr) {
throw BoutException("IDACreate failed\n");
}

Comment on lines +185 to 186
if ((sun_solver = SUNLinSol_SPGMR(uvec, SUN_PREC_NONE, maxl, suncontext)) == nullptr)
throw BoutException("Creating SUNDIALS linear solver failed\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [readability-braces-around-statements]

Suggested change
if ((sun_solver = SUNLinSol_SPGMR(uvec, SUN_PREC_NONE, maxl, suncontext)) == nullptr)
throw BoutException("Creating SUNDIALS linear solver failed\n");
if ((sun_solver = SUNLinSol_SPGMR(uvec, SUN_PREC_NONE, maxl, suncontext)) == nullptr) {
throw BoutException("Creating SUNDIALS linear solver failed\n");
}

@@ -68,6 +68,11 @@ PvodeSolver::~PvodeSolver() {
}
}

#if SUNDIALS_VERSION_MAJOR >= 6
#else
#define SUN_MODIFIED_GS MODIFIED_GS
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: macro 'SUN_MODIFIED_GS' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]

#define SUN_MODIFIED_GS MODIFIED_GS
        ^

@ZedThree ZedThree changed the title Sundials 6 Add support for SUNDIALS 6 Mar 4, 2022
@ZedThree ZedThree merged commit 080f3b2 into next Mar 4, 2022
@ZedThree ZedThree deleted the sundials6 branch March 4, 2022 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants