openworm / org.geppetto.solver.sph

PCI SPH Solver bundle for Geppetto
http://www.geppetto.org/
Other
9 stars 6 forks source link

Investigate elastic connections issue #11

Closed gidili closed 10 years ago

gidili commented 11 years ago

Liquid matter behaves as expected, elastic matter seems to behave like a liquid too.

My guess is that elastic connections are somehow broken or disregarded so single elastic particles mingle with the liquid ones.

gidili commented 11 years ago

Here's what happens with screenshots:

Elastic matter - 1

Elastic matter - 2

Elastic matter - 3

gidili commented 11 years ago

@skhayrulin thanks for offering to look into this! The other issue I am working on will prevent you from running it smoothly on the UI unfortunately, but if it freezes (when the exception is thrown it will stop updating the client) you can pause-->stop-->start and it should start again (give it a few seconds) without restarting virgo.

Also you can run or write tests etc in org.gepetto.solver.sph everything should be fine, because the problem is outside of the solver itself.

As a note - it's still fairly slow on CPU, but much faster than it used to be on GPU (I know you had problems with the Tesla not being detected, probably OpenCL version issue).

gidili commented 11 years ago

@skhayrulin to run the scene you want - you have this file in dropbox from last time:

https://www.dropbox.com/s/nkqrl6op8zcu653/sph-sim-config-sergey.xml?dl=1

Replace the placeholder with the absolute path of the file you want to load, and copy paste the link above in the "load" box. The scene in the screenshots is in /git/openworm/org.geppetto.solver.sph/src/test/resources/sphModel_Elastic.xml - any issues let me know!

gidili commented 11 years ago

@skhayrulin this other issue is fixed: https://github.com/openworm/OpenWorm/issues/106 so you should be able to run Geppetto smoothly with the current version of SPH and investigate the elastic matter thing if you want!

skhayrulin commented 11 years ago

Hi @gidili ! I'm trying to run simulation on my machine, it looks like tests pass fine. But when I try to run->maven install it seems that it buzz with this log (https://www.dropbox.com/s/qio911w06adwvne/log_geppetto.sph_mavenInstall). When I'm run virgo server and go to (http://localhost:8080/org.openworm.simulationengine.frontend/genericSimulation.htm) it return error 404. Works on windows 7.

gidili commented 11 years ago

Hey @skhayrulin - I see no errors in the log but it seems incomplete? It doesn't say FAIL or SUCCESS it just stops, is that what happens?

Good news is that both CPU and GPU seem to be working from the first couple of tests that are passing.

Also the URL you need to visitis http://localhost:8080/org.geppetto.frontend/ and no longer the one you are using - instructions changed so that would explain the 404.

You need to make sure all the maven install are building with SUCCESS then copy the artifacts into Virgo's repository/usr with this script (just make sure to change paths to your local ones after you download).

After that's done start Virgo and when the console stops with no errors you can go to the url. If you have errors in the console wen you start virgo (hopefully not) you can send me that log!

gidili commented 11 years ago

@skhayrulin Also I suggest you use the GPU when debugging / troubleshooting by changing the default device in the solver from CPU to GPU as it's much faster on GPU.

gidili commented 11 years ago

@skhayrulin I am looking at this issue too btw - hopefully between the two of us we'll figure it out. Contact me on gtalk/skype/email for anything, we can get on a call if any issues.

gidili commented 11 years ago

I am looking at the elastic connection data in this file, generated by this code (ported verbatim from a previous scene generated on the C++ version with only one elastic bundle).

Elastic connection data looks like this:

    <connections>
        <p1>1.1</p1>
        <p2>0.006679993</p2>
        <distance>1.1</distance>
    </connections>
    <connections>
        <p1>35.1</p1>
        <p2>0.006679993</p2>
        <distance>0.0</distance>
    </connections>
    <connections>
        <p1>36.1</p1>
        <p2>0.009446937</p2>
        <distance>0.0</distance>
    </connections>
    <connections>
        <p1>-1.0</p1>
        <p2>0.0</p2>
        <distance>0.0</distance>
    </connections>

Few questions for @skhayrulin and @a-palyanov:

If we can resolve this issue with elastic connections we are very very close to having something we can work with in Geppetto!

skhayrulin commented 11 years ago

Hi @gidili! It seems that it never stop. About ellastic connection: The structure which we use for store of information about elastic connection is like that (it's float4): 1) Elastic connection: particle jd - jparticle rij0 - distance between i and j, val1 - it's better to ask @a-palyanov val2 - doesn't have any useful information yet So as you can see we didn't indicate id of i particle it's because in big array elastic connections arranged in such way as a neighbour map array.

2) It's not realy a distance between two elastic particles - but what does it means better ask @a-palyanov

3) So for every elastic particle we allocate 32 possible elastic connections (on initialization step) and init them by rij0=val1=val2=0 and jd = NO_PARTILE_ID = -1, than we fill up array elastic connections and change by real data if partciel i has such. As you can see elastic particle can have or not a 32 elastic neighbours if note then some ellastic connections will be on inition state rij0=val1=val2=0 and jd = NO_PARTILE_ID = -1.

