Re: [Yade-dev] Python inheritance

2019-10-11 Thread Bruno Chareyre
Le jeu. 10 oct. 2019 11:13, William Chèvremont < william.chevrem...@univ-grenoble-alpes.fr> a écrit : > > I'll update the doc about subclassing c++ in python, as this is mandatory > for all python code called from C++ while running O.run(). > The doc should probably mention "pyRunString

Re: [Yade-dev] Python inheritance

2019-10-10 Thread Janek Kozicki (yade)
Great! Thanks for finding this out :) William Chèvremont said: (by the date of Thu, 10 Oct 2019 11:13:23 +0200) > Ok got it. > > The problem come from the Global Interpreter Lock from Python. run() > seems to run the code in an other thread as step() run the code in the > same thread as py

Re: [Yade-dev] Python inheritance

2019-10-10 Thread William Chèvremont
Ok got it. The problem come from the Global Interpreter Lock from Python. run() seems to run the code in an other thread as step() run the code in the same thread as python. So, when calling the function via step(), the lock is already acquired by the thread. On the other hand, run() is into

Re: [Yade-dev] Python inheritance

2019-10-08 Thread William Chèvremont
Hi, Yes, there are the same behaviour with and without wait. William On 08/10/2019 12:57, Bruno Chareyre wrote: Hi William, I don't know precisely but in case it can help I would raise that the main difference between step() and run() is Py_BEGIN_ALLOW_THREADS, at least if O.run(...,wait=Tr

Re: [Yade-dev] Python inheritance

2019-10-08 Thread Bruno Chareyre
Hi William, I don't know precisely but in case it can help I would raise that the main difference between step() and run() is Py_BEGIN_ALLOW_THREADS, at least if O.run(...,wait=True). Do you have the same problem with and without "wait"? Simply passing to c++ a python expression (just a string wit

Re: [Yade-dev] Python inheritance

2019-10-08 Thread Jerome Duriez
Hi, For your information, I also faced at some point segfaults with boost::python stuff during O.run() and not O.step() : https://www.mail-archive.com/yade-dev@lists.launchpad.net/msg13223.html (I never really solved / understood it.. If you know e.g. boost mutex more than me -- that won't b

Re: [Yade-dev] Python inheritance

2019-10-08 Thread William Chèvremont
Hi, @Janek Yes, I'm aware of the doc about subclassing types in python. There are no problem about that, since it works when calling O.step() instead of O.run(). @Anton The complete backtrace is attached to this mail. Functions of interests are around line 400. Best Regards, William O

Re: [Yade-dev] Python inheritance

2019-10-07 Thread Janek Kozicki (yade)
Only a quick question to make sure - you have read https://yade-dem.org/doc/prog.html#subclassing-c-types-in-python in documentation? best regards Janek ___ Mailing list: https://launchpad.net/~yade-dev Post to : yade-dev@lists.launchpad.net Unsu

Re: [Yade-dev] Python inheritance

2019-10-07 Thread Anton Gladky
Hi, without stack trace it is difficult to analyze. Please compile Yade with debug symbols, run your script till it crashes and provide the stack trace. Regards On Mon, Oct 7, 2019, 16:46 William Chèvremont < william.chevrem...@univ-grenoble-alpes.fr> wrote: > Dear Yade dev, > > I'm facing an i

[Yade-dev] Python inheritance

2019-10-07 Thread William Chèvremont
Dear Yade dev, I'm facing an issue implementing a new interaction law into Yade. To be quick, I would like to provide normal force norm from python and integrate this value into the lubrication law. The current state of my work is on branch 'potential' on gitlab. What's new in this branch: