diff --git a/src/external.jl b/src/external.jl index 45311a7..b124706 100644 --- a/src/external.jl +++ b/src/external.jl @@ -18,7 +18,9 @@ mutable struct FixExternal API.lammps_set_fix_external_callback(lmp, name, callback, ctx) # Ensure function is compiled before timestep 0 - @assert precompile(this.callback, (FixExternal, Int, Int, Int, Vector{Int32}, Matrix{Float64}, Matrix{Float64})) + if !precompile(this.callback, (FixExternal, Int, Int, Int, Vector{Int32}, Matrix{Float64}, Matrix{Float64})) + @warn "Failed to precompile the callback" this.callback + end return this end end diff --git a/test/runtests.jl b/test/runtests.jl index 471e090..650015e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -59,7 +59,7 @@ LMP(["-screen", "none"]) do lmp command(lmp, "region cell block 0 1 0 1 0 1 units box") command(lmp, "create_box 1 cell") command(lmp, "fix julia all external pf/callback 1 1") - LAMMPS.FixExternal(lmp, "julia") do fix, timestep, nlocal, ids, x, fexternal + LAMMPS.FixExternal(lmp, "julia") do fix, timestep, nlocal, nghost, ids, x, fexternal LAMMPS.energy_global!(fix, 0.0) called[] = true end