@@ -4,9 +4,14 @@ using NQCDynamics.Calculators
4
4
using LinearAlgebra: tr, Diagonal, eigvecs, eigvals
5
5
using RingPolymerArrays: RingPolymerArrays
6
6
7
- # For the allocation tests check against both backends as we can't be sure which is in use
7
+ # For the allocation tests check against both backends as we can't be sure which is in use.
8
8
const MKL_EIGEN_ALLOCATIONS = 54912
9
- const OPENBLAS_EIGEN_ALLOCATIONS = 56896
9
+ # Julia 1.10 has slightly different eigen allocations
10
+ if VERSION > v " 1.9"
11
+ const OPENBLAS_EIGEN_ALLOCATIONS = 57216
12
+ else
13
+ const OPENBLAS_EIGEN_ALLOCATIONS = 56896
14
+ end
10
15
11
16
@testset " General constructors" begin
12
17
model = NQCModels. DoubleWell ()
270
275
@test @allocated (Calculators. evaluate_potential! (calc, r)) == 0
271
276
@test @allocated (Calculators. evaluate_derivative! (calc, r)) == 0
272
277
eigen_allocations = @allocated (Calculators. evaluate_eigen! (calc, r))
273
- @test (eigen_allocations == MKL_EIGEN_ALLOCATIONS) || (eigen_allocations == OPENBLAS_EIGEN_ALLOCATIONS)
278
+ @info " Non-zero allocations test LargeDiabaticCalculator: eigen_allocations returned $(eigen_allocations) "
279
+ @test (eigen_allocations ≤ MKL_EIGEN_ALLOCATIONS) || (eigen_allocations ≤ OPENBLAS_EIGEN_ALLOCATIONS)
274
280
@test @allocated (Calculators. evaluate_adiabatic_derivative! (calc, r)) == 0
275
281
@test @allocated (Calculators. evaluate_nonadiabatic_coupling! (calc, r)) == 0
276
282
end
293
299
@test @allocated (Calculators. evaluate_potential! (calc, r)) == 0
294
300
@test @allocated (Calculators. evaluate_derivative! (calc, r)) == 0
295
301
eigen_allocations = @allocated (Calculators. evaluate_eigen! (calc, r)) / 10
296
- @test (eigen_allocations == MKL_EIGEN_ALLOCATIONS) || (eigen_allocations == OPENBLAS_EIGEN_ALLOCATIONS)
302
+ @info " Non-zero allocations test RingPolymerLargeDiabaticCalculator: eigen_allocations returned $(eigen_allocations) "
303
+ @test (eigen_allocations ≤ MKL_EIGEN_ALLOCATIONS) || (eigen_allocations ≤ OPENBLAS_EIGEN_ALLOCATIONS)
297
304
@test @allocated (Calculators. evaluate_adiabatic_derivative! (calc, r)) == 0
298
305
@test @allocated (Calculators. evaluate_nonadiabatic_coupling! (calc, r)) == 0
299
306
end
0 commit comments