From e918b20522583636d1dbe1146dbf36fca700e65d Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Tue, 23 Apr 2024 16:10:26 +0200 Subject: [PATCH 01/17] save and load user_data for p4est this fixes restating when using AMR --- src/auxiliary/p4est.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/auxiliary/p4est.jl b/src/auxiliary/p4est.jl index 0b826254129..9ce7fab62a3 100644 --- a/src/auxiliary/p4est.jl +++ b/src/auxiliary/p4est.jl @@ -84,14 +84,14 @@ end # Save `p4est` data to file # 2D function save_p4est!(file, p4est::PointerOrWrapper{p4est_t}) - # Don't save user data of the quads - p4est_save(file, p4est, false) + # Also save user data to be able to reload it for restarts + p4est_save(file, p4est, true) end # 3D function save_p4est!(file, p8est::PointerOrWrapper{p8est_t}) - # Don't save user data of the quads - p8est_save(file, p8est, false) + # Also save user data to be able to reload it for restarts + p8est_save(file, p8est, true) end # Load `p4est` from file @@ -99,14 +99,14 @@ end function load_p4est(file, ::Val{2}) conn_vec = Vector{Ptr{p4est_connectivity_t}}(undef, 1) comm = P4est.uses_mpi() ? mpi_comm() : C_NULL # Use Trixi.jl's MPI communicator if p4est supports MPI - p4est_load_ext(file, comm, 0, 0, 1, 0, C_NULL, pointer(conn_vec)) + p4est_load_ext(file, comm, 2 * sizeof(Int), 1, 1, 0, C_NULL, pointer(conn_vec)) end # 3D function load_p4est(file, ::Val{3}) conn_vec = Vector{Ptr{p8est_connectivity_t}}(undef, 1) comm = P4est.uses_mpi() ? mpi_comm() : C_NULL # Use Trixi.jl's MPI communicator if p4est supports MPI - p8est_load_ext(file, comm, 0, 0, 1, 0, C_NULL, pointer(conn_vec)) + p8est_load_ext(file, comm, 2 * sizeof(Int), 1, 1, 0, C_NULL, pointer(conn_vec)) end # Read `p4est` connectivity from Abaqus mesh file (.inp) From d965f247c1c4afe36aec2063aa71d9cafec05b42 Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Wed, 29 May 2024 20:19:26 +0200 Subject: [PATCH 02/17] use p4est_reset_data instead --- src/auxiliary/p4est.jl | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/auxiliary/p4est.jl b/src/auxiliary/p4est.jl index 9ce7fab62a3..212dd2e3c5f 100644 --- a/src/auxiliary/p4est.jl +++ b/src/auxiliary/p4est.jl @@ -84,14 +84,14 @@ end # Save `p4est` data to file # 2D function save_p4est!(file, p4est::PointerOrWrapper{p4est_t}) - # Also save user data to be able to reload it for restarts - p4est_save(file, p4est, true) + # Don't save user data of the quads + p4est_save(file, p4est, false) end # 3D function save_p4est!(file, p8est::PointerOrWrapper{p8est_t}) - # Also save user data to be able to reload it for restarts - p8est_save(file, p8est, true) + # Don't save user data of the quads + p8est_save(file, p8est, false) end # Load `p4est` from file @@ -99,14 +99,29 @@ end function load_p4est(file, ::Val{2}) conn_vec = Vector{Ptr{p4est_connectivity_t}}(undef, 1) comm = P4est.uses_mpi() ? mpi_comm() : C_NULL # Use Trixi.jl's MPI communicator if p4est supports MPI - p4est_load_ext(file, comm, 2 * sizeof(Int), 1, 1, 0, C_NULL, pointer(conn_vec)) + p4est = p4est_load_ext(file, + comm, + 0, # Size of user data + 0, # Flag to load user data + 1, # Autopartition: ignore saved partition + 0, # Have only rank 0 read headers and bcast them + C_NULL, # No pointer to user data + pointer(conn_vec)) + # p4est_load_ext only allocates memory when also data is read + # use p4est_reset_data to allocate uninitialized memory + p4est_reset_data(p4est, + 2 * sizeof(Int), # Use Int-Vector of size 2 as quadrant user data + C_NULL, # No init function + C_NULL) # No pointer to user data + return p4est end # 3D function load_p4est(file, ::Val{3}) conn_vec = Vector{Ptr{p8est_connectivity_t}}(undef, 1) comm = P4est.uses_mpi() ? mpi_comm() : C_NULL # Use Trixi.jl's MPI communicator if p4est supports MPI - p8est_load_ext(file, comm, 2 * sizeof(Int), 1, 1, 0, C_NULL, pointer(conn_vec)) + p4est = p8est_load_ext(file, comm, 0, 0, 1, 0, C_NULL, pointer(conn_vec)) + p4est_reset_data(p4est, 2 * sizeof(Int), C_NULL, C_NULL) end # Read `p4est` connectivity from Abaqus mesh file (.inp) From d80957e86e1a6de0655e4482b5ac2c7ced435d4d Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Wed, 29 May 2024 20:19:44 +0200 Subject: [PATCH 03/17] add test for p4est, restart, and AMR --- .../elixir_advection_restart_amr.jl | 54 +++++++++++++++++++ test/test_p4est_2d.jl | 17 ++++++ 2 files changed, 71 insertions(+) create mode 100644 examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl diff --git a/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl b/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl new file mode 100644 index 00000000000..dfe76fbe63a --- /dev/null +++ b/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl @@ -0,0 +1,54 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# create a restart file + +elixir_file = "elixir_advection_extended.jl" +restart_file = "restart_000021.h5" + +trixi_include(@__MODULE__, joinpath(@__DIR__, elixir_file)) + +############################################################################### +# adapt the parameters that have changed compared to "elixir_advection_extended.jl" + +# Note: If you get a restart file from somewhere else, you need to provide +# appropriate setups in the elixir loading a restart file + +restart_filename = joinpath("out", restart_file) +mesh = load_mesh(restart_filename) + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_conditions) + +tspan = (load_time(restart_filename), 2.0) +dt = load_dt(restart_filename) +ode = semidiscretize(semi, tspan, restart_filename); + +# Do not overwrite the initial snapshot written by elixir_advection_extended.jl. +save_solution.condition.save_initial_solution = false + +# Add AMR callback +amr_controller = ControllerThreeLevel(semi, IndicatorMax(semi, variable = first), + base_level = 0, + med_level = 0, med_threshold = 0.8, + max_level = 1, max_threshold = 1.2) +amr_callback = AMRCallback(semi, amr_controller, + interval = 5, + adapt_initial_condition = false, + adapt_initial_condition_only_refine = true) +callbacks_ext = CallbackSet(amr_callback, callbacks.discrete_callbacks...) + +integrator = init(ode, CarpenterKennedy2N54(williamson_condition = false), + dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep = false, callback = callbacks_ext, maxiters = 100_000); + +# Get the last time index and work with that. +load_timestep!(integrator, restart_filename) + +############################################################################### +# run the simulation + +sol = solve!(integrator) +summary_callback() # print the timer summary diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index fbc94fdfd6d..ae011f7c63a 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -108,6 +108,23 @@ end end end +@trixi_testset "elixir_advection_restart_amr.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"), + l2=[4.507575525876275e-6], + linf=[6.21489667023134e-5], + # With the default `maxiters = 1` in coverage tests, + # there would be no time steps after the restart. + coverage_override=(maxiters = 100_000,)) + # 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_euler_source_terms_nonconforming_unstructured_flag.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms_nonconforming_unstructured_flag.jl"), From 383ea9ef1bdbfef386697c7416c76785632648f9 Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Wed, 29 May 2024 23:00:36 +0200 Subject: [PATCH 04/17] adapt errors in test --- test/test_p4est_2d.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index ae011f7c63a..03203f77a14 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -110,8 +110,8 @@ end @trixi_testset "elixir_advection_restart_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"), - l2=[4.507575525876275e-6], - linf=[6.21489667023134e-5], + l2=[3.2039786506780588e-6], + linf=[3.848344339896226e-5], # With the default `maxiters = 1` in coverage tests, # there would be no time steps after the restart. coverage_override=(maxiters = 100_000,)) From 594d9b8749dd4c056888fa2d6822565e2ae3dd8a Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Wed, 29 May 2024 23:00:58 +0200 Subject: [PATCH 05/17] 3D = p8! --- src/auxiliary/p4est.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auxiliary/p4est.jl b/src/auxiliary/p4est.jl index 212dd2e3c5f..5b0d0ef89ed 100644 --- a/src/auxiliary/p4est.jl +++ b/src/auxiliary/p4est.jl @@ -121,7 +121,7 @@ function load_p4est(file, ::Val{3}) conn_vec = Vector{Ptr{p8est_connectivity_t}}(undef, 1) comm = P4est.uses_mpi() ? mpi_comm() : C_NULL # Use Trixi.jl's MPI communicator if p4est supports MPI p4est = p8est_load_ext(file, comm, 0, 0, 1, 0, C_NULL, pointer(conn_vec)) - p4est_reset_data(p4est, 2 * sizeof(Int), C_NULL, C_NULL) + p8est_reset_data(p4est, 2 * sizeof(Int), C_NULL, C_NULL) end # Read `p4est` connectivity from Abaqus mesh file (.inp) From 9b44f656baac7ec1d81708ec4ac22dee8295568b Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Fri, 31 May 2024 15:16:24 +0200 Subject: [PATCH 06/17] return something --- src/auxiliary/p4est.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/auxiliary/p4est.jl b/src/auxiliary/p4est.jl index 5b0d0ef89ed..2478dd37b66 100644 --- a/src/auxiliary/p4est.jl +++ b/src/auxiliary/p4est.jl @@ -122,6 +122,7 @@ function load_p4est(file, ::Val{3}) comm = P4est.uses_mpi() ? mpi_comm() : C_NULL # Use Trixi.jl's MPI communicator if p4est supports MPI p4est = p8est_load_ext(file, comm, 0, 0, 1, 0, C_NULL, pointer(conn_vec)) p8est_reset_data(p4est, 2 * sizeof(Int), C_NULL, C_NULL) + return p4est end # Read `p4est` connectivity from Abaqus mesh file (.inp) From bbf4d8a821cf565b87b2d5c944d179cc72f6e790 Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Fri, 31 May 2024 21:19:14 +0200 Subject: [PATCH 07/17] remove coverage_override --- test/test_p4est_2d.jl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index 03203f77a14..e323d914516 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -111,10 +111,7 @@ end @trixi_testset "elixir_advection_restart_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"), l2=[3.2039786506780588e-6], - linf=[3.848344339896226e-5], - # With the default `maxiters = 1` in coverage tests, - # there would be no time steps after the restart. - coverage_override=(maxiters = 100_000,)) + linf=[3.848344339896226e-5]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From 76b5affee0104baf48855e4c08e1528f9052629a Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Fri, 31 May 2024 21:23:03 +0200 Subject: [PATCH 08/17] remove coverage_override --- test/test_mpi_tree.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_mpi_tree.jl b/test/test_mpi_tree.jl index e6e00b2e6b6..e92a3479046 100644 --- a/test/test_mpi_tree.jl +++ b/test/test_mpi_tree.jl @@ -74,8 +74,7 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows() @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"), l2=[7.870371848717432e-5], - linf=[0.0007374081713964475], - coverage_override=(maxiters = 50,)) + linf=[0.0007374081713964475]) end # Linear scalar advection with AMR From 9991cc7bb88d1959ce34114b2b15b5ea7cfcd415 Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Fri, 31 May 2024 21:29:18 +0200 Subject: [PATCH 09/17] use ode_default_options() --- examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl b/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl index dfe76fbe63a..bb818944128 100644 --- a/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl @@ -42,7 +42,7 @@ callbacks_ext = CallbackSet(amr_callback, callbacks.discrete_callbacks...) integrator = init(ode, CarpenterKennedy2N54(williamson_condition = false), dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep = false, callback = callbacks_ext, maxiters = 100_000); + callback = callbacks_ext, maxiters = 100_000; ode_default_options()...); # Get the last time index and work with that. load_timestep!(integrator, restart_filename) From 9434dea6ada7ce4b6d875b04f6fd2954907e37a0 Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Thu, 6 Jun 2024 11:37:31 +0200 Subject: [PATCH 10/17] test refining initial condition on restart --- examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl b/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl index bb818944128..ccfaaa02ebe 100644 --- a/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl @@ -36,7 +36,7 @@ amr_controller = ControllerThreeLevel(semi, IndicatorMax(semi, variable = first) max_level = 1, max_threshold = 1.2) amr_callback = AMRCallback(semi, amr_controller, interval = 5, - adapt_initial_condition = false, + adapt_initial_condition = true, adapt_initial_condition_only_refine = true) callbacks_ext = CallbackSet(amr_callback, callbacks.discrete_callbacks...) From 525870f1e6a6a3849434e189c70a15e38ca7ff29 Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Thu, 6 Jun 2024 11:52:48 +0200 Subject: [PATCH 11/17] test refining initial condition on restart --- examples/tree_2d_dgsem/elixir_advection_restart_amr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tree_2d_dgsem/elixir_advection_restart_amr.jl b/examples/tree_2d_dgsem/elixir_advection_restart_amr.jl index 2e4ca38a3fa..d0d46fcce3c 100644 --- a/examples/tree_2d_dgsem/elixir_advection_restart_amr.jl +++ b/examples/tree_2d_dgsem/elixir_advection_restart_amr.jl @@ -34,7 +34,7 @@ amr_controller = ControllerThreeLevel(semi, IndicatorMax(semi, variable = first) max_level = 5, max_threshold = 1.2) amr_callback = AMRCallback(semi, amr_controller, interval = 5, - adapt_initial_condition = false, + adapt_initial_condition = true, adapt_initial_condition_only_refine = true) callbacks_ext = CallbackSet(amr_callback, callbacks.discrete_callbacks...) From 7d312b389e1d06cfe54b97595b1851728ef84023 Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Thu, 6 Jun 2024 11:53:31 +0200 Subject: [PATCH 12/17] remove ode_default_options() --- examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl | 2 +- examples/tree_2d_dgsem/elixir_advection_extended.jl | 2 +- examples/tree_2d_dgsem/elixir_advection_restart.jl | 2 +- examples/tree_2d_dgsem/elixir_advection_restart_amr.jl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl b/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl index ccfaaa02ebe..fd3623dd88b 100644 --- a/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl @@ -42,7 +42,7 @@ callbacks_ext = CallbackSet(amr_callback, callbacks.discrete_callbacks...) integrator = init(ode, CarpenterKennedy2N54(williamson_condition = false), dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback - callback = callbacks_ext, maxiters = 100_000; ode_default_options()...); + save_everystep = false, callback = callbacks_ext, maxiters = 100_000); # Get the last time index and work with that. load_timestep!(integrator, restart_filename) diff --git a/examples/tree_2d_dgsem/elixir_advection_extended.jl b/examples/tree_2d_dgsem/elixir_advection_extended.jl index 4d3da47b04a..0928c6c10ed 100644 --- a/examples/tree_2d_dgsem/elixir_advection_extended.jl +++ b/examples/tree_2d_dgsem/elixir_advection_extended.jl @@ -78,7 +78,7 @@ callbacks = CallbackSet(summary_callback, alg = CarpenterKennedy2N54(williamson_condition = false) sol = solve(ode, alg, dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep = false, callback = callbacks; ode_default_options()...); + save_everystep = false, callback = callbacks); # Print the timer summary summary_callback() diff --git a/examples/tree_2d_dgsem/elixir_advection_restart.jl b/examples/tree_2d_dgsem/elixir_advection_restart.jl index e0d1003f524..01040b6bbc5 100644 --- a/examples/tree_2d_dgsem/elixir_advection_restart.jl +++ b/examples/tree_2d_dgsem/elixir_advection_restart.jl @@ -29,7 +29,7 @@ save_solution.condition.save_initial_solution = false integrator = init(ode, alg, dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback - callback = callbacks, maxiters = 100_000; ode_default_options()...) + save_everystep = false, callback = callbacks, maxiters = 100_000) # Load saved context for adaptive time integrator if integrator.opts.adaptive diff --git a/examples/tree_2d_dgsem/elixir_advection_restart_amr.jl b/examples/tree_2d_dgsem/elixir_advection_restart_amr.jl index d0d46fcce3c..f366640ef51 100644 --- a/examples/tree_2d_dgsem/elixir_advection_restart_amr.jl +++ b/examples/tree_2d_dgsem/elixir_advection_restart_amr.jl @@ -40,7 +40,7 @@ callbacks_ext = CallbackSet(amr_callback, callbacks.discrete_callbacks...) integrator = init(ode, alg, dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback - callback = callbacks_ext, maxiters = 100_000; ode_default_options()...) + save_everystep = false, callback = callbacks_ext, maxiters = 100_000) # Load saved context for adaptive time integrator if integrator.opts.adaptive From ae28ac324eec19072f39e6a191b10ebdfc22443b Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Thu, 6 Jun 2024 14:35:24 +0200 Subject: [PATCH 13/17] add default options again (required in MPI test) --- examples/tree_2d_dgsem/elixir_advection_extended.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/tree_2d_dgsem/elixir_advection_extended.jl b/examples/tree_2d_dgsem/elixir_advection_extended.jl index 0928c6c10ed..50a509c0724 100644 --- a/examples/tree_2d_dgsem/elixir_advection_extended.jl +++ b/examples/tree_2d_dgsem/elixir_advection_extended.jl @@ -78,7 +78,8 @@ callbacks = CallbackSet(summary_callback, alg = CarpenterKennedy2N54(williamson_condition = false) sol = solve(ode, alg, dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep = false, callback = callbacks); + callback = callbacks; + ode_default_options()...); # default options because an adaptive time stepping method is used in test_mpi_tree.jl # Print the timer summary summary_callback() From a5cd3797a75815f9a86487d66954657bf2ab3b5d Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Thu, 6 Jun 2024 14:35:57 +0200 Subject: [PATCH 14/17] adapt errors due to refining initial condition --- test/test_mpi_tree.jl | 2 +- test/test_p4est_2d.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_mpi_tree.jl b/test/test_mpi_tree.jl index e92a3479046..e780c5383dd 100644 --- a/test/test_mpi_tree.jl +++ b/test/test_mpi_tree.jl @@ -73,7 +73,7 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows() @trixi_testset "elixir_advection_restart_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"), - l2=[7.870371848717432e-5], + l2=[8.018498574373939e-5], linf=[0.0007374081713964475]) end diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index e323d914516..27ef02d3637 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -110,8 +110,8 @@ end @trixi_testset "elixir_advection_restart_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"), - l2=[3.2039786506780588e-6], - linf=[3.848344339896226e-5]) + l2=[2.869137983727866e-6], + linf=[3.8353423270964804e-5]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From 96b40c39f4fff9d351442e1fecfae53b9d365b86 Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Thu, 6 Jun 2024 16:12:53 +0200 Subject: [PATCH 15/17] add ode_default_options() here as well --- examples/tree_2d_dgsem/elixir_advection_restart.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/tree_2d_dgsem/elixir_advection_restart.jl b/examples/tree_2d_dgsem/elixir_advection_restart.jl index 01040b6bbc5..6052632ecad 100644 --- a/examples/tree_2d_dgsem/elixir_advection_restart.jl +++ b/examples/tree_2d_dgsem/elixir_advection_restart.jl @@ -29,7 +29,8 @@ save_solution.condition.save_initial_solution = false integrator = init(ode, alg, dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep = false, callback = callbacks, maxiters = 100_000) + callback = callbacks; + ode_default_options()...); # default options because an adaptive time stepping method is used in test_mpi_tree.jl # Load saved context for adaptive time integrator if integrator.opts.adaptive From 344b70730641fefa8398b662fdb4503d064516f6 Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Thu, 6 Jun 2024 16:13:15 +0200 Subject: [PATCH 16/17] missed apapted error --- test/test_mpi_tree.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_mpi_tree.jl b/test/test_mpi_tree.jl index e780c5383dd..6114e453e56 100644 --- a/test/test_mpi_tree.jl +++ b/test/test_mpi_tree.jl @@ -74,7 +74,7 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows() @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"), l2=[8.018498574373939e-5], - linf=[0.0007374081713964475]) + linf=[0.0007307237754662355]) end # Linear scalar advection with AMR From 7b11b296421b8201add02f04e76dd9b80c2b2a4e Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Thu, 6 Jun 2024 17:01:01 +0200 Subject: [PATCH 17/17] account for coverage testing --- test/test_p4est_2d.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index 27ef02d3637..28b7057090b 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -97,7 +97,7 @@ end linf=[6.21489667023134e-5], # With the default `maxiters = 1` in coverage tests, # there would be no time steps after the restart. - coverage_override=(maxiters = 100_000,)) + coverage_override=(maxiters = 25,)) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -111,7 +111,10 @@ end @trixi_testset "elixir_advection_restart_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"), l2=[2.869137983727866e-6], - linf=[3.8353423270964804e-5]) + linf=[3.8353423270964804e-5], + # With the default `maxiters = 1` in coverage tests, + # there would be no time steps after the restart. + coverage_override=(maxiters = 25,)) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let