-
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
Thread Parallel Reduction for integrate_via_indices
#2201
Thread Parallel Reduction for integrate_via_indices
#2201
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 #2201 +/- ##
==========================================
- Coverage 96.39% 96.36% -0.03%
==========================================
Files 483 483
Lines 38349 38349
==========================================
- Hits 36964 36952 -12
- Misses 1385 1397 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
In the context of #2029 we should probably not use |
How can we do multi-threaded reduction with |
@carstenbauer suggested this package to me for multithreaded reduction: https://github.com/JuliaFolds2/OhMyThreads.jl |
As suggested by @efaulhaber one can use the reduction operation/macro from
Polyester.jl
to speed up stuff like integrals (and errors; to come).The larger the simulation, the larger the speedup. But even for something with relatively few elements (I used https://github.com/trixi-framework/Trixi.jl/blob/main/examples/p4est_2d_dgsem/elixir_euler_supersonic_cylinder.jl stopping at
2e-2
with element hierarchyUsing 2 threads to compute
Trixi.analyze(Trixi.entropy_timederivative, u_wrap, u_wrap, tspan[2], mesh, equations, solver, semi.cache)
(which is computed in everyAnalysisCallback
call by default) results incompared to 1 thread: