-
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
Merge next into outerloop PR #2498
Merged
bendudson
merged 104 commits into
next-hypre-outerloop-cuda-merged
from
hypre-merge-next
Feb 15, 2022
Merged
Merge next into outerloop PR #2498
bendudson
merged 104 commits into
next-hypre-outerloop-cuda-merged
from
hypre-merge-next
Feb 15, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix BOUT_OVERRIDE_DEFAULT_OPTION()
Shared objects should be executable
Fix permission of shared objects
Solvers can pass a flag to say whether the function can be linearised (e.g. inside inner linear solve, or Jacobian calculation). Physics models don't have to use the argument: rhs functions with a single (time) argument continue to work.
Should use const reference to avoid copying index
Deprecated, flagged as warning by Apple Clang
Enables large reductions in the number of iterations needed to calculate the Jacobian elements. Having the Jacobian then enables good preconditioning. Simple conduction example, nout=5 and timestep=10: PVODE: ``` 1.000e+01 644 1.25e-01 74.9 0.0 0.7 13.4 10.9 2.000e+01 161 4.41e-02 50.9 0.0 0.4 29.4 19.2 ``` beuler, SNESType = anderson ``` 1.000e+01 962 2.13e-01 65.8 0.0 0.7 8.2 25.4 2.000e+01 347 8.20e-02 61.3 0.0 0.6 14.0 24.0 ``` beuler, SNESType = newtonls, matrix free (no Jacobian) ``` 1.000e+01 3389 5.68e-01 89.2 0.0 0.8 3.3 6.6 2.000e+01 2325 3.55e-01 89.1 0.0 0.8 3.3 6.8 ``` beuler, SNESType = newtonls, with Jacobian, no coloring ``` 1.000e+01 833 1.53e-01 78.8 0.0 0.7 12.1 8.4 2.000e+01 521 9.81e-02 76.6 0.0 0.8 12.3 10.4 ``` beuler, SNESType = newtonls, with Jacobian coloring ``` 1.000e+01 85 3.78e-02 33.3 0.0 0.3 46.5 19.9 2.000e+01 57 3.16e-02 26.4 0.0 0.2 48.9 24.6 ```
Was destroying the iscoloring object before setup, and then reverting to brute-force calculation of the Jacobian.
Describe all the options, and how to use newtonls with Jacobian coloring.
[skip ci]
- Defaults to using coloring to calculate a Jacobian - Iterations and lag jacobian set to values that work for SD1D tests so far. - Diagnostic outputs now include number of linear iterations and number of failures.
Reflect changes in defaults, and some notes on when these are likely to fail.
Clang tidy suggestions
If timestep falls below this threshold, reset the Jacobian and preconditioner, and try to take a large timestep. The idea is that sometimes the solver gets stuck in a local minimum, and the observation that sometimes stopping the simulation and restarting can help.
- If resetting doesn't work once, quit rather than get stuck in an infinite loop - Turn off the predictor when resetting. The predictor seems to make convergence slower when nearly in steady state.
Missing on for loops in imex-bdf2 code
Thanks to @dschworer suggestion. [skip ci]
If a step which would have ended at an output time fails, the looping variable should be reset to true so that the retry occurs. Thanks to Mike Kryjak for the report
Sets the linear solver and preconditioner to use
Enables much quicker calculation of steady-state solutions than CVODE typically can.
beuler sometimes appears to reach a steady state, with timesteps continuously increasing, and zero nonlinear iterations e.g. ``` Time: 2189781.780775979, timestep: 9781.780775979214, nl iter: 0, lin iter: 1 Time: 2190000.0, timestep: 10759.958853577136, nl iter: 0, lin iter: 1 2.190e+06 31 1.94e+00 94.9 0.0 0.0 3.0 2.0 Time: 2200000.0, timestep: 10759.958853577136, nl iter: 0, lin iter: 1 2.200e+06 16 1.05e+00 91.0 0.0 0.0 6.3 2.7 Time: 2210000.0, timestep: 10759.958853577136, nl iter: 0, lin iter: 1 2.210e+06 16 1.08e+00 91.9 0.0 0.0 5.5 2.6 Time: 2220000.0, timestep: 10759.958853577136, nl iter: 0, lin iter: 1 ``` Restarting from this state however shows that it is not in steady state and even doesn't converge. To try to prevent this, force SNES to take at least one iteration, add more checks and reporting.
Will sometimes hit a state where snes stops after zero iterations (due to stol tolerance), and continues "converging" until the end of the simulation. Taking a small Euler step seems to help.
Add ability to change line search type. When SNES fails to converge, print diagnostic information on the fields and their time derivatives.
Recent change in commit hash broke this Fixes #2461
Ambiguous between mpark:: and std::visit when compiling with GCC 11.1 (Arch linux)
Fix SUNDIALS download git tag
Before this change, setting an integer/BoutReal to, for example, 'true', would yield: Cannot find variable 'true' With this change, now the error is: Couldn't get BoutReal from option conduction:chi = 'true': \ Cannot find variable 'true'
Simplify specifying factory creator arguments
Co-authored-by: johnomotani <john.omotani@ukaea.uk>
…imple-ctors Command-line help for input options for factory created types
Co-authored-by: Peter Hill <zed.three@gmail.com>
Some suggestions for beuler backport
Should use bout::utils::visit, rather than std::visit. Without this fix an compiler error occurs with GCC 11.1.0
Fix ambiguous variant use
Back-port beuler/snes improvements to master
[skip ci]
Limits how large the timestep can be made, to try and prevent repeated increases and failures
…ssion Cache `Coordinates::zlength()` result
Version 4.4.1 release
* master: (27 commits) Fix contributor's name Update release date Update changelog Revert SONAME/SOVERSION to 4.4.0 Fix test-bout-override-default-option for cmake Update DOI and release date for 4.4.1 Update changelog for 4.4.1 Update translation files for 4.4.1 Bump version to 4.4.1 Enable setting SNES solver PETSc options from input file Try to consolidate some loops/branches in SNESSolver Use `BOUT_ENUM_CLASS` for `SNESSolver::equation_form` Use `std::vector/array` instead of C style arrays Remove `__FUNCT__` macros for PETSc callbacks Update backport of beuler/snes solver Fix typo in docs Remove IDL section and recommend xBOUT for analysis Recommend using xBOUT for manipulating restart files Update log output in "running BOUT++" manual section Move "Initialising solver" message to top of `Solver::solve` ...
- Ensure that the linear boolean flag is passed through to the rhs function - Formatting strings e.g. `%e` -> `{}`
API includes a `linear` flag, which is set to `true` when a linearised rhs() function can be used.
beuler solver additions
Merge 4.4.1 into next
* next: (37 commits) Merge in Solver and PhysicsModel changes from next SNES solver merges Fix contributor's name Update release date Update changelog Fix ambiguous visit call Revert SONAME/SOVERSION to 4.4.0 Fix test-bout-override-default-option for cmake Update DOI and release date for 4.4.1 Update changelog for 4.4.1 Update translation files for 4.4.1 Bump version to 4.4.1 Enable setting SNES solver PETSc options from input file Try to consolidate some loops/branches in SNESSolver Use `BOUT_ENUM_CLASS` for `SNESSolver::equation_form` Use `std::vector/array` instead of C style arrays Remove `__FUNCT__` macros for PETSc callbacks Update backport of beuler/snes solver Fix typo in docs Remove IDL section and recommend xBOUT for analysis ...
Add matrix coloring to beuler solver (and fix imexbdf2)
* next: (78 commits) [skip ci] Apply black changes Merge in Solver and PhysicsModel changes from next SNES solver merges Add max_timestep option to beuler solver Fix contributor's name Update release date Update changelog Fix ambiguous visit call Update src/solver/impls/snes/snes.cxx Fix typo in help text Add command line options for printing help for types Ensure all factories can construct from name + options Bump fmt to 8.1.0; fix implicit cast of enum class to int Simplify specifying factory creator arguments Fix upper Y boundary too [skip ci] Apply black changes SNES/beuler solver: Fix out of bounds indices Revert SONAME/SOVERSION to 4.4.0 Fix test-bout-override-default-option for cmake Update DOI and release date for 4.4.1 ...
bendudson
approved these changes
Feb 15, 2022
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.
Thanks @ZedThree !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes a few conflicts between next and #2397