[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-17 Thread Anton Gladky
Fixed in r2788. Thanks all! ** Changed in: yade Status: Confirmed => Fix Released -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bugs/724396 Title: crash after add particles in parallel mo

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-17 Thread Launchpad Bug Tracker
** Branch linked: lp:yade -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bugs/724396 Title: crash after add particles in parallel mode Status in Yet Another Dynamic Engine: Fix Released Bug des

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-15 Thread Anton Gladky
I have checked the last patch, all is working well for me! The performance is slightly higher now, than without patch, so I think we did not break the performance. I modified model.py a little bit (attached), now it reads forces of every body on each step. I did not see any problem with that as

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-14 Thread Sergei Dorofeenko
fixed ** Patch added: "fix_724396-v3.diff" https://bugs.launchpad.net/yade/+bug/724396/+attachment/1908010/+files/fix_724396-v3.diff -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bugs/724396 Ti

Re: [Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-14 Thread Anton Gladky
Backtrace is attached Anton ** Attachment added: "segfault_fix_724396-v2" https://bugs.launchpad.net/bugs/724396/+attachment/1907394/+files/segfault_fix_724396-v2 -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bu

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-14 Thread Anton Gladky
The last patch gives a segmentation fault in --test: yade --test Math: Matrix3 operations ... ok Math: Quaternion operations ... ok Math: Vector2 operations ... ok Math: Vector3 operations ... ok Core: correct types are instantiated ... ok Core: dispatcher ctors with functors ... ok Core: Attr::hi

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-13 Thread Sergei Dorofeenko
Fixed path is attached. Compilation and test model.py from this thread is ok. Need test of reading forces from python and perfomance benchmark. ** Patch added: "fix_724396-v2.diff" https://bugs.launchpad.net/yade/+bug/724396/+attachment/1905334/+files/fix_724396-v2.diff -- You received this

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-11 Thread Anton Gladky
I tried to implement an idea, indicated here: https://bugs.launchpad.net/yade/+bug/724396/comments/7 Sergei, could you not, please, test it? Vaclav, could you not, please, have a look at it? Patch is attached. Thanks ** Patch added: "fix_patch.diff" https://bugs.launchpad.net/yade/+bug/7243

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-09 Thread Anton Gladky
Yes, you are right. The proposed way breaks simulations (--check does not path with j>1). I have done locks in non-parallel implementation, and the performance goes down, as you said: -j Parallel Non-Parallel % 1 9971002-0.5 2 821842 -2.6

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-08 Thread Václav Šmilauer
Do you mean that you used non-parallel ForceContainer with OpenMP- enabled simulation run with multiple threads? If so... threads could have been overwriting each other's data. https://www.yade- dem.org/doc/prog.html#forcecontainer explains why threads must have separate data (unless you want to us

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-08 Thread Anton Gladky
** Attachment added: "Results of Parallel ForceContainer" https://bugs.launchpad.net/yade/+bug/724396/+attachment/1895043/+files/Parallel.tgz -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bugs/72

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-08 Thread Anton Gladky
** Attachment added: "Results of NonParallel ForceContainer" https://bugs.launchpad.net/yade/+bug/724396/+attachment/1895042/+files/NoParallel.tgz -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bu

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-08 Thread Anton Gladky
I have done some performance tests on 6-core machine. The simulation have been carried out with different thread numbers and execution time has been measured. In the first case it was the latest trunk revision (2781) clean compile, in the second case the ForceContainer used only "non-parallel flav

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-08 Thread Anton Gladky
** Attachment added: "Scripts to measure performance" https://bugs.launchpad.net/yade/+bug/724396/+attachment/1895041/+files/scripts.tgz -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bugs/724396

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-03-08 Thread Anton Gladky
** Changed in: yade Importance: Undecided => High ** Changed in: yade Status: New => Confirmed -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bugs/724396 Title: crash after add particles

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-27 Thread Václav Šmilauer
I don't think so. I think sizeof(vector) is always sizeof(size_t)+sizeof(void*), the array is allocated on the heap dynamically. For the independent resizing: sounds fine, though sizes should be re-synced in sync() before the summation loop, otherwise it will run slower due to in-loop size checks.

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-25 Thread Sergei Dorofeenko
Apparently, _forceData will not store vvector, but vvector*. Because, if it will store vvector (as now) then _forceData[A].resize(N) can affect _forceData[B]. Or no? -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-25 Thread Sergei Dorofeenko
I want to rewrite ensureSize() in order to the each thread do resize only the "own" vector, not all. So, no need locking at all. Vaclav, do you agree? -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/b

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-25 Thread Václav Šmilauer
Yes, you're right, the locking logic in ForceContainer::resize is not sufficient. What you propose does not solve the problem of adding bodies inside the loop, though -- that is what a factory does, for instance. -- You received this bug notification because you are a member of Yade developers, w

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-25 Thread Sergei Dorofeenko
Seems, cause is next: After adding new particles, the first thread runs on the "old" particles, so without resizing of _forceData in ensureSize() (ForceContainer.hpp:87) And at time, when first thread adds new force to _forceData, second thread starts to run on the "new" particles and do resize

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-24 Thread Anton Gladky
I have tried it on Ubuntu 10.04 -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bugs/724396 Title: crash after add particles in parallel mode Status in Yet Another Dynamic Engine: New Bug descri

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-24 Thread Anton Gladky
Hi, Sergei. I have tried your script, but I cannot reproduce the crash. Will try on other systems. -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bugs/724396 Title: crash after add particles in p

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-24 Thread Sergei Dorofeenko
Seems, something wrong with ForceContainer, see attached log file. ** Attachment added: "crash.log" https://bugs.launchpad.net/yade/+bug/724396/+attachment/1869104/+files/crash.log -- You received this bug notification because you are a member of Yade developers, which is the registrant for

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-24 Thread Sergei Dorofeenko
** Attachment added: "model.py" https://bugs.launchpad.net/bugs/724396/+attachment/1869079/+files/model.py -- You received this bug notification because you are a member of Yade developers, which is the registrant for Yade. https://bugs.launchpad.net/bugs/724396 Title: crash after add parti