Deterministic MLMG#4855
Conversation
|
One way to do this might be:
|
|
This is ready for review. @WeiqunZhang I tested it in Quokka, and it worked well. |
|
@chongchonghe I think there are clang-tidy warnings to fix: |
| if constexpr (amrex::IsAddAssignable<value_type>::value) { | ||
| FB_local_add_gpu(TheFB, scomp, ncomp, deterministic); | ||
| } else { | ||
| amrex::Abort("SumBoundary requires operator+="); |
There was a problem hiding this comment.
Could we revert the white space change here? It makes the indentation inconsistent.
| info.setAgglomeration(agglomeration); | ||
| info.setConsolidation(consolidation); | ||
| info.setMaxCoarseningLevel(max_coarsening_level); | ||
| info.setDeterministic(true); |
There was a problem hiding this comment.
Could we make this a runtime parameter that defaults to false? We often use this test for performance testing. This might change the performance measurement
There was a problem hiding this comment.
I randomly picked a test problem to turn on setDeterministic. Can you recommend another problem to test this feature that does not affect your performance testing?
There was a problem hiding this comment.
Do we need to update a problem to test this new feature?
There was a problem hiding this comment.
@WeiqunZhang Do you mean to make this a runtime parameter of the test problem, or as a runtime parameter for the whole amrex library, like amrex.deterministic_reduction?
There was a problem hiding this comment.
I meant a parameter just in that test.
There was a problem hiding this comment.
Let's add a runtime parameter say deterministic to Tests/LinearSolver/ABecLaplacian_C with a default value of false and add deterministic=1 to inputs-rt-abcelap-com, which is part of our nightly regression tests.
|
/run-hpsf-gitlab-ci |
|
GitLab CI 1356360 finished with status: success. See details at https://gitlab.spack.io/amrex/amrex/-/pipelines/1356360. |
|
@WeiqunZhang OK, I have added a runtime parameter to ABecLaplacian_C as you suggested. It's ready for review again. |
### Description This PR makes gravity + AMR fully reproducible, and thus makes the whole code (hydro + radiation + gravity + particles) fully reproducible. Dependent on AMReX-Codes/amrex#4855, which is now in the amrex development branch ### Related issues Are there any GitHub issues that are fixed by this pull request? Add a link to them here. ### Checklist _Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an `x` inside the square brackets `[ ]` in the Markdown source below:_ - [ ] I have added a description (see above). - [ ] I have added a link to any related issues (if applicable; see above). - [ ] I have read the [Contributing Guide](https://github.com/quokka-astro/quokka/blob/development/CONTRIBUTING.md). - [ ] I have added tests for any new physics that this PR adds to the code. - [ ] *(For quokka-astro org members)* I have manually triggered the GPU tests with the magic comment `/azp run`.
Summary
The MLMG solver is not reproducible because it uses non-deterministic atomic operations in reflux. This PR adds an option to make the MLMG solver deterministic:
@BenWibking
Additional background
Checklist
The proposed changes: