-
Notifications
You must be signed in to change notification settings - Fork 113
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
Switch DGMulti
to Matrix{<:SVector}
solution storage
#1952
base: main
Are you sure you want to change the base?
Conversation
* remove Octavian and matmul! * removing some glue code introduced for matmul! * actually remove Octavian this time * Revert "removing some glue code introduced for matmul!" This reverts commit 1fd1897.
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 #1952 +/- ##
===========================================
- Coverage 96.09% 82.03% -14.06%
===========================================
Files 457 457
Lines 36734 36661 -73
===========================================
- Hits 35298 30074 -5224
- Misses 1436 6587 +5151
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I am running into issues due to For now, I'll just focus on the single-threaded case, but dealing with multi-threading will require figuring out if Polyester and StrideArrays will continue after stopping support of LoopVec.jl and Octavian.jl in Julia v1.11 (cc @chriselrod) |
Feel free to PR it to drop Octavian as a dependency.
Regardless of the official status, you don't have to rush to make changes. There are no test failures on 1.11. |
# Allocate nested array type for DGMulti solution storage. | ||
function allocate_nested_array(uEltype, nvars, array_dimensions, dg) | ||
# store components as separate arrays, combine via StructArrays | ||
return StructArray{SVector{nvars, uEltype}}(ntuple(_ -> zeros(uEltype, | ||
array_dimensions...), | ||
nvars)) |
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.
Out of curiosity, what's the motivation for the change and how does it perform?
The StructArray
version should be SIMD-friendlier, while the Matrix{<:SVector}
would be better if SIMD isn't possible.
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.
The motivation is due mainly to #1789. This impacts my specific Trixi solver DGMulti
and locks Trixi.jl to a specific version of OrdinaryDiffEq. I looked at the array wrappers in RecursiveArrayTools.jl to try to address this, but it takes a lot more energy for me to figure out customizing broadcasting over custom arrays than just using Base.Array
. I'm also concerned about changes like SciML/RecursiveArrayTools.jl#343.
My plan is to swap between Matrix{<:SVector{N, T}}
and Array{T, 3}
using unsafe_wrap
, which is currently what Trixi does for other solvers too. My guess is that it won't be nearly as performant once we make these changes, since we have a few pieces of code which are accelerated by Octavian.jl and LoopVec.jl.
However, I'm less worried about efficiency at the moment and more about maintainability, which I think this would help with.
Thanks - I removed the ERROR: TaskFailedException
nested task error: UndefRefError: access to undefined reference so I think I'm going to have to dig a little deeper beyond removing Octavian dependencies to figure out what's going wrong... |
Can you @jlchan try replace Trixi.jl/src/solvers/dgmulti/flux_differencing.jl Lines 401 to 407 in 00ef308
Matrix is not a sub type of StructArray .
I am still trying to fix but I am not so familiar with dgmulti so things look a little bit messy for me now. |
Trixi.jl/src/solvers/dgmulti/flux_differencing.jl Lines 384 to 399 in 00ef308
cons2entropy! above will not work
|
@huiyuxie thanks for taking a look. I don't think I end up using those functions in this PR. Since I switched the underlying solution type to FYI @huiyuxie, I am discussing how best to clean up Since there will likely be significant changes to |
I see thanks for letting me know @jlchan! Does this mean that I don't have to keep fixing this issue and can wait for you to resolve it? I am also curious why
Will it take long? If you need help implementing the new version, please let me know; I am willing to help. |
Yes, I think that would be best. I will try to keep you in the loop, however - and will ask for your help (if you are still interested at the time) once we have planned out how best to fix things.
Good question; it is because in See also @chriselrod's comment here |
The planning part may take some time since we need to talk to several other end-users to figure out what to keep and what to remove in We will definitely ask for your help once we are past the initial planning stage. Thank you again @huiyuxie! |
I see thanks! @jlchan |
Also bumps StartUpDG.jl compat to 1.0.