Skip to content

Commit

Permalink
Add 3d mpi tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Oct 15, 2024
1 parent 9b09a4b commit 32dab35
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 16 deletions.
3 changes: 2 additions & 1 deletion test/test_mpi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows()
# P4estMesh and T8codeMesh tests
include("test_mpi_p4est_2d.jl")
include("test_mpi_t8code_2d.jl")
include("test_mpi_t8code_fv.jl")
include("test_mpi_t8code_fv_2d.jl")
if !CI_ON_WINDOWS # see comment on `CI_ON_WINDOWS` above
include("test_mpi_p4est_3d.jl")
include("test_mpi_t8code_3d.jl")
include("test_mpi_t8code_fv_3d.jl")
end
end # MPI

Expand Down
15 changes: 0 additions & 15 deletions test/test_mpi_t8code_fv.jl → test/test_mpi_t8code_fv_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,6 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_2d_fv")
end
# The extended reconstruction stencil is currently not mpi parallel.
# The current version runs through but an error occurs on some rank.
# @trixi_testset "second-order FV, extended reconstruction stencil" begin
# @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"),
# order=2,
# extended_reconstruction_stencil=true,
# l2=[0.020331012873518642],
# linf=[0.05571209803860677])
# # 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
end

@trixi_testset "elixir_advection_gauss.jl" begin
Expand Down
95 changes: 95 additions & 0 deletions test/test_mpi_t8code_fv_3d.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
module TestExamplesMPIT8codeMesh2D

using Test
using Trixi

include("test_trixi.jl")

const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_3d_fv")

@testset "T8codeMesh MPI FV" begin
#! format: noindent

# Run basic tests
@testset "Examples 3D" begin
@trixi_testset "elixir_advection_basic.jl" begin
@trixi_testset "first-order FV" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"),
order=1,
initial_refinement_level=2+2,
l2=[0.2848617953369851],
linf=[0.3721898718954475])
# 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 "second-order FV" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"),
initial_refinement_level=2+2,
l2=[0.10381089565603231],
linf=[0.13787405651527007])
# 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
# The extended reconstruction stencil is currently not mpi parallel.
# The current version runs through but an error occurs on some rank.
end

@trixi_testset "elixir_advection_basic_hybrid.jl" begin
@trixi_testset "first-order FV" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic_hybrid.jl"),
order=1,
l2=[0.20282363730327146],
linf=[0.28132446651281295])
# 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 "second-order FV" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic_hybrid.jl"),
l2=[0.02153993127089835],
linf=[0.039109618097251886])
# 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
end

@trixi_testset "elixir_advection_nonperiodic.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_nonperiodic.jl"),
l2=[0.022202106950138526],
linf=[0.0796166790338586])
# 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
end
end # T8codeMesh MPI

end # module

0 comments on commit 32dab35

Please sign in to comment.