Skip to content

Commit 23c054b

Browse files
author
Michele Mesiti
committed
Add regression tests for multithreaded ABM algs
1 parent 5ed41ce commit 23c054b

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using OrdinaryDiffEqAdamsBashforthMoulton, ODEProblemLibrary
2+
using Test
3+
using Static
4+
5+
free_timestep_algorithms = [ VCAB3, VCAB4, VCAB5, VCABM3, VCABM4, VCABM5, VCABM]
6+
7+
fixed_timestep_algorithms = [AB3,AB4, AB5, ABM32, ABM43, ABM54]
8+
9+
problem = ODEProblemLibrary.prob_ode_linear
10+
11+
function test_alg(ALG; kwargs...)
12+
sol_thread = solve(problem, ALG(Static.True()); kwargs...)
13+
sol_nothread = solve(problem, ALG(Static.False()); kwargs...)
14+
15+
@test all(sol_nothread .== sol_thread)
16+
end
17+
18+
19+
@testset "Regression test for threading versions vs non threading versions" begin
20+
@testset "$ALG" for ALG in fixed_timestep_algorithms
21+
test_alg(ALG, dt=1//2^9)
22+
end
23+
@testset "$ALG" for ALG in free_timestep_algorithms
24+
test_alg(ALG)
25+
end
26+
27+
end

lib/OrdinaryDiffEqAdamsBashforthMoulton/test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ using SafeTestsets
22

33
@time @safetestset "ABM Convergence Tests" include("abm_convergence_tests.jl")
44
@time @safetestset "Adams Variable Coefficients Tests" include("adams_tests.jl")
5+
@time @safetestset "Regression test for threading versions vs non threading versions" include("regression_test_threading.jl")

0 commit comments

Comments
 (0)