Hope it's help, If you don't understood or my explanation doesn't cleare please let me know

gidili commented 11 years ago

@skhayrulin about the build - do you stop the build manually? It pauses between tests because it's re-initializing the OpenCL stuff and that takes some time, but the whole build should complete in around 1 minute regardless. We can get on a call to sort it out.

OK - so the elasticconnections.txt file you have in the configuration folder are no longer up to date and in sync with the scene generation Andrey has hardcoded? You seem to never use val1. Does that file still work?

Also about:

particle jd = jparticle
rij0 = distance between i and j

if the j particle is the first value, and the distance between i and j the second value, where is the ID of the i particle? Is it represented by the line numbers in the file? Or is it in some other array populated at runtime?

@a-palyanov can you help us understand what's the use of val1?

I would immensely appreciate any help from either of you to:

Any help appreciated!

gidili commented 11 years ago

Quick update on this - I converted the scene with one single elastic bundle into the txt file format that @skhayrulin has created for the C++ version of the PCI-SPH solver (files here).

Weird stuff happens when I run the C++ simulation with my generated file: 1 2 3 4

This is what happen when using the code written by Andrey to generate the scene many versions ago (here's the last commit I am working off because I ported up to that version): 1 2 3 etc.

So it seems like the scene that I generated as a Java port of Andrey's scene generation code is somehow messed up - which gives me hope the code in the solver might be ok.

More on this next week.

skhayrulin commented 11 years ago

Hi @gidili ! New build log from my machine (https://www.dropbox.com/s/3d657icpsie1ocp/log_geppetto_fail.txt). It seems that now it stops but with fail. About elasticconnections.txt file yes it doesn't work for now it out of date a bit.

skhayrulin commented 11 years ago

@gidili good news, I managed to launch simulation engine and looks like it works, but I have a problem with load configuration. I've changed absolute path to file with configuration as yo wrote above but when I'm trying to run this configuration it seems that nothing happens. May be I make a mistake. Hope to see you this evening)

tarelli commented 11 years ago

Hi Sergey, Awesome news! The file needs to still be in the URL form, I'm updating your file, give it another shot (and look at what I have changed). Best, Matteo

On 17 June 2013 08:14, Sergey notifications@github.com wrote:

@gidili https://github.com/gidili good news, I managed to launch simulation engine and looks like it works, but I have a problem with load configuration. I've changed absolute path to file with configurationhttps://dl.dropboxusercontent.com/s/nkqrl6op8zcu653/sph-sim-config-sergey.xml?token_hash=AAHHXFGnGT383HhaDBD7KNbZAS44QZSyl7t-qoqJIacQMAas yo wrote above but when I'm trying to run this configuration it seems that nothing happens. May be I make a mistake. Hope to see you this evening)

— Reply to this email directly or view it on GitHubhttps://github.com/openworm/org.geppetto.solver.sph/issues/11#issuecomment-19529408 .

Matteo Cantarelli

email: matteo.cantarelli@gmail.com mobile (UK) : +44 (0)74 47540306 mobile (Italy) : +39 392 1086649 skype: tarelli1138 http://it.linkedin.com/in/matteocantarelli

skhayrulin commented 11 years ago

Hi @tarelli! Thanks It works now!

skhayrulin commented 11 years ago

Hi @gidili, @tarelli !

Question from @gidili

particle jd = jparticle rij0 = distance between i and j

if the j particle is the first value, and the distance between i and j the second value, where is the ID of the i particle? Is it represented by the line numbers in the file? Or is it in some other array populated at runtime?

Every elastic particle has a 32 elastic connection (32 cells in elasticConnection_buffer). So elastic connection position in array can be represented as id * 32 + j where id - is id of interesting particle j = [0..31]. Ellement of connection can be get from array by this formula

So @gidili, @tarelli how do you think do we need correct sph model schema accordingly this?

gidili commented 11 years ago

Hey @skhayrulin - I don't think we have to change anything unless val2 in now being used.

Here's what we have in the xml for the connections at the moment (I recently updated the schema to reflect this):

<connections>
    <p1>1.1</p1> <!-- this is jd -->
    <distance>0.006679993</distance> <!-- this is distance -->
    <mysteryValue>1.1</mysteryValue> <!-- this is val1, not sure what it represents -->
    <!-- val2 is missing, since it's not used -->
 </connections>

Can we not just use this format? Or are you proposing to add val2?

Would be nice to rename mysteryValue - @a-palyanov what is val2 supposed to be?

gidili commented 11 years ago

@skhayrulin your help on this would be exceptionally helpful!

tarelli commented 10 years ago

This was fixed