Skip to content

Commit

Permalink
New version: 0.13.4 (#309)
Browse files Browse the repository at this point in the history
* Update compatibilities
* Calculator test: Check both backends for eigen allocations
* Fix broken mdef_baoab test
  • Loading branch information
jamesgardner1421 authored Nov 6, 2023
1 parent b45b472 commit bd02d86
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
15 changes: 8 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NQCDynamics"
uuid = "36248dfb-79eb-4f4d-ab9c-e29ea5f33e14"
authors = ["James <james.gardner1421@gmail.com>"]
version = "0.13.3"
version = "0.13.4"

[deps]
AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
Expand Down Expand Up @@ -45,16 +45,16 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"

[compat]
AdvancedHMC = "0.5"
AdvancedMH = "0.6, 0.7"
ComponentArrays = "0.11, 0.12, 0.13, 0.14"
AdvancedHMC = "0.5, 0.6"
AdvancedMH = "0.6, 0.7, 0.8"
ComponentArrays = "0.11, 0.12, 0.13, 0.14, 0.15"
DEDataArrays = "0.2"
Dictionaries = "0.3"
DiffEqBase = "6"
Distributions = "0.25"
FastBroadcast = "0.1, 0.2"
FastLapackInterface = "1, 2"
HDF5 = "0.15, 0.16"
HDF5 = "0.15, 0.16, 0.17"
Interpolations = "0.13, 0.14"
MuladdMacro = "0.2"
NQCBase = "0.2"
Expand All @@ -72,7 +72,7 @@ Reexport = "1"
RingPolymerArrays = "0.1"
Roots = "1, 2"
Rotations = "1"
SciMLBase = "1"
SciMLBase = "1, 2"
StaticArrays = "1"
StatsBase = "0.33, 0.34"
StochasticDiffEq = "6"
Expand All @@ -92,6 +92,7 @@ DiffEqNoiseProcess = "77a26b50-5914-5dd7-bc55-306e6241c503"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
JuLIP = "945c410c-986d-556a-acb1-167a618e0462"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MKL = "33e6dc65-8f57-5167-99aa-e5a354878fb2"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Expand All @@ -100,4 +101,4 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "SafeTestsets", "CSV", "DataFrames", "DiffEqNoiseProcess", "FiniteDiff", "DiffEqDevTools", "Logging", "PyCall", "JuLIP", "Symbolics", "Statistics", "Plots"]
test = ["Test", "SafeTestsets", "CSV", "DataFrames", "DiffEqNoiseProcess", "FiniteDiff", "DiffEqDevTools", "Logging", "MKL", "PyCall", "JuLIP", "Symbolics", "Statistics", "Plots"]
10 changes: 8 additions & 2 deletions test/Core/calculators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ using NQCDynamics.Calculators
using LinearAlgebra: tr, Diagonal, eigvecs, eigvals
using RingPolymerArrays: RingPolymerArrays

# For the allocation tests check against both backends as we can't be sure which is in use
const MKL_EIGEN_ALLOCATIONS = 54912
const OPENBLAS_EIGEN_ALLOCATIONS = 56896

@testset "General constructors" begin
model = NQCModels.DoubleWell()
@test Calculators.Calculator(model, 1, Float64) isa Calculators.DiabaticCalculator
Expand Down Expand Up @@ -265,7 +269,8 @@ end

@test @allocated(Calculators.evaluate_potential!(calc, r)) == 0
@test @allocated(Calculators.evaluate_derivative!(calc, r)) == 0
@test @allocated(Calculators.evaluate_eigen!(calc, r)) == 56896 # nonzero due to eigenroutines
eigen_allocations = @allocated(Calculators.evaluate_eigen!(calc, r))
@test (eigen_allocations == MKL_EIGEN_ALLOCATIONS) || (eigen_allocations == OPENBLAS_EIGEN_ALLOCATIONS)
@test @allocated(Calculators.evaluate_adiabatic_derivative!(calc, r)) == 0
@test @allocated(Calculators.evaluate_nonadiabatic_coupling!(calc, r)) == 0
end
Expand All @@ -287,7 +292,8 @@ end

@test @allocated(Calculators.evaluate_potential!(calc, r)) == 0
@test @allocated(Calculators.evaluate_derivative!(calc, r)) == 0
@test @allocated(Calculators.evaluate_eigen!(calc, r)) == 568960 # nonzero due to eigenroutines
eigen_allocations = @allocated(Calculators.evaluate_eigen!(calc, r)) / 10
@test (eigen_allocations == MKL_EIGEN_ALLOCATIONS) || (eigen_allocations == OPENBLAS_EIGEN_ALLOCATIONS)
@test @allocated(Calculators.evaluate_adiabatic_derivative!(calc, r)) == 0
@test @allocated(Calculators.evaluate_nonadiabatic_coupling!(calc, r)) == 0
end
Expand Down
3 changes: 1 addition & 2 deletions test/Dynamics/mdef_baoab.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ g(u,p,t) = diagm(ones(length(u)))

p = Simulation(Atoms([:H,:H]), NQCModels.Free(2); temperature=100)

ff_harmonic = DynamicalSDEFunction(f1_harmonic,f2_harmonic,g)
prob1 = DynamicalSDEProblem(ff_harmonic,g,v0,u0,(0.0,0.5),p)
prob1 = DynamicalSDEProblem(f1_harmonic, f2_harmonic ,g,v0,u0,(0.0,0.5),p)

sol1 = solve(prob1,DynamicsMethods.IntegrationAlgorithms.MDEF_BAOAB();dt=1/10,save_noise=true)

Expand Down

0 comments on commit bd02d86

Please sign in to comment.