Skip to content

Commit

Permalink
fix initialization of batches for CellListPair
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Dec 14, 2024
1 parent 924fe92 commit d6b479d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/CellLists.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function update_number_of_batches!(cl::CellList{N,T}, _nbatches=cl.nbatches; par
"""
end _file=nothing _line=nothing
end
nbatches = NumberOfBatches(auto, (1, 1))
nbatches = NumberOfBatches((false, false), (1, 1))
else # Heuristic choices
if first(auto)
n1 = _nbatches_build_cell_lists(cl.n_real_particles)
Expand All @@ -211,7 +211,7 @@ function update_number_of_batches!(cl::CellList{N,T}, _nbatches=cl.nbatches; par
end
nbatches = NumberOfBatches(auto, (n1, n2))
end
for _ in 1:n2
for _ in 1:last(nbatches.map_computation)
push!(cl.projected_particles, Vector{ProjectedParticle{N,T}}(undef, 0))
end
cl.nbatches = nbatches
Expand All @@ -229,7 +229,11 @@ function update_number_of_batches!(
) where {N,T}
large_set = update_number_of_batches!(cl.large_set, _nbatches; parallel)
return CellListPair{N,T}(
update_number_of_batches!(cl.small_set, large_set.nbatches; parallel),
update_number_of_batches!(
cl.small_set,
NumberOfBatches((false, false), nbatches(large_set));
parallel
),
large_set,
cl.swap,
)
Expand Down

0 comments on commit d6b479d

Please sign in to comment.