Multi-threading number of contacts grows overtime

Post Reply
desaic
Posts: 2
Joined: Wed Oct 27, 2021 7:48 pm

Multi-threading number of contacts grows overtime

Post by desaic »

I'm running a multi-threaded simulation with the code adapted from the example. The simulation is a fixed number of compound rigid bodies tumbling inside a closed box.

As the simulation goes on, I noticed the number of contacts and manifolds keeps growing over time. As a result, the simulation becomes slower and slower. For example, after 2000 frames, the simulation is 3 times slower. This is confusing because the number of rigid bodies is fixed.

However, If I disable the multi-threading, I noticed the number of contacts and manifolds keep roungly the same during the simulation, and the simulation speed is roughly the same.

My guess is that there are some codes that prune the contacts and manifolds in the single threaded code. The codes somehow are deactivated in my multi-threaded example.

Can someone point out where might the problem be in my multi-threaded example?

Thank you,
Post Reply