Skip to content

Commit

Permalink
test threaded time integration (#1581)
Browse files Browse the repository at this point in the history
* test threaded time integration

* link to upstream issue in comment
  • Loading branch information
ranocha authored Jul 21, 2023
1 parent 67d137d commit 1aec5fa
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
3 changes: 2 additions & 1 deletion examples/dgmulti_2d/elixir_euler_curved.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ callbacks = CallbackSet(summary_callback, alive_callback, analysis_callback)
###############################################################################
# run the simulation

sol = solve(ode, RDPK3SpFSAL49(); abstol=1.0e-6, reltol=1.0e-6,
alg = RDPK3SpFSAL49()
sol = solve(ode, alg; abstol=1.0e-6, reltol=1.0e-6,
ode_default_options()..., callback=callbacks);

summary_callback() # print the timer summary
3 changes: 2 additions & 1 deletion examples/tree_2d_dgsem/elixir_advection_diffusion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
# run the simulation

# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
alg = RDPK3SpFSAL49()
time_int_tol = 1.0e-11
sol = solve(ode, RDPK3SpFSAL49(); abstol=time_int_tol, reltol=time_int_tol,
sol = solve(ode, alg; abstol=time_int_tol, reltol=time_int_tol,
ode_default_options()..., callback=callbacks)

# Print the timer summary
Expand Down
3 changes: 2 additions & 1 deletion examples/tree_2d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ 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

integrator = init(ode, CarpenterKennedy2N54(williamson_condition=false),
alg = CarpenterKennedy2N54(williamson_condition=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)

Expand Down
6 changes: 3 additions & 3 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[preferences.OrdinaryDiffEq]
PrecompileAutoSpecialize = false
PrecompileAutoSwitch = false
PrecompileDefaultSpecialize = true
PrecompileDefaultSpecialize = false
PrecompileFunctionWrapperSpecialize = false
PrecompileLowStorage = true
PrecompileLowStorage = false
PrecompileNoSpecialize = false
PrecompileNonStiff = true
PrecompileNonStiff = false
PrecompileStiff = false
28 changes: 28 additions & 0 deletions test/test_threaded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ Trixi.mpi_isroot() && isdir(outdir) && rm(outdir, recursive=true)
linf = [6.314906965243505e-5])
end

@trixi_testset "elixir_advection_restart.jl with threaded time integration" begin
@test_trixi_include(joinpath(examples_dir(), "tree_2d_dgsem", "elixir_advection_restart.jl"),
alg = CarpenterKennedy2N54(williamson_condition = false, thread = OrdinaryDiffEq.True()),
# Expected errors are exactly the same as in the serial test!
l2 = [7.81674284320524e-6],
linf = [6.314906965243505e-5])
end

@trixi_testset "elixir_advection_amr_refine_twice.jl" begin
@test_trixi_include(joinpath(examples_dir(), "tree_2d_dgsem", "elixir_advection_amr_refine_twice.jl"),
l2 = [0.00020547512522578292],
Expand All @@ -42,6 +50,15 @@ Trixi.mpi_isroot() && isdir(outdir) && rm(outdir, recursive=true)
l2 = [0.061751715597716854, 0.05018223615408711, 0.05018989446443463, 0.225871559730513],
linf = [0.29347582879608825, 0.31081249232844693, 0.3107380389947736, 1.0540358049885143])
end

@trixi_testset "elixir_advection_diffusion.jl" begin
@test_trixi_include(joinpath(examples_dir(), "tree_2d_dgsem", "elixir_advection_diffusion.jl"),
initial_refinement_level = 2, tspan = (0.0, 0.4), polydeg = 5,
alg = RDPK3SpFSAL49(thread = OrdinaryDiffEq.True()),
l2 = [4.0915532997994255e-6],
linf = [2.3040850347877395e-5]
)
end
end


Expand Down Expand Up @@ -108,6 +125,17 @@ Trixi.mpi_isroot() && isdir(outdir) && rm(outdir, recursive=true)
)
end

@trixi_testset "elixir_euler_curved.jl with threaded time integration" begin
@test_broken false
# TODO: This is currently broken and needs to be fixed upstream
# See https://github.com/JuliaSIMD/StrideArrays.jl/issues/77
# @test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_euler_curved.jl"),
# alg = RDPK3SpFSAL49(thread = OrdinaryDiffEq.True()),
# l2 = [1.720476068165337e-5, 1.592168205710526e-5, 1.592168205812963e-5, 4.894094865697305e-5],
# linf = [0.00010525416930584619, 0.00010003778091061122, 0.00010003778085621029, 0.00036426282101720275]
# )
end

@trixi_testset "elixir_euler_triangulate_pkg_mesh.jl" begin
@test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_euler_triangulate_pkg_mesh.jl"),
l2 = [2.344080455438114e-6, 1.8610038753097983e-6, 2.4095165666095305e-6, 6.373308158814308e-6],
Expand Down

0 comments on commit 1aec5fa

Please sign in to comment.