m3g / CellListMap.jl

Flexible implementation of cell lists to map the calculations of particle-pair dependent functions, such as forces, energies, neighbor lists, etc.
https://m3g.github.io/CellListMap.jl/
MIT License
87 stars 4 forks source link

Merge cell lists in parallel. #98

Closed lmiq closed 4 months ago

lmiq commented 4 months ago

With this PR the cell lists are merged in parallel when constructed in parallel. The performance improvements, if any, are small. But the scaling may be improved when using larger numbers of batches for cell list construction, in systems with many CPUs.

The code was somewhat simplified by making CellList a mutable struct, which was required to avoid the allocations caused by the closure capture.

We also split completely the inner loops of orthorrombic and tricilinic cells, which will probably make the code maintenance easier. This was also required because with the lists being merged in any order, the triclinic merging was broken because of the pair skipping rules.