← Back to team overview

yade-dev team mailing list archive

PersistentSAPCollider leaks??

 

Hi,

I was sort-of profiling PersistentSAPCollider, which is notorious for
taking forever during the first iteration. The reason is in the function
updateIds, which calls findOverlappingBB for x,y,z, which makes up over
90% of the lag at the start.

I wanted to measure exactly how much time is used for how many elements.
The largest set I dared (the complexity is something like O(n^2), since
findOverlappingBB has two nested while loops over bodies) was 64k
spheres, running just the very first iteration with only the collider as
engine.

After about 7 minutes of running, the process starts taking more and
more memory (now it has 15GB) and doesn't seem to stop. You can try
yourself with the script below.

Vaclav.

---

# generate random packing, save it to file
nSpheres=64000
p=Preprocessor('TriaxialTest',{'numberOfGrains':nSpheres,'radiusMean':1e-3,'lowerCorner':[0,0,0],'upperCorner':[1,1,1]})
p.load()
import os
tmp='/tmp/spheres%d'%(os.getpid())
utils.spheresToFile(tmp)
# load the packing into clean simulation again
O.reset()
utils.spheresFromFile(tmp)

from yade import timing
O.timingEnabled=True

print "Spheres loaded"
O.engines=[StandAloneEngine('PersistentSAPCollider'),]
O.step()
timing.stats()
quit()



Follow ups