trixi-framework / trixi-framework/Trixi.jl
If-condition could cause performance issues with CurvedMesh
- Dominant language
- Julia
- Stars
- 731
- Forks
- 166
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 25
Description
In #514, the code
```julia
if left_element <= 0 # left_element = 0 at boundaries
return surface_flux_values
end
```
is introduced in `solvers/dg_curved/dg_2d.jl`.
This is quite a bit slower than without the condition for LSA, but for some reason a bit faster for compressible Euler.
This benchmark can be used to investigate the difference:
```julia
using Trixi
using BenchmarkTools
trixi_include("examples/2d/elixir_euler_source_terms_curved.jl")
u = Trixi.wrap_array(sol.u[begin], semi)
@benchmark Trixi.calc_interface_flux!($u, $mesh, $equations, $solver, $semi.cache)
```
Contributor guide
Research direction
Start in solvers/dg_curved/dg_2d.jl and run the provided BenchmarkTools example from examples/2d/elixir_euler_source_terms_curved.jl. Compare calc_interface_flux! with and without the left_element condition for the shown case and the LSA and compressible Euler workloads. Done means identifying the cause of the performance difference and documenting or implementing a measured improvement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100