Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in run-md-ahfo2-ace-molly.jl #5

Open
emmanuellujan opened this issue Jul 8, 2022 · 1 comment
Open

Error in run-md-ahfo2-ace-molly.jl #5

emmanuellujan opened this issue Jul 8, 2022 · 1 comment

Comments

@emmanuellujan
Copy link
Member

The scripts run-md-ahfo2-ace-nbs.jl and run-md-ahfo2-ace-molly.jl, load a DFT dataset, define a basis potential (ACE), and then run an MD simulation using NBS and Molly, respectively. The NBS script finishes without errors, but the Molly script gives the error shown below. The dataset used in this example is located here

julia> include("run-md-ahfo2-ace-molly.jl")
ERROR: LoadError: MethodError: Cannot `convert` an object of type Missing to an object of type Int16
Closest candidates are:
  convert(::Type{T}, ::LLVM.GenericValue) where T<:Signed at ~/.julia/packages/LLVM/WjSQG/src/execution.jl:27
  convert(::Type{T}, ::LLVM.ConstantInt) where T<:Signed at ~/.julia/packages/LLVM/WjSQG/src/core/value/constant.jl:89
  convert(::Type{T}, ::Ptr) where T<:Integer at /opt/julia-1.7.3/share/julia/base/pointer.jl:23
  ...
