Skip to content

Allow more allocations in threaded test#151

Merged
tristanmontoya merged 1 commit intomainfrom
ranocha-patch-1
Mar 18, 2026
Merged

Allow more allocations in threaded test#151
tristanmontoya merged 1 commit intomainfrom
ranocha-patch-1

Conversation

@ranocha
Copy link
Copy Markdown
Member

@ranocha ranocha commented Mar 17, 2026

I just bisected this to updating Trixi.jl from v0.15.7 to v0.15.8. The explanation is that trixi-framework/Trixi.jl#2831 introduced an additional threaded loop prolong2interfaces!. Since threaded code leads to some small amount of allocations, this explains the additional allocations.

With Trixi.jl v0.15.7:

julia> u_ode = copy(sol.u[end]); du_ode = similar(u_ode); @allocations Trixi.rhs!(du_ode, u_ode, semi, 0.0)
5

julia> u_ode = copy(sol.u[end]); du_ode = similar(u_ode); @allocated Trixi.rhs!(du_ode, u_ode, semi, 0.0)
1984

With Trixi.jl v0.15.8:

julia> u_ode = copy(sol.u[end]); du_ode = similar(u_ode); @allocations Trixi.rhs!(du_ode, u_ode, semi, 0.0)
6

julia> u_ode = copy(sol.u[end]); du_ode = similar(u_ode); @allocated Trixi.rhs!(du_ode, u_ode, semi, 0.0)
2352

We clearly see that there is one additional allocation caused by one additional threaded loop.

Closes #148

@tristanmontoya
Copy link
Copy Markdown
Member

Thanks for tracking this one down!

@ranocha
Copy link
Copy Markdown
Member Author

ranocha commented Mar 18, 2026

There are even more errors than the one fixed in #153. Please fix them and proceed with merging the PRs as you see fit.

@tristanmontoya
Copy link
Copy Markdown
Member

There are even more errors than the one fixed in #153. Please fix them and proceed with merging the PRs as you see fit.

Yes, finishing that now.

@tristanmontoya tristanmontoya enabled auto-merge (squash) March 18, 2026 08:14
@tristanmontoya tristanmontoya disabled auto-merge March 18, 2026 08:15
@tristanmontoya tristanmontoya merged commit 0517c36 into main Mar 18, 2026
4 of 7 checks passed
@tristanmontoya tristanmontoya deleted the ranocha-patch-1 branch March 18, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too many allocations in moist Euler test

2 participants