Skip to content

Commit

Permalink
Add maxiters to restart elixirs and exclude for coverage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
efaulhaber committed Nov 15, 2023
1 parent 84fad42 commit 38d23aa
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 22 deletions.
2 changes: 1 addition & 1 deletion examples/p4est_2d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ save_solution.condition.save_initial_solution = false

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);
save_everystep = false, callback = callbacks, maxiters = 100_000);

# Get the last time index and work with that.
load_timestep!(integrator, restart_filename)
Expand Down
2 changes: 1 addition & 1 deletion examples/p4est_3d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ save_solution.condition.save_initial_solution = false

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);
save_everystep = false, callback = callbacks, maxiters = 100_000);

# Get the last time index and work with that.
load_timestep!(integrator, restart_filename)
Expand Down
2 changes: 1 addition & 1 deletion examples/structured_2d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ save_solution.condition.save_initial_solution = false

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);
save_everystep = false, callback = callbacks, maxiters = 100_000);

# Get the last time index and work with that.
load_timestep!(integrator, restart_filename)
Expand Down
2 changes: 1 addition & 1 deletion examples/structured_3d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ save_solution.condition.save_initial_solution = false

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);
save_everystep = false, callback = callbacks, maxiters = 100_000);

# Get the last time index and work with that.
load_timestep!(integrator, restart_filename)
Expand Down
2 changes: 1 addition & 1 deletion examples/tree_2d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
save_everystep = false, callback = callbacks; ode_default_options()...)
callback = callbacks, maxiters = 100_000; ode_default_options()...)

# Load saved context for adaptive time integrator
if integrator.opts.adaptive
Expand Down
2 changes: 1 addition & 1 deletion examples/tree_3d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ save_solution.condition.save_initial_solution = false

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);
save_everystep = false, callback = callbacks, maxiters=100_000);

# Get the last time index and work with that.
load_timestep!(integrator, restart_filename)
Expand Down
2 changes: 1 addition & 1 deletion examples/unstructured_2d_dgsem/elixir_euler_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ save_solution.condition.save_initial_solution = false

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);
save_everystep = false, callback = callbacks, maxiters = 100_000);

# Get the last time index and work with that.
load_timestep!(integrator, restart_filename)
Expand Down
5 changes: 4 additions & 1 deletion test/test_mpi_p4est_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_2d_dgsem")
@trixi_testset "elixir_advection_restart.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
l2=[4.507575525876275e-6],
linf=[6.21489667023134e-5])
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,))
end

@trixi_testset "elixir_euler_source_terms_nonconforming_unstructured_flag.jl" begin
Expand Down
5 changes: 4 additions & 1 deletion test/test_mpi_p4est_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_3d_dgsem")
@trixi_testset "elixir_advection_restart.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
l2=[0.002590388934758452],
linf=[0.01840757696885409])
linf=[0.01840757696885409],
# With the default `maxiters = 1` in coverage tests,
# there would be no time steps after the restart.
coverage_override = (maxiters = 100_000,))
end

@trixi_testset "elixir_advection_cubed_sphere.jl" begin
Expand Down
9 changes: 6 additions & 3 deletions test/test_p4est_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ end
@trixi_testset "elixir_advection_restart.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
l2=[4.507575525876275e-6],
linf=[6.21489667023134e-5])
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
Expand Down Expand Up @@ -216,8 +219,8 @@ end
],
surface_flux=flux_hlle,
tspan=(0.0, 0.3))
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
u_ode = sol.u[end]
Expand Down
9 changes: 6 additions & 3 deletions test/test_p4est_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ end
@trixi_testset "elixir_advection_restart.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
l2=[0.002590388934758452],
linf=[0.01840757696885409])
linf=[0.01840757696885409],
# 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
Expand Down Expand Up @@ -305,8 +308,8 @@ end
],
tspan=(0.0, 0.3),
surface_flux=flux_hlle)
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
u_ode = sol.u[end]
Expand Down
15 changes: 12 additions & 3 deletions test/test_structured_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ end
@trixi_testset "elixir_advection_restart.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
l2=[4.219208035582454e-6],
linf=[3.438434404412494e-5])
linf=[3.438434404412494e-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
Expand All @@ -211,7 +214,10 @@ end
linf=[0.0015194252169410394],
rtol=5.0e-5, # Higher tolerance to make tests pass in CI (in particular with macOS)
elixir_file="elixir_advection_waving_flag.jl",
restart_file="restart_000021.h5")
restart_file="restart_000021.h5",
# 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
Expand All @@ -227,7 +233,10 @@ end
l2=[7.841217436552029e-15],
linf=[1.0857981180834031e-13],
elixir_file="elixir_advection_free_stream.jl",
restart_file="restart_000036.h5")
restart_file="restart_000036.h5",
# 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
Expand Down
5 changes: 4 additions & 1 deletion test/test_structured_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ end
@trixi_testset "elixir_advection_restart.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
l2=[0.0025903889347585777],
linf=[0.018407576968841655])
linf=[0.018407576968841655],
# 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
Expand Down
5 changes: 4 additions & 1 deletion test/test_threaded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ end
linf=[0.0015194252169410394],
rtol=5.0e-5, # Higher tolerance to make tests pass in CI (in particular with macOS)
elixir_file="elixir_advection_waving_flag.jl",
restart_file="restart_000021.h5")
restart_file="restart_000021.h5",
# 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)
Expand Down
5 changes: 4 additions & 1 deletion test/test_tree_3d_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ end
@trixi_testset "elixir_advection_restart.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
l2=[0.00016017848135651983],
linf=[0.0014175368788298393])
linf=[0.0014175368788298393],
# 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
Expand Down
5 changes: 4 additions & 1 deletion test/test_unstructured_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ end
0.005243995459478956,
0.004685630332338153,
0.01750217718347713,
])
],
# 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
Expand Down

0 comments on commit 38d23aa

Please sign in to comment.