From 32dab35d07939db1242e4e397c2ed27a36d8faaf Mon Sep 17 00:00:00 2001 From: bennibolm Date: Tue, 15 Oct 2024 10:36:34 +0200 Subject: [PATCH] Add 3d mpi tests --- test/test_mpi.jl | 3 +- ..._t8code_fv.jl => test_mpi_t8code_fv_2d.jl} | 15 --- test/test_mpi_t8code_fv_3d.jl | 95 +++++++++++++++++++ 3 files changed, 97 insertions(+), 16 deletions(-) rename test/{test_mpi_t8code_fv.jl => test_mpi_t8code_fv_2d.jl} (95%) create mode 100644 test/test_mpi_t8code_fv_3d.jl diff --git a/test/test_mpi.jl b/test/test_mpi.jl index f36b669d3c3..4f9eb65ecd8 100644 --- a/test/test_mpi.jl +++ b/test/test_mpi.jl @@ -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 diff --git a/test/test_mpi_t8code_fv.jl b/test/test_mpi_t8code_fv_2d.jl similarity index 95% rename from test/test_mpi_t8code_fv.jl rename to test/test_mpi_t8code_fv_2d.jl index 5a2d9525558..54b4cd83333 100644 --- a/test/test_mpi_t8code_fv.jl +++ b/test/test_mpi_t8code_fv_2d.jl @@ -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 diff --git a/test/test_mpi_t8code_fv_3d.jl b/test/test_mpi_t8code_fv_3d.jl new file mode 100644 index 00000000000..5818b777b5a --- /dev/null +++ b/test/test_mpi_t8code_fv_3d.jl @@ -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