[Numpy-discussion] Recovering from a STOP ?
Tue Mar 20 05:20:05 CDT 2012
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 suggested in
which amounts to let f2py trap the SIGINT. That's good enough for what I need.
However, that stresses the need to have a more robust way to deal with
these interruptions and make sure that several objects calling one (or
several temporary) fortran extension don't interact the ones with the
And I'm coming to the same conclusion as Chris', that I have to use
the `multiprocessing` module, with several processes calling their own
fortran extension. But that's another story.
Thanks y'all for your help
On 3/14/12, Chris Barker <email@example.com> wrote:
> On Wed, Mar 14, 2012 at 9:25 AM, Pauli Virtanen <firstname.lastname@example.org> 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 who know
> what else.
> We did something similar with some C code that called the system
> exit() function when it encountered errors -- it may not have been too
> hard to replace those calls, but making sure the memory was all
> cleaned up was going to be a trick -- so we just used the multiprocess
> module to call it in another process.
> Christopher Barker, Ph.D.
> Emergency Response Division
> NOAA/NOS/OR&R (206) 526-6959 voice
> 7600 Sand Point Way NE (206) 526-6329 fax
> Seattle, WA 98115 (206) 526-6317 main reception
> NumPy-Discussion mailing list
More information about the NumPy-Discussion