ACEsuit / ACE.jl

Parameterisation of Equivariant Properties of Particle Systems
65 stars 15 forks source link

Bug in ObjectPools #61

Closed cortner closed 2 years ago

cortner commented 2 years ago

When the object pools in ACEbase.jl are implemented using a Vector, then the strangest thing happens. After pop! ing the last element, the pool gets reduced by length one but then when I acquire again the same element is returned. This doesn't always happen and I can't really consistently reproduce it. Most likely some very strange memory management bug. For now I've switched from Vectors to Sets as the pools. This fixes the bug for now, but the push! (release) operation is now 10 times slower, ca 1 us instead of < 100 ns.

cortner commented 2 years ago

switched to Stack which seems to have resolved this.