Re: [Numpy-discussion] Recovering from a STOP ?

2012-03-20 Thread Pierre GM
Pauli, Chris, Thanks for your inputs. Pauli, I think that when f2py encounters a STOP statement, it just stops the execution of the process. Alas, it's the same process as the interpreter... So we need a trick not to interrupt the whole process. I eventually resorted to patching f2py as

[Numpy-discussion] Recovering from a STOP ?

2012-03-14 Thread Pierre GM
THYC Dear all, I'm working with some large inherited F90 code that needs to be wrapped in Python. if the code base itself cannot be modified (it's a static archive), some additional F90 files were written to help the interaction with the code. Writing a python extension combining the archive

Re: [Numpy-discussion] Recovering from a STOP ?

2012-03-14 Thread Pauli Virtanen
14.03.2012 14:28, Pierre GM kirjoitti: [clip] Alas, the RuntimeError doesn't look like it's passed back to the interpreter, which still crashes. (Adding a Py_Exit(-1) at the end of pyraise_runtime at least let the interpreter do some extra cleaning after the fortran code stopped, but

Re: [Numpy-discussion] Recovering from a STOP ?

2012-03-14 Thread Chris Barker
On Wed, Mar 14, 2012 at 9:25 AM, Pauli Virtanen p...@iki.fi wrote: Or, maybe the whole Fortran stuff can be run in a separate process, so that crashing doesn't matter. That's what I was going to suggest -- even if you can get it not to crash, it may well be in a bad state -- memory leaks, and