-
Notifications
You must be signed in to change notification settings - Fork 114
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
Use VectorOfArray
in wrap_array
for DGMulti
solvers
#2150
base: main
Are you sure you want to change the base?
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2150 +/- ##
==========================================
- Coverage 96.36% 95.44% -0.92%
==========================================
Files 480 480
Lines 38028 38025 -3
==========================================
- Hits 36645 36292 -353
- Misses 1383 1733 +350
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@DanielDoehring if I remember correctly, you implemented I am running into some elixir_euler_weakform.jl (SBP, EC): Test Failed at /home/runner/work/Trixi.jl/Trixi.jl/test/test_threaded.jl:388
Expression: #= /home/runner/work/Trixi.jl/Trixi.jl/test/test_threaded.jl:388 =# @allocated(Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000
Evaluated: 118704 < 5000 However, at least locally, this appears to only happen the first time Did you run into this issue before? |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Update test/test_dgmulti_2d.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ework/Trixi.jl into jc/wrap_VectorOfArray
Hm, I have not encountered this. Can you maybe track down the allocations using the |
There doesn't seem to be a type instability. There's a weird GC call stack that |
Oh wow, that sounds strange. So the allocations are only present in the test "environment"? |
Not exactly - on my machine, the allocations disappear after running Here's the output from |
https://github.com/JuliaLang/julia/blob/3318941e585db632423366b8b703ea55a6ba8421/base/timing.jl#L479-L489 |
The text file only shows half of the information on each line. Could you provide it in a different way? |
I checked
Thanks - how is this? |
Same issue - how about telling me how to reproduce it? Use your latest commit and then run |
But if you said that |
No, I think it's a weird subtlety with how OrdinaryDiffEq.jl initializes the using Trixi, OrdinaryDiffEq
dg = DGMulti(polydeg = 3, element_type = Line(),
surface_integral = SurfaceIntegralWeakForm(FluxLaxFriedrichs()),
volume_integral = VolumeIntegralWeakForm())
equations = CompressibleEulerEquations1D(1.4)
initial_condition = initial_condition_constant
mesh = DGMultiMesh(dg, (2, ), periodicity = true)
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, dg)
ode = semidiscretize(semi, (0.0, .01))
integrator = init(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 0.01) # works
integrator = init(ode, Tsit5()) # works
integrator = init(ode, RDPK3SpFSAL49()) # works
integrator = init(ode, SSPRK43(), dt = 0.01) # works
integrator = init(ode, SSPRK43()) # fails?!? The error for the last line isn't very helpful, but if I run @ranocha - you know the |
Which versions of the packages are you using? julia> using Pkg; Pkg.activate(temp = true); Pkg.add(["OrdinaryDiffEq", "StaticArrays", "StructArrays"])
[...]
⌃ [1dea7af3] + OrdinaryDiffEq v6.89.0
[90137ffa] + StaticArrays v1.9.8
⌃ [09ab397b] + StructArrays v0.6.18
[...]
julia> using OrdinaryDiffEq, StructArrays, StaticArrays
julia> u = StructArray([SVector(1.0, 1.0), SVector(2.0, 2.0)])
2-element StructArray(::Vector{Float64}, ::Vector{Float64}) with eltype SVector{2, Float64}:
[1.0, 1.0]
[2.0, 2.0]
julia> ode = ODEProblem(u, (0.0, 1.0)) do du, u, p, t
@show typeof(du)
du .= u
return nothing
end
julia> solve(ode, Tsit5())
typeof(du) = StructVector{SVector{2, Float64}, Tuple{Vector{Float64}, Vector{Float64}}, Int64}
typeof(du) = StructVector{SVector{2, Float64}, Tuple{Vector{Float64}, Vector{Float64}}, Int64}
typeof(du) = StructVector{SVector{2, Float64}, Tuple{Vector{Float64}, Vector{Float64}}, Int64}
[...]
julia> solve(ode, SSPRK43())
typeof(du) = StructVector{SVector{2, Float64}, Tuple{Vector{Float64}, Vector{Float64}}, Int64}
typeof(du) = StructVector{SVector{2, Float64}, Tuple{Vector{Float64}, Vector{Float64}}, Int64}
typeof(du) = StructVector{SVector{2, Float64}, Tuple{Vector{Float64}, Vector{Float64}}, Int64}
[...] I can't see the difference here that you describe 🤷 |
Odd! I'll check tomorrow (Thursdays are my Trixi PR day). |
@ranocha I misread your MWE; I couldn't reproduce this with a simplified MWE either. It only occurs in Trixi.jl. I'll try to isolate it into a MWE tomorrow. |
Project.toml
Outdated
@@ -94,7 +94,7 @@ PrecompileTools = "1.1" | |||
Preferences = "1.3" | |||
Printf = "1" | |||
RecipesBase = "1.1" | |||
RecursiveArrayTools = "2.38.10" | |||
RecursiveArrayTools = "3.27.1" |
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.
You are setting this compatibility version so high that SciMLBase
will also adopt a higher version, forcing you to use the new version of the DiscreteCallback
struct.
That's why even if you're using Julia 1.10 but it still failed here https://github.com/trixi-framework/Trixi.jl/actions/runs/11871869411/job/33084910314?pr=2150#step:7:24
Either change this to a lower version or adopt the new DiscreteCallback
struct in precompile.
Is there any update on this? I also need Trixi.jl being compatible with newer versions of RecursiveArrayTools.jl and OrdinaryDiffEq.jl. |
I've got a conference this week so I won't be able to return to this until next Monday. However, there aren't any major numerical issues to address IMO. The main failing tests are related to allocation (e.g., #2150 (comment)) and precompilation (#2150 (comment)). I believe @huiyuxie has identified some of these issues already. If you have any time to look at those before I get back to it next week I'd welcome the help. |
I will open a PR to address this but I'm not familiar with new |
Please let me know if you have questions |
test/test_parabolic_2d.jl
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/test/test_parabolic_2d.jl
Lines 137 to 148 in ac33292
#= FIXME: Values from above (PR) or values from below (main)? | |
0.0015355076812512347, | |
0.0033843168272690953, | |
0.0036531858107444093, | |
0.009948436427520873 | |
], | |
linf=[ | |
0.005522560467186466, | |
0.013425258500736614, | |
0.013962115643462503, | |
0.0274831021205042 | |
=# |
test/test_parabolic_2d.jl
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/test/test_parabolic_2d.jl
Lines 175 to 186 in ac33292
#= FIXME: Values from above (PR) or values from below (main)? | |
0.004255101916146402, | |
0.011118488923215394, | |
0.011281831283462784, | |
0.035736564473886 | |
], | |
linf=[ | |
0.015071710669707805, | |
0.04103132025860057, | |
0.03990424085748012, | |
0.13094017185987106 | |
=# |
test/test_parabolic_3d.jl
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/test/test_parabolic_3d.jl
Lines 32 to 45 in ac33292
#= FIXME: Values from above (PR) or values from below (main)? | |
0.000553284711585015, | |
0.0006592634909666629, | |
0.0007776436127373607, | |
0.0006592634909664286, | |
0.0038073628897819524 | |
], | |
linf=[ | |
0.0017039861523628907, | |
0.002628561703550747, | |
0.0035310574250866367, | |
0.002628561703585053, | |
0.015587829540340437 | |
=# |
test/test_parabolic_3d.jl
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/test/test_parabolic_3d.jl
Lines 74 to 87 in ac33292
#= FIXME: Values from above (PR) or values from below (main)? | |
0.001402722725120774, | |
0.0021322235533272546, | |
0.002787374144745514, | |
0.002458747307062751, | |
0.009978368180191861 | |
], | |
linf=[ | |
0.0063417504028402405, | |
0.010306014252245865, | |
0.015207402509253565, | |
0.010968264045485343, | |
0.04745438983155026 | |
=# |
The helper PR is closed please change as the bot suggested @jlchan |
mark all 1D allocated tests as broken for now
…rap_VectorOfArray
This test failure appears to be an issue in OrdinaryDiffEq.jl / DiffEqBase.jl. |
See also SciML/DiffEqBase.jl#1110 |
@huiyuxie FYI this PR goes towards addressing #1789.