Re: Calling python from C with OpenMP

2016-05-13 Thread Øystein Schønning-Johansen
On Friday, May 13, 2016 at 7:12:33 PM UTC+2, MRAB wrote: > Every PyGILState_Ensure call must be matched with a PyGILState_Release > call. The way it's currently written, it won't call PyGILState_Release > if ret is NULL. Yeah, that's tiny bug, however it is not the main problem... > However, I

Re: Calling python from C with OpenMP

2016-05-13 Thread Øystein Schønning-Johansen
On Friday, May 13, 2016 at 2:04:53 AM UTC+2, Sturla Molden wrote: > You must own the GIL before you can safely use the Python C API, object > creation and refcounting in particular. Use the "Simplified GIL API" to > grab the GIL and release it when you are done. I've now read about the GIL and it