Stacktrace:
  [1] JuLIP.Chemistry.AtomicNumber(z::Missing)
    @ JuLIP.Chemistry ~/.julia/packages/JuLIP/2c6VG/src/chemistry.jl:21
  [2] _broadcast_getindex_evalf
    @ ./broadcast.jl:670 [inlined]
  [3] _broadcast_getindex
    @ ./broadcast.jl:643 [inlined]
  [4] getindex
    @ ./broadcast.jl:597 [inlined]
  [5] copy
    @ ./broadcast.jl:899 [inlined]
  [6] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, Type{JuLIP.Chemistry.AtomicNumber}, Tuple{Vector{Missing}}})
    @ Base.Broadcast ./broadcast.jl:860
  [7] convert_system_to_atoms(system::System{3, false, Float64, Vector{Molly.Atom{Float64, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, Quantity{Float64, 𝐋^2 𝐌 𝐍^-1 𝐓^-2, Unitful.FreeUnits{(kJ, mol^-1), 𝐋^2 𝐌 𝐍^-1 𝐓^-2, nothing}}}}, Vector{Atomistic.AugmentedAtomData}, Tuple{}, Tuple{}, Tuple{Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}}}, SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, NoNeighborFinder, Dict{String, Any}, Unitful.FreeUnits{(a₀^-1, Eₕ), 𝐋 𝐌 𝐓^-2, nothing}, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}})
    @ InteratomicBasisPotentials ~/.julia/packages/InteratomicBasisPotentials/48zq8/src/types/ACE/ace.jl:20
  [8] evaluate_basis(A::System{3, false, Float64, Vector{Molly.Atom{Float64, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, Quantity{Float64, 𝐋^2 𝐌 𝐍^-1 𝐓^-2, Unitful.FreeUnits{(kJ, mol^-1), 𝐋^2 𝐌 𝐍^-1 𝐓^-2, nothing}}}}, Vector{Atomistic.AugmentedAtomData}, Tuple{}, Tuple{}, Tuple{Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}}}, SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, NoNeighborFinder, Dict{String, Any}, Unitful.FreeUnits{(a₀^-1, Eₕ), 𝐋 𝐌 𝐓^-2, nothing}, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}, ace_params::ACEParams)
    @ InteratomicBasisPotentials ~/.julia/packages/InteratomicBasisPotentials/48zq8/src/types/ACE/ace.jl:27
  [9] energy_and_force(s::System{3, false, Float64, Vector{Molly.Atom{Float64, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, Quantity{Float64, 𝐋^2 𝐌 𝐍^-1 𝐓^-2, Unitful.FreeUnits{(kJ, mol^-1), 𝐋^2 𝐌 𝐍^-1 𝐓^-2, nothing}}}}, Vector{Atomistic.AugmentedAtomData}, Tuple{}, Tuple{}, Tuple{Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}}}, SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, NoNeighborFinder, Dict{String, Any}, Unitful.FreeUnits{(a₀^-1, Eₕ), 𝐋 𝐌 𝐓^-2, nothing}, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}, p::ACE)
    @ Main ~/Data/repos/JuliaLab/projects/CESMIX-PASAAP/JuliaAtomisticSuiteForCESMIX/ComposableWorkflows/ACE/run-md-ahfo2-ace-molly.jl:59
 [10] potential_energy
    @ ~/.julia/packages/InteratomicPotentials/AOxZJ/src/types/abstract_potential.jl:8 [inlined]
 [11] potential_energy(inter::Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}, sys::System{3, false, Float64, Vector{Molly.Atom{Float64, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, Quantity{Float64, 𝐋^2 𝐌 𝐍^-1 𝐓^-2, Unitful.FreeUnits{(kJ, mol^-1), 𝐋^2 𝐌 𝐍^-1 𝐓^-2, nothing}}}}, Vector{Atomistic.AugmentedAtomData}, Tuple{}, Tuple{}, Tuple{Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}}}, SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, NoNeighborFinder, Dict{String, Any}, Unitful.FreeUnits{(a₀^-1, Eₕ), 𝐋 𝐌 𝐓^-2, nothing}, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}, neighbors::Nothing)
    @ Atomistic ~/.julia/packages/Atomistic/INc7Q/src/implementations/molly/molly_simulator.jl:81
 [12] potential_energy(s::System{3, false, Float64, Vector{Molly.Atom{Float64, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, Quantity{Float64, 𝐋^2 𝐌 𝐍^-1 𝐓^-2, Unitful.FreeUnits{(kJ, mol^-1), 𝐋^2 𝐌 𝐍^-1 𝐓^-2, nothing}}}}, Vector{Atomistic.AugmentedAtomData}, Tuple{}, Tuple{}, Tuple{Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}}}, SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, NoNeighborFinder, Dict{String, Any}, Unitful.FreeUnits{(a₀^-1, Eₕ), 𝐋 𝐌 𝐓^-2, nothing}, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}, neighbors::Nothing)
    @ Molly ~/.julia/packages/Molly/uTbm5/src/energy.jl:142
 [13] log_property!(logger::PotentialEnergyLogger{Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}, s::System{3, false, Float64, Vector{Molly.Atom{Float64, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, Quantity{Float64, 𝐋^2 𝐌 𝐍^-1 𝐓^-2, Unitful.FreeUnits{(kJ, mol^-1), 𝐋^2 𝐌 𝐍^-1 𝐓^-2, nothing}}}}, Vector{Atomistic.AugmentedAtomData}, Tuple{}, Tuple{}, Tuple{Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}}}, SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, NoNeighborFinder, Dict{String, Any}, Unitful.FreeUnits{(a₀^-1, Eₕ), 𝐋 𝐌 𝐓^-2, nothing}, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}, neighbors::Nothing, step_n::Int64; kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:parallel,), Tuple{Bool}}})
    @ Molly ~/.julia/packages/Molly/uTbm5/src/loggers.jl:209
 [14] run_loggers!(s::System{3, false, Float64, Vector{Molly.Atom{Float64, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, Quantity{Float64, 𝐋^2 𝐌 𝐍^-1 𝐓^-2, Unitful.FreeUnits{(kJ, mol^-1), 𝐋^2 𝐌 𝐍^-1 𝐓^-2, nothing}}}}, Vector{Atomistic.AugmentedAtomData}, Tuple{}, Tuple{}, Tuple{Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}}}, SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, NoNeighborFinder, Dict{String, Any}, Unitful.FreeUnits{(a₀^-1, Eₕ), 𝐋 𝐌 𝐓^-2, nothing}, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}, neighbors::Nothing, step_n::Int64; parallel::Bool)
    @ Molly ~/.julia/packages/Molly/uTbm5/src/loggers.jl:22
 [15] simulate!(sys::System{3, false, Float64, Vector{Molly.Atom{Float64, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, Quantity{Float64, 𝐋^2 𝐌 𝐍^-1 𝐓^-2, Unitful.FreeUnits{(kJ, mol^-1), 𝐋^2 𝐌 𝐍^-1 𝐓^-2, nothing}}}}, Vector{Atomistic.AugmentedAtomData}, Tuple{}, Tuple{}, Tuple{Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}}}, SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, NoNeighborFinder, Dict{String, Any}, Unitful.FreeUnits{(a₀^-1, Eₕ), 𝐋 𝐌 𝐓^-2, nothing}, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}, sim::VelocityVerlet{Quantity{Float64, 𝐓, Unitful.FreeUnits{(fs,), 𝐓, nothing}}, AndersenThermostat{Float64, Float64}}, n_steps::Int64; parallel::Bool)
    @ Molly ~/.julia/packages/Molly/uTbm5/src/simulators.jl:131
 [16] simulate!(sys::System{3, false, Float64, Vector{Molly.Atom{Float64, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, Quantity{Float64, 𝐋^2 𝐌 𝐍^-1 𝐓^-2, Unitful.FreeUnits{(kJ, mol^-1), 𝐋^2 𝐌 𝐍^-1 𝐓^-2, nothing}}}}, Vector{Atomistic.AugmentedAtomData}, Tuple{}, Tuple{}, Tuple{Atomistic.InteratomicPotentialInter{ACE, Quantity{Float64, 𝐋^2 𝐌 𝐓^-2, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, Vector{SVector{3, Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}}}, SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, NoNeighborFinder, Dict{String, Any}, Unitful.FreeUnits{(a₀^-1, Eₕ), 𝐋 𝐌 𝐓^-2, nothing}, Unitful.FreeUnits{(Eₕ,), 𝐋^2 𝐌 𝐓^-2, nothing}}, sim::VelocityVerlet{Quantity{Float64, 𝐓, Unitful.FreeUnits{(fs,), 𝐓, nothing}}, AndersenThermostat{Float64, Float64}}, n_steps::Int64)
    @ Molly ~/.julia/packages/Molly/uTbm5/src/simulators.jl:130
 [17] simulate(system::FlexibleSystem{3, AtomsBase.Atom, Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, simulator::MollySimulator{VelocityVerlet, Quantity{Float64, 𝐓, Unitful.FreeUnits{(fs,), 𝐓, nothing}}, AndersenThermostat{Float64, Float64}}, potential::ACE)
    @ Atomistic ~/.julia/packages/Atomistic/INc7Q/src/implementations/molly/molly_simulator.jl:58
 [18] top-level scope
    @ ./timing.jl:220
 [19] include(fname::String)
    @ Base.MainInclude ./client.jl:451
 [20] top-level scope
    @ REPL[1]:1
in expression starting at /home/elujan/Data/repos/JuliaLab/projects/CESMIX-PASAAP/JuliaAtomisticSuiteForCESMIX/ComposableWorkflows/ACE/run-md-ahfo2-ace-molly.jl:70
@emmanuellujan
Copy link
Member Author

@jrdegreeff, when you can, could you take a look at this? Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant