Add tests for serial and static backend#3004
Conversation
Follows the same pattern as test_kernelabstractions.jl: sets the backend preference, relaunches Julia so the @static dispatch in @threaded compiles with the new backend, runs a basic advection and Euler test to confirm correctness, then restores the original backend. The serial test uses exact reference values; the static (Threads.@threads) test uses rtol=0.001 to allow for non-deterministic floating-point ordering across threads. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…for static The euler example needs the out/ directory to exist before saving restart files. Threads.@threads :static allocates ~20-32KB per rhs! call (vs ~0 for Polyester @Batch), so use per-backend allocation thresholds rather than the Polyester-tuned 5000 limit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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. |
| # (e.g., from type instabilities) | ||
| @test_allocations(Trixi.rhs!, semi, sol, 5000) | ||
| end | ||
|
|
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| # Threads.@threads :static has more overhead than Polyester's @batch | ||
| @test_allocations(Trixi.rhs!, semi, sol, 50_000) | ||
| end | ||
|
|
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3004 +/- ##
=======================================
Coverage 97.13% 97.13%
=======================================
Files 625 625
Lines 48514 48516 +2
=======================================
+ Hits 47122 47124 +2
Misses 1392 1392
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| - serial | ||
| - threads |
There was a problem hiding this comment.
Can we find a bit more descriptive name for it, e.g., base_threads or so?
ranocha
left a comment
There was a problem hiding this comment.
Thanks, that's a good idea. Since we will likely not need many tests in here, could it be an option to use a single additional CI job for both cases to reduce overhead from installing Trixi.jl etc.?
Did you make sure to include at least
- one elixir without manual threading for the ODE solver,
- one elixir with manual threading for the ODE solver,
- and one elixir with a Trixi.jl-internal time integrator?
Given that we are adding some more backend specific behavior (as an example #3003),
we should have some smoke tests for the different backends