Skip to content

Commit

Permalink
check for allocations from mortars (trixi-framework#1405)
Browse files Browse the repository at this point in the history
* check for allocations from mortars

* update comment
  • Loading branch information
ranocha authored Apr 20, 2023
1 parent 5e28148 commit 82932dd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_p4est_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ isdir(outdir) && rm(outdir, recursive=true)
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_nonconforming_flag.jl"),
l2 = [3.198940059144588e-5],
linf = [0.00030636069494005547])

# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end

@trixi_testset "elixir_advection_unstructured_flag.jl" begin
Expand Down
9 changes: 9 additions & 0 deletions test/test_p4est_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ isdir(outdir) && rm(outdir, recursive=true)
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_nonconforming.jl"),
l2 = [0.00253595715323843],
linf = [0.016486952252155795])

# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end

@trixi_testset "elixir_advection_amr.jl" begin
Expand Down
9 changes: 9 additions & 0 deletions test/test_tree_2d_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "tree_2
# Expected errors are exactly the same as in the parallel test!
l2 = [0.0015188466707237375],
linf = [0.008446655719187679])

# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end

@trixi_testset "elixir_advection_amr.jl" begin
Expand Down
9 changes: 9 additions & 0 deletions test/test_tree_3d_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "tree_3
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_mortar.jl"),
l2 = [0.001810141301577316],
linf = [0.017848192256602058])

# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end

@trixi_testset "elixir_advection_amr.jl" begin
Expand Down

0 comments on commit 82932dd

Please sign in to comment.