Conversation
Collaborator
Author
|
The PR currently contains the consolidation for prob = prob_pds_linmod_inplace
alg = MPRK22(1.0)Before: julia> @benchmark solve($prob, $alg; save_everystep = false)
BenchmarkTools.Trial: 10000 samples with 1 evaluation per sample.
Range (min … max): 76.319 μs … 26.239 ms ┊ GC (min … max): 0.00% … 99.53%
Time (median): 81.111 μs ┊ GC (median): 0.00%
Time (mean ± σ): 91.810 μs ± 325.420 μs ┊ GC (mean ± σ): 5.61% ± 1.71%
█▆▄▃▄▆▆▅▃▂▂▁▁▁▁ ▁
██████████████████▇▇█▇▇▇▆▆▇▆▆▆▅▆▆▆▆▆▆▆▇▆▆▆▆▆▅▆▆▆▅▅▅▄▄▆▅▅▆▅▅▅ █
76.3 μs Histogram: log(frequency) by time 173 μs <
Memory estimate: 45.47 KiB, allocs estimate: 955.After: julia> @benchmark solve($prob, $alg; save_everystep = false)
BenchmarkTools.Trial: 10000 samples with 1 evaluation per sample.
Range (min … max): 77.018 μs … 33.066 ms ┊ GC (min … max): 0.00% … 99.57%
Time (median): 87.283 μs ┊ GC (median): 0.00%
Time (mean ± σ): 93.850 μs ± 373.274 μs ┊ GC (mean ± σ): 5.36% ± 1.41%
▅▃▂▄█▅▄▃▂▆▇▆▅▄▂▂▁▁▁ ▁ ▂
█████████████████████▇▇█▇▇▇▅▆▆▆▇▅▄▆▆▅▅▅▆▄▅▄▅▄▄▂▅▅▄▄▂▄▅▅▄▂▄▃▅ █
77 μs Histogram: log(frequency) by time 151 μs <
Memory estimate: 45.47 KiB, allocs estimate: 955. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Pull Request Test Coverage Report for Build 23067024649Details
💛 - Coveralls |
Collaborator
Author
|
The in-place implementations of all MPRK and SSPMPRK algorithms have been consolidated. The implementation of MPDeC schemes is different, therefore I wouldn't change it. |
ranocha
requested changes
Mar 13, 2026
Member
ranocha
left a comment
There was a problem hiding this comment.
Thanks! This looks reasonable to me. I just have some minor suggestions.
Co-authored-by: Hendrik Ranocha <ranocha@users.noreply.github.com>
This file contains hidden or 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
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.
Problem: Currently, every algorithm requires two separate in-place implementations: one for
ConservativePDSProblemand one forPDSProblem. Because the latter requires additional destruction vectors, they use different cache structures, leading to significant code duplication.Solution: This PR consolidates these implementations by adopting the strategy used in the out-of-place version. By using Nothing for destruction vectors in ConservativePDSProblems and leveraging multiple dispatch, we can now use a single unified code path.
Impact:
Reduces code duplication significantly.
Simplifies maintenance and the implementation of future algorithms.
Consistent behavior between in-place and out-of-place APIs.