Large No. of Objects Crash Help

MSteve
Posts: 2
Joined: Wed May 07, 2008 4:35 pm

Large No. of Objects Crash Help

Post by MSteve »

Hi all, this is my first post so I'd like to start by saying a big thank you to Erwin, Bullet is a very impressive library that is currently saving me a lot of effort and time!

However, I want to use Bullet in perhaps a slightly unusual way, I am currently developing a Newtonian physics based Discrete Element simulation, which simply put is a load of spheres in deformable box!

Using Bullet I have successfully managed to get the basics in place for a low number of spheres, but as this is not a real time physics problem, rather a model, I now need to scale it up onto many many processors with lots of RAM in order to generate models with 1,000,000+ spheres.

I will be using both OpenMP and MPI in order to do this, but I currently have an issue with scaling upto as many objects as I need in that after ~ 38810 calls to btDiscreteDynamicsWorld->addRigidBody() I get a crash. Now im almost positive its a memory issue, but im not totally sure at which point it is occuring and I don't have enough knowledge of Bullet to track it down.

Initially i thought it was something to do with the btDefaultCollisionConfiguration number of overlapping pairs being set at ~65k but I then found that Bullet deals with overflow anyway by automatically switching to the heap. I then turned my attention to the overlapping pair cache and found that there was a replacement for btAxisSweep3 in the form of bt32BitAxisSweep3 which says I should be able to introduce 150000 bodies, but as previosely stated, I am now getting the crash using this at ~38810 (it was ~16.5k using the other btAxisSweep3).

I apologise if the answer to this is plainly obvious, but I am not all *that* savvy with C++ (getting better but still a long way to go!) and I am certainly not totally boned up on Bullet itself!

I also apologise if my description of my problem is bad, if anyone needs clarification on anything, please ask.

Thanks for any help you can provide.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Large No. of Objects Crash Help

Post by Erwin Coumans »

Bullet should be able to deal with 1.000.000 objects, albeit slow.

You need to use bt32BitAxisSweep3, and increase some default allocations.

Can you reproduce the crash in the BasicDemo?
Thanks,
Erwin
MSteve
Posts: 2
Joined: Wed May 07, 2008 4:35 pm

Re: Large No. of Objects Crash Help

Post by MSteve »

Hi Erwin,

Thanks for the reply.

It would appear I was setting my worldAabbmin too low (Duh!) Its now working for 1,000,000 using bt32BitAxisSweep3 and the default btDefaultCollisionConfiguration values.

While I have your attention :) Can you recommend more suitable initial btDefaultCollisionConfiguration values given the size of simulations i'm running?

Also, do you know roughly how large I will actually be able to go? is 1.5 million likely to be my limit or will I be able to push things higher?

I have access to around 5000 CPUs and ~ 128GB of RAM with upto 1 week runtime for each run. I am hoping for reasonably good performance if I can get the sort of parallelism I am looking for using MPI, so simulations in excess of 1.5 million elements are certainly not an impossibility.