Skip to content

Commit

Permalink
Make validation tests pass on macOS ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
efaulhaber committed Jan 17, 2025
1 parent 9126cda commit c696f8b
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions test/validation/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,26 @@
@test sol.retcode == ReturnCode.Success
@test count_rhs_allocations(sol, semi) == 0

@test isapprox(error_edac_P1, 0, atol=eps())
@test isapprox(error_edac_P2, 0, atol=eps())

if VERSION == v"1.10"
if Sys.ARCH === :aarch64
# MacOS ARM produces slightly different pressure values than x86.
# Note that pressure values are in the order of 1e5.
@test isapprox(error_edac_P1, 0, atol=4e-10)
@test isapprox(error_edac_P2, 0, atol=3e-12)
@test isapprox(error_wcsph_P1, 0, atol=6.0)
@test isapprox(error_wcsph_P2, 0, atol=7e-4)
elseif VERSION == v"1.10"
# Reference values are computed with 1.10
@test isapprox(error_edac_P1, 0, atol=eps())
@test isapprox(error_edac_P2, 0, atol=eps())
@test isapprox(error_wcsph_P1, 0, atol=eps())
@test isapprox(error_wcsph_P2, 0, atol=eps())
else
# 1.11 produces slightly different pressure values than 1.10
# 1.11 produces slightly different pressure values than 1.10.
# Note that pressure values are in the order of 1e5.
@test isapprox(error_edac_P1, 0, atol=eps())
@test isapprox(error_edac_P2, 0, atol=eps())
@test isapprox(error_wcsph_P1, 0, atol=0.07)
@test isapprox(error_wcsph_P2, 0, atol=8.0e-6)
@test isapprox(error_wcsph_P2, 0, atol=8e-6)
end

# Ignore method redefinitions from duplicate `include("../validation_util.jl")`
Expand Down

0 comments on commit c696f8b

Please sign in to comment.