[newton 300] Multi Thread Island solver bug

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: [newton 300] Multi Thread Island solver bug

Postby Julio Jerez » Sun Feb 26, 2012 11:26 am

Ok I checked in the third option, now if you call

// run staggered with main thread
void NewtonUpdate (newtonWorld, timestep, 0);

// runs in separate thread an put calling thread to sleep taking zero time from the system.
void NewtonUpdate (newtonWorld, timestep, 1);

// run cocurrent with the calling thread until wait to finish is called or anopther update is called
// when the update thread complete the call teh thread gos to sleep taking zero time from the system,
void NewtonUpdate (newtonWorld, timestep, 2);


try mode 0, that is teh oen you are familiar with,
but do no disregard mode 1 and tow, thar are very poerful speially when using the Post and Pre Listeners for maximin the cores in the system.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [newton 300] Multi Thread Island solver bug

Postby Julio Jerez » Mon Feb 27, 2012 8:50 am

wow you are right, there is something wrong with the parallel sover.

I am making the convex hull modifier a standard feature of all collision system, including Collison trees and hieghtfield, and all static collsions
I am about 75% completed, and I was testing a simple scene with few capsules

I was using the parallel solver as teh default and I noticed a huge slow down.

this is a simple scene with 64 capsules falling on a flat plane, and it is 3 time slower,
I need to figure ou what that is after I complete the generalize collision scale.

In the mean time I check in a version with parallel solver on single island resuving to the single ilnad solver.

you do no have to do anything, just synk to SVN, and you get physics running stagrred with main tread as defaul and the singel island solver.

This is the third time the parallel solver give me a set back.
the parallel sove is very cool and sofoctricated because it yild the same quality solution as the single island solver,
but it is diffcult to resolve threads contigencies, I tought I had that covered but obviuslly it is not resolved yet.

what proffiler are you using, that seems very usefull?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [newton 300] Multi Thread Island solver bug

Postby Julio Jerez » Mon Feb 27, 2012 1:02 pm

Oh I think I t was a false alarm.
But I will check it out anyway.

On the scale collsiion these is what is comming.
-each shape will now be an instance, all caching will be handel by teh engien as oppose that before that only convex chapes where cached.
-all shapes can be shared.
-All shape will support non uniform scale.
-Shear and strecth will be supported still but by using the Convex modifier, this is because shear and scale require a general Matrix inversion while non uniform scale can be inveted by inveting the matrix componets.
-all collision instances will support a use data pointer, this allow for full usage of the collision system with oy haoin to use the dynmics system.
-all collision wil support Set and Get Matrix.
-more special case collsion pair handling, capsule-Plane, and cylinder plane
two new collison shapes, Tapered Capsule and Tapered cylinder.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [newton 300] Multi Thread Island solver bug

Postby PJani » Tue Feb 28, 2012 5:08 pm

Sorry for late reply, week started VERY busy...anyway...
What profiler i use? Currently none :)... i am in a stage of general rewriting. But before this i was largely using listeners, each listener had pre-tick, post-tick virtual method. for each listener and pre tick and after i kept average/worst/best times after each listener was destroyed i dumped name and statistics into file, nothing fancy.

I am thinking of writing some custom macros to do profiling. :)



Collision scaling will help :). But the the most waited part is still multi sampled friction(for vehicles) :)

Offtopic: what is the maximal number of collisions per compound? What is the big-O for n of collisions in compound?

I am porting from my ugly(2008) code to MVC model so everything is event driven. Now I can design new entities faster than before and i am currently working on physical part. so entities/bodies can be destroyed, changed(so compound collision can be changed based on damage), rebuild, spawned, respawned.

So if i use listeners in new version then i can use cocurrent mode. hmm that could work if i make some kind of buffering layer in between so i don't get raceconditions.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: [newton 300] Multi Thread Island solver bug

Postby Julio Jerez » Tue Feb 28, 2012 6:10 pm

PJani wrote:Collision scaling will help :). But ...

Agree, I actually have a 1/3 quater wroking and it is a huge mess, very risky and hard to follow, I tryed to bite too much in one go.
I save and I am adding slowelly one funtionality at a time, and keepin geyh egine workig at all time.
The scale si very cool, bu teh are more ungent stuff.

PJani wrote: the most waited part is still multi sampled friction(for vehicles) :)

also agree, thse weekeng I will complte the vehice, I am resucutating aprt f teh vehicle model of newtopn 1.3
and even making more improvement. I t wil no be simpel cars, it will be any kind of contation of articulated bodies.
but It will be demostated with a car, and anothe demo that I do n oknwo what it will be yet.
Basically I will expose the solver so that the end application can make call to it to solve localized systems of joint and bodies.
My goal of to complete the super car demo.

PJani wrote:Offtopic: what is the maximal number of collisions per compound? What is the big-O for n of collisions in compound?

evert collision system pairs has a limit of 16 contact, in can calulate up 128 but the it filetr then to 16.
That bewten a pairs of bodies.
there is not limit are to how many bodies a compound can collide with.

PJani wrote:So if i use listeners in new version then i can use cocurrent mode. hmm that could work if i make some kind of buffering layer in between so i don't get raceconditions.

The beauty of moving subsystem to a listerner is that you will not nee to worrie about race conditions, and yet they still use parallel cores.
if you chek teh SDK, teh main loop run all tow listedr already, and I will add more
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [newton 300] Multi Thread Island solver bug

Postby PJani » Tue Feb 28, 2012 7:54 pm

i didn't ask the right way(or i didnt understand the answer) :) i wanted to ask what is maximum of number of sub shapes in compund shape. and what is complexity(big O) of compound shape vs num of sub shapes.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: [newton 300] Multi Thread Island solver bug

Postby Julio Jerez » Wed Feb 29, 2012 10:04 am

ha, I see.
The is no upper limi tas to how sub shape you cna dd to a compound. the si a compoudn demo with 400 pieces each.

the O(n) cost is Log(n) + M (whie m i sthe numbe of shpane that artually inteset the OOBB o feh other shape.
when two compound collsing the cost is Log(n1) + log(n2) + M * N where M and N is the cost fo teh shapes that inteset form the two compounds.
for reay casting is alsosub long Log(n)
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests