Commit f89f9816 authored by Pavel Kus's avatar Pavel Kus

test_analytic sanity check issues warning instead of assert

parent 8c8c79bd
...@@ -481,6 +481,14 @@ ...@@ -481,6 +481,14 @@
MATH_DATATYPE(kind=rck) :: A(na, na), S(na, na), L(na, na), res(na, na) MATH_DATATYPE(kind=rck) :: A(na, na), S(na, na), L(na, na), res(na, na)
integer(kind=ik) :: i, j, decomposition(num_primes) integer(kind=ik) :: i, j, decomposition(num_primes)
real(kind=rk) :: err
#ifdef DOUBLE_PRECISION
real(kind=rk), parameter :: TOL = 1e-8
#endif
#ifdef SINGLE_PRECISION
real(kind=rk), parameter :: TOL = 1e-4
#endif
assert(decompose(na, decomposition)) assert(decompose(na, decomposition))
do i = 1, na do i = 1, na
...@@ -504,13 +512,12 @@ ...@@ -504,13 +512,12 @@
end do end do
res = matmul(A,S) - matmul(S,L) res = matmul(A,S) - matmul(S,L)
#ifdef DOUBLE_PRECISION err = maxval(abs(res))
assert(maxval(abs(res)) < 1e-8)
#elif SINGLE_PRECISION if(err > TOL) then
assert(maxval(abs(res)) < 1e-4) print *, "WARNING: sanity test in module analytic failed, error is ", err
#else end if
assert(.false.)
#endif
if(.false.) then if(.false.) then
!if(na == 2 .or. na == 5) then !if(na == 2 .or. na == 5) then
call print_matrix(myid, na, A, "A") call print_matrix(myid, na, A, "A")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment