Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Jun 23, 2024
1 parent de157f8 commit 13e2294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/external.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,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
Expand Down

0 comments on commit 13e2294

Please sign in to comment.