From 7ce50e1213bdbbaeb46aac5836426965114e1f09 Mon Sep 17 00:00:00 2001 From: bennibolm Date: Mon, 9 Dec 2024 12:30:23 +0100 Subject: [PATCH 1/8] Disable (t8code-fv) elixir advection basic in mpi tests --- test/test_t8code_fv_2d.jl | 86 +++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/test/test_t8code_fv_2d.jl b/test/test_t8code_fv_2d.jl index 279e70951e6..dbc056522db 100644 --- a/test/test_t8code_fv_2d.jl +++ b/test/test_t8code_fv_2d.jl @@ -44,49 +44,49 @@ mkdir(outdir) # end # end -@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, - l2=[0.08551397247817498], - linf=[0.12087467695430498]) - # 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"), - l2=[0.008142380494734171], - linf=[0.018687916234976898]) - # 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, extended reconstruction stencil" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), - extended_reconstruction_stencil=true, - l2=[0.028436326251639936], - linf=[0.08696815845435057]) - # 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_basic.jl" begin +# @trixi_testset "first-order FV" begin +# @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), +# order=1, +# l2=[0.08551397247817498], +# linf=[0.12087467695430498]) +# # 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"), +# l2=[0.008142380494734171], +# linf=[0.018687916234976898]) +# # 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, extended reconstruction stencil" begin +# @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), +# extended_reconstruction_stencil=true, +# l2=[0.028436326251639936], +# linf=[0.08696815845435057]) +# # 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 @trixi_testset "first-order FV" begin From c7c7131899c68bb375194005e9f8ba7184061eb7 Mon Sep 17 00:00:00 2001 From: bennibolm Date: Mon, 9 Dec 2024 14:17:54 +0100 Subject: [PATCH 2/8] Disable correct test --- test/test_mpi_t8code_fv_2d.jl | 62 ++++++++++++------------- test/test_t8code_fv_2d.jl | 86 +++++++++++++++++------------------ 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/test/test_mpi_t8code_fv_2d.jl b/test/test_mpi_t8code_fv_2d.jl index 629942abe81..cfc2892958a 100644 --- a/test/test_mpi_t8code_fv_2d.jl +++ b/test/test_mpi_t8code_fv_2d.jl @@ -13,37 +13,37 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_2d_fv") # Run basic tests @testset "Examples 2D" begin # Linear scalar advection - @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, - l2=[0.08551397247817498], - linf=[0.12087467695430498]) - # 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"), - l2=[0.008142380494734171], - linf=[0.018687916234976898]) - # 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.jl" begin + # @trixi_testset "first-order FV" begin + # @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + # order=1, + # l2=[0.08551397247817498], + # linf=[0.12087467695430498]) + # # 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"), + # l2=[0.008142380494734171], + # linf=[0.018687916234976898]) + # # 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_gauss.jl" begin @trixi_testset "first-order FV" begin diff --git a/test/test_t8code_fv_2d.jl b/test/test_t8code_fv_2d.jl index dbc056522db..279e70951e6 100644 --- a/test/test_t8code_fv_2d.jl +++ b/test/test_t8code_fv_2d.jl @@ -44,49 +44,49 @@ mkdir(outdir) # end # end -# @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, -# l2=[0.08551397247817498], -# linf=[0.12087467695430498]) -# # 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"), -# l2=[0.008142380494734171], -# linf=[0.018687916234976898]) -# # 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, extended reconstruction stencil" begin -# @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), -# extended_reconstruction_stencil=true, -# l2=[0.028436326251639936], -# linf=[0.08696815845435057]) -# # 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_basic.jl" begin + @trixi_testset "first-order FV" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + order=1, + l2=[0.08551397247817498], + linf=[0.12087467695430498]) + # 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"), + l2=[0.008142380494734171], + linf=[0.018687916234976898]) + # 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, extended reconstruction stencil" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + extended_reconstruction_stencil=true, + l2=[0.028436326251639936], + linf=[0.08696815845435057]) + # 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 @trixi_testset "first-order FV" begin From 91ae4d2c15b6481616e88c4079ae74cf872377c8 Mon Sep 17 00:00:00 2001 From: bennibolm Date: Mon, 9 Dec 2024 15:41:12 +0100 Subject: [PATCH 3/8] Enable test again. Disable `solve()` --- .../t8code_2d_fv/elixir_advection_basic.jl | 8 +-- test/test_mpi_t8code_fv_2d.jl | 62 +++++++++---------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/examples/t8code_2d_fv/elixir_advection_basic.jl b/examples/t8code_2d_fv/elixir_advection_basic.jl index 4808ef35b57..d0c983dbe32 100644 --- a/examples/t8code_2d_fv/elixir_advection_basic.jl +++ b/examples/t8code_2d_fv/elixir_advection_basic.jl @@ -88,9 +88,9 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, ############################################################################### # run the simulation -sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), - dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep = false, callback = callbacks); -summary_callback() +# sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), +# dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback +# save_everystep = false, callback = callbacks); +# summary_callback() GC.enable(true) diff --git a/test/test_mpi_t8code_fv_2d.jl b/test/test_mpi_t8code_fv_2d.jl index cfc2892958a..629942abe81 100644 --- a/test/test_mpi_t8code_fv_2d.jl +++ b/test/test_mpi_t8code_fv_2d.jl @@ -13,37 +13,37 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_2d_fv") # Run basic tests @testset "Examples 2D" begin # Linear scalar advection - # @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, - # l2=[0.08551397247817498], - # linf=[0.12087467695430498]) - # # 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"), - # l2=[0.008142380494734171], - # linf=[0.018687916234976898]) - # # 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.jl" begin + @trixi_testset "first-order FV" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + order=1, + l2=[0.08551397247817498], + linf=[0.12087467695430498]) + # 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"), + l2=[0.008142380494734171], + linf=[0.018687916234976898]) + # 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_gauss.jl" begin @trixi_testset "first-order FV" begin From 2d6252536446d6264e3bfa76fa914f7c3564228f Mon Sep 17 00:00:00 2001 From: bennibolm Date: Tue, 10 Dec 2024 10:08:06 +0100 Subject: [PATCH 4/8] Set end time to zero in gauss; deactivate some tests --- .../t8code_2d_fv/elixir_advection_gauss.jl | 2 +- test/test_mpi_t8code_fv_2d.jl | 48 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/examples/t8code_2d_fv/elixir_advection_gauss.jl b/examples/t8code_2d_fv/elixir_advection_gauss.jl index 942bfa5d6e5..5afd4ac410f 100644 --- a/examples/t8code_2d_fv/elixir_advection_gauss.jl +++ b/examples/t8code_2d_fv/elixir_advection_gauss.jl @@ -19,7 +19,7 @@ mesh = T8codeMesh(cmesh, solver, initial_refinement_level = initial_refinement_l semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) -ode = semidiscretize(semi, (0.0, 20.0)); +ode = semidiscretize(semi, (0.0, 0.0)); summary_callback = SummaryCallback() diff --git a/test/test_mpi_t8code_fv_2d.jl b/test/test_mpi_t8code_fv_2d.jl index 629942abe81..451eb7971ff 100644 --- a/test/test_mpi_t8code_fv_2d.jl +++ b/test/test_mpi_t8code_fv_2d.jl @@ -16,30 +16,30 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_2d_fv") @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, - l2=[0.08551397247817498], - linf=[0.12087467695430498]) + order=1,) + # l2=[0.08551397247817498], + # linf=[0.12087467695430498]) # 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 + # 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"), - l2=[0.008142380494734171], - linf=[0.018687916234976898]) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"),) + # l2=[0.008142380494734171], + # linf=[0.018687916234976898]) # 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 + # 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. @@ -49,9 +49,9 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_2d_fv") @trixi_testset "first-order FV" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_gauss.jl"), - order=1, - l2=[0.5598148317954682], - linf=[0.6301130236005371]) + order=1,) + # l2=[0.5598148317954682], + # linf=[0.6301130236005371]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -63,9 +63,9 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_2d_fv") end @trixi_testset "second-order FV" begin @test_trixi_include(joinpath(EXAMPLES_DIR, - "elixir_advection_gauss.jl"), - l2=[0.5899077806567905], - linf=[0.8972489222157533]) + "elixir_advection_gauss.jl"),) + # l2=[0.5899077806567905], + # linf=[0.8972489222157533]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From f52cbfdc62c27ef41db57e6ea1515d462b488995 Mon Sep 17 00:00:00 2001 From: bennibolm Date: Wed, 11 Dec 2024 15:18:20 +0100 Subject: [PATCH 5/8] Remove unnecessary tests --- .github/workflows/ci.yml | 70 ++++++++++++++++++++-------------------- test/test_mpi.jl | 6 ++-- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e28e148e29..c0e71034167 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,52 +60,52 @@ jobs: arch: - x64 trixi_test: - - tree_part1 - - tree_part2 - - tree_part3 - - tree_part4 - - tree_part5 - - tree_part6 - - structured - - p4est_part1 - - p4est_part2 - - t8code_part1 - - t8code_part2 + # - tree_part1 + # - tree_part2 + # - tree_part3 + # - tree_part4 + # - tree_part5 + # - tree_part6 + # - structured + # - p4est_part1 + # - p4est_part2 + # - t8code_part1 + # - t8code_part2 - t8code_fv - - unstructured_dgmulti - - parabolic - - paper_self_gravitating_gas_dynamics - - misc_part1 - - misc_part2 - - performance_specializations_part1 - - performance_specializations_part2 + # - unstructured_dgmulti + # - parabolic + # - paper_self_gravitating_gas_dynamics + # - misc_part1 + # - misc_part2 + # - performance_specializations_part1 + # - performance_specializations_part2 - mpi - - threaded + # - threaded include: - - version: '1.8' - os: ubuntu-latest - arch: x64 - trixi_test: threaded_legacy - - version: '1.9' - os: ubuntu-latest - arch: x64 - trixi_test: threaded_legacy + # - version: '1.8' + # os: ubuntu-latest + # arch: x64 + # trixi_test: threaded_legacy + # - version: '1.9' + # os: ubuntu-latest + # arch: x64 + # trixi_test: threaded_legacy - version: '1.10' os: macos-13 arch: x64 trixi_test: mpi - - version: '1.10' - os: macos-latest - arch: aarch64 - trixi_test: threaded + # - version: '1.10' + # os: macos-latest + # arch: aarch64 + # trixi_test: threaded - version: '1.10' os: windows-latest arch: x64 trixi_test: mpi - - version: '1.10' - os: windows-latest - arch: x64 - trixi_test: threaded + # - version: '1.10' + # os: windows-latest + # arch: x64 + # trixi_test: threaded steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 diff --git a/test/test_mpi.jl b/test/test_mpi.jl index 4f9eb65ecd8..517dedd8498 100644 --- a/test/test_mpi.jl +++ b/test/test_mpi.jl @@ -18,14 +18,14 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows() @testset "MPI" begin # TreeMesh tests - include("test_mpi_tree.jl") + # include("test_mpi_tree.jl") # P4estMesh and T8codeMesh tests - include("test_mpi_p4est_2d.jl") + # include("test_mpi_p4est_2d.jl") include("test_mpi_t8code_2d.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_p4est_3d.jl") include("test_mpi_t8code_3d.jl") include("test_mpi_t8code_fv_3d.jl") end From e1770ae385be4266867e2e6c022ffa991eeb24dc Mon Sep 17 00:00:00 2001 From: bennibolm Date: Wed, 11 Dec 2024 15:23:59 +0100 Subject: [PATCH 6/8] Add some tests and comments --- .../t8code_2d_fv/elixir_advection_basic.jl | 14 ++++++++------ .../t8code_2d_fv/elixir_advection_gauss.jl | 6 +++--- src/callbacks_step/analysis.jl | 1 + src/solvers/fv_t8code/fv.jl | 19 ++++++++++--------- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/examples/t8code_2d_fv/elixir_advection_basic.jl b/examples/t8code_2d_fv/elixir_advection_basic.jl index d0c983dbe32..1aba4124870 100644 --- a/examples/t8code_2d_fv/elixir_advection_basic.jl +++ b/examples/t8code_2d_fv/elixir_advection_basic.jl @@ -67,7 +67,7 @@ mesh = T8codeMesh(trees_per_dimension, element_class, semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) -tspan = (0.0, 1.0) +tspan = (0.0, 0.0) ode = semidiscretize(semi, tspan); summary_callback = SummaryCallback() @@ -87,10 +87,12 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, ############################################################################### # run the simulation - -# sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), -# dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback -# save_everystep = false, callback = callbacks); -# summary_callback() +println("Directly before solve") +sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), + dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep = false, callback = callbacks, maxiters = 0); +println("Directly after solve") +summary_callback() +println("Directly after summary_callback") GC.enable(true) diff --git a/examples/t8code_2d_fv/elixir_advection_gauss.jl b/examples/t8code_2d_fv/elixir_advection_gauss.jl index 5afd4ac410f..3386e3e1d02 100644 --- a/examples/t8code_2d_fv/elixir_advection_gauss.jl +++ b/examples/t8code_2d_fv/elixir_advection_gauss.jl @@ -24,7 +24,7 @@ ode = semidiscretize(semi, (0.0, 0.0)); summary_callback = SummaryCallback() analysis_interval = 100 -analysis_callback = AnalysisCallback(semi, interval = analysis_interval) +# analysis_callback = AnalysisCallback(semi, interval = analysis_interval) alive_callback = AliveCallback(analysis_interval = analysis_interval) @@ -33,7 +33,7 @@ save_solution = SaveSolutionCallback(interval = 10, stepsize_callback = StepsizeCallback(cfl = 0.5) -callbacks = CallbackSet(summary_callback, save_solution, analysis_callback, alive_callback, +callbacks = CallbackSet(#=summary_callback,=# save_solution, #=analysis_callback,=# alive_callback, stepsize_callback) ############################################################################### @@ -42,4 +42,4 @@ callbacks = CallbackSet(summary_callback, save_solution, analysis_callback, aliv sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),#Euler(), dt = 5.0e-2, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep = false, callback = callbacks); -summary_callback() +# summary_callback() diff --git a/src/callbacks_step/analysis.jl b/src/callbacks_step/analysis.jl index 0a26bbdbebe..85c9d444e72 100644 --- a/src/callbacks_step/analysis.jl +++ b/src/callbacks_step/analysis.jl @@ -233,6 +233,7 @@ end # This method gets called internally as the main entry point to the AnalysiCallback # TODO: Taal refactor, allow passing an IO object (which could be devnull to avoid cluttering the console) function (analysis_callback::AnalysisCallback)(u_ode, du_ode, integrator, semi) + println("Start of analysis_callback") mesh, equations, solver, cache = mesh_equations_solver_cache(semi) @unpack dt, t = integrator iter = integrator.stats.naccept diff --git a/src/solvers/fv_t8code/fv.jl b/src/solvers/fv_t8code/fv.jl index e531c6ee8a5..d6bd6e17782 100644 --- a/src/solvers/fv_t8code/fv.jl +++ b/src/solvers/fv_t8code/fv.jl @@ -162,43 +162,44 @@ end function rhs!(du, u, t, mesh::T8codeMesh, equations, boundary_conditions, source_terms::Source, solver::FV, cache) where {Source} + println("1. Start of actual rhs!") # Reset du @trixi_timeit timer() "reset ∂u/∂t" du.=zero(eltype(du)) - + println("2. actual rhs!") # Exchange solution between MPI ranks @trixi_timeit timer() "exchange_solution_data!" exchange_solution_data!(u, mesh, equations, solver, cache) - + println("3. of actual rhs!") @trixi_timeit timer() "gradient reconstruction" calc_gradient_reconstruction!(u, mesh, equations, solver, cache) - + println("4. of actual rhs!") # Prolong solution to interfaces @trixi_timeit timer() "prolong2interfaces" begin prolong2interfaces!(cache, mesh, equations, solver) end - + println("5. of actual rhs!") # Calculate interface fluxes @trixi_timeit timer() "interface flux" begin calc_interface_flux!(du, mesh, have_nonconservative_terms(equations), equations, solver, cache) end - + println("6. of actual rhs!") # Prolong solution to boundaries @trixi_timeit timer() "prolong2boundaries!" begin prolong2boundaries!(cache, mesh, equations, solver) end - + println("7. of actual rhs!") # Calculate boundary fluxes @trixi_timeit timer() "calc boundary flux" begin calc_boundary_flux!(du, cache, t, boundary_conditions, mesh, equations, solver) end - + println("8. of actual rhs!") @trixi_timeit timer() "volume" begin for element in eachelement(mesh, solver, cache) volume = cache.elements.volume[element] @@ -207,12 +208,12 @@ function rhs!(du, u, t, mesh::T8codeMesh, equations, end end end - + println("9. of actual rhs!") # Calculate source terms @trixi_timeit timer() "source terms" begin calc_sources!(du, u, t, source_terms, mesh, equations, solver, cache) end - + println("10. End of actual rhs!") return nothing end From 85588e2a8957ee49e12530a1231a194eae195a7b Mon Sep 17 00:00:00 2001 From: bennibolm Date: Wed, 11 Dec 2024 16:26:50 +0100 Subject: [PATCH 7/8] Add comments --- src/callbacks_step/alive.jl | 4 ++++ src/callbacks_step/stepsize.jl | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/callbacks_step/alive.jl b/src/callbacks_step/alive.jl index fe2234166cd..43838fe3265 100644 --- a/src/callbacks_step/alive.jl +++ b/src/callbacks_step/alive.jl @@ -75,6 +75,8 @@ end # this method is called when the callback is activated function (alive_callback::AliveCallback)(integrator) + + println("Start of alive callback") # Checking for floating point equality is OK here as `DifferentialEquations.jl` # sets the time exactly to the final time in the last iteration if isfinished(integrator) && mpi_isroot() @@ -98,6 +100,8 @@ function (alive_callback::AliveCallback)(integrator) # avoid re-evaluating possible FSAL stages u_modified!(integrator, false) + + println("End of alive callback") return nothing end end # @muladd diff --git a/src/callbacks_step/stepsize.jl b/src/callbacks_step/stepsize.jl index 0a95cb35ad3..4d69f08e5b7 100644 --- a/src/callbacks_step/stepsize.jl +++ b/src/callbacks_step/stepsize.jl @@ -59,6 +59,7 @@ end # This method is called as callback during the time integration. @inline function (stepsize_callback::StepsizeCallback)(integrator) + println("Start of stepsize_callback") # TODO: Taal decide, shall we set the time step even if the integrator is adaptive? if !integrator.opts.adaptive t = integrator.t @@ -77,6 +78,7 @@ end # avoid re-evaluating possible FSAL stages u_modified!(integrator, false) + println("End of stepsize_callback") return nothing end From 5c1302a3bac72e70a3ae6839df6a33f75e9759e6 Mon Sep 17 00:00:00 2001 From: bennibolm Date: Fri, 13 Dec 2024 17:07:00 +0100 Subject: [PATCH 8/8] Add serial macOS and windows tests --- .github/workflows/ci.yml | 8 ++++++++ src/callbacks_step/alive.jl | 3 --- src/callbacks_step/save_solution.jl | 2 ++ src/solvers/fv_t8code/fv.jl | 19 +++++++++---------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0e71034167..003afe5ce7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,6 +82,14 @@ jobs: - mpi # - threaded include: + - version: '1.10' + os: macos-13 + arch: x64 + trixi_test: t8code_fv + - version: '1.10' + os: windows-latest + arch: x64 + trixi_test: t8code_fv # - version: '1.8' # os: ubuntu-latest # arch: x64 diff --git a/src/callbacks_step/alive.jl b/src/callbacks_step/alive.jl index 43838fe3265..edac17f84d5 100644 --- a/src/callbacks_step/alive.jl +++ b/src/callbacks_step/alive.jl @@ -75,8 +75,6 @@ end # this method is called when the callback is activated function (alive_callback::AliveCallback)(integrator) - - println("Start of alive callback") # Checking for floating point equality is OK here as `DifferentialEquations.jl` # sets the time exactly to the final time in the last iteration if isfinished(integrator) && mpi_isroot() @@ -101,7 +99,6 @@ function (alive_callback::AliveCallback)(integrator) # avoid re-evaluating possible FSAL stages u_modified!(integrator, false) - println("End of alive callback") return nothing end end # @muladd diff --git a/src/callbacks_step/save_solution.jl b/src/callbacks_step/save_solution.jl index 58fedbb2d1d..7afb6f0bd1f 100644 --- a/src/callbacks_step/save_solution.jl +++ b/src/callbacks_step/save_solution.jl @@ -257,6 +257,7 @@ function save_solution_file(u, time, dt, timestep, system = "") @unpack output_directory, solution_variables = solution_callback + println("Start of save_solution_file") # Filename based on current time step if isempty(system) filename = joinpath(output_directory, @sprintf("solution_%09d.h5", timestep)) @@ -269,6 +270,7 @@ function save_solution_file(u, time, dt, timestep, Trixi.output_data_to_vtu(mesh, equations, solver, cache.communication_data.solution_data, filename, solution_variables) + println("End of save_solution_file") return filename end diff --git a/src/solvers/fv_t8code/fv.jl b/src/solvers/fv_t8code/fv.jl index d6bd6e17782..e531c6ee8a5 100644 --- a/src/solvers/fv_t8code/fv.jl +++ b/src/solvers/fv_t8code/fv.jl @@ -162,44 +162,43 @@ end function rhs!(du, u, t, mesh::T8codeMesh, equations, boundary_conditions, source_terms::Source, solver::FV, cache) where {Source} - println("1. Start of actual rhs!") # Reset du @trixi_timeit timer() "reset ∂u/∂t" du.=zero(eltype(du)) - println("2. actual rhs!") + # Exchange solution between MPI ranks @trixi_timeit timer() "exchange_solution_data!" exchange_solution_data!(u, mesh, equations, solver, cache) - println("3. of actual rhs!") + @trixi_timeit timer() "gradient reconstruction" calc_gradient_reconstruction!(u, mesh, equations, solver, cache) - println("4. of actual rhs!") + # Prolong solution to interfaces @trixi_timeit timer() "prolong2interfaces" begin prolong2interfaces!(cache, mesh, equations, solver) end - println("5. of actual rhs!") + # Calculate interface fluxes @trixi_timeit timer() "interface flux" begin calc_interface_flux!(du, mesh, have_nonconservative_terms(equations), equations, solver, cache) end - println("6. of actual rhs!") + # Prolong solution to boundaries @trixi_timeit timer() "prolong2boundaries!" begin prolong2boundaries!(cache, mesh, equations, solver) end - println("7. of actual rhs!") + # Calculate boundary fluxes @trixi_timeit timer() "calc boundary flux" begin calc_boundary_flux!(du, cache, t, boundary_conditions, mesh, equations, solver) end - println("8. of actual rhs!") + @trixi_timeit timer() "volume" begin for element in eachelement(mesh, solver, cache) volume = cache.elements.volume[element] @@ -208,12 +207,12 @@ function rhs!(du, u, t, mesh::T8codeMesh, equations, end end end - println("9. of actual rhs!") + # Calculate source terms @trixi_timeit timer() "source terms" begin calc_sources!(du, u, t, source_terms, mesh, equations, solver, cache) end - println("10. End of actual rhs!") + return nothing end