-
Notifications
You must be signed in to change notification settings - Fork 90
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
Conversation
older version not tested, but should still work
There was a problem hiding this 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
|
||
#if SUNDIALS_VERSION_MAJOR >= 6 | ||
#else | ||
#define SUN_MODIFIED_GS MODIFIED_GS |
There was a problem hiding this comment.
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
^
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
Bah, Fedora still failing -- some issue with their mirrors? Also, I forgot |
* 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 ...
There was a problem hiding this 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
if ((uvec = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr) | ||
throw BoutException("SUNDIALS memory allocation failed\n"); |
There was a problem hiding this comment.
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]
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"); | |
} |
if ((duvec = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr) | ||
throw BoutException("SUNDIALS memory allocation failed\n"); |
There was a problem hiding this comment.
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]
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"); | |
} |
if ((id = N_VNew_Parallel(BoutComm::get(), local_N, neq, suncontext)) == nullptr) | ||
throw BoutException("SUNDIALS memory allocation failed\n"); |
There was a problem hiding this comment.
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]
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"); | |
} |
if ((idamem = IDACreate(suncontext)) == nullptr) | ||
throw BoutException("IDACreate failed\n"); |
There was a problem hiding this comment.
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]
if ((idamem = IDACreate(suncontext)) == nullptr) | |
throw BoutException("IDACreate failed\n"); | |
if ((idamem = IDACreate(suncontext)) == nullptr) { | |
throw BoutException("IDACreate failed\n"); | |
} |
if ((sun_solver = SUNLinSol_SPGMR(uvec, SUN_PREC_NONE, maxl, suncontext)) == nullptr) | ||
throw BoutException("Creating SUNDIALS linear solver failed\n"); |
There was a problem hiding this comment.
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]
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 |
There was a problem hiding this comment.
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
^
Enable support for sundials 6
Does not address #2501 as this is cmake-only