Python program termination and exception catching

Jason Swails jason.swails at gmail.com
Sun Apr 10 22:05:09 CEST 2011


On Sun, Apr 10, 2011 at 12:34 PM, Laszlo Nagy <gandalf at shopzeus.com> wrote:

>  2011.04.10. 21:25 keltezéssel, Jason Swails írta:
>
> Hello everyone,
>
> This may sound like a bit of a strange desire, but I want to change the
> way in which a python program quits if an exception is not caught.  The
> program has many different classes of exceptions (for clarity purposes), and
> they're raised whenever something goes wrong.  Most I want to be fatal, but
> others I'd want to catch and deal with.
>
> Well, the application quits when all of it threads are ended. Do you want
> to catch those exception only in the last threads? Or do you want to do it
> in all threads? Or just the main thread?
>

The problem here is that the threads in this case are MPI threads, not
threads spawned during execution. (mpi4py).  I want exceptions to be fatal
as they normally are, but it *must* call MPI's Abort function instead of
just dying, because that will strand the rest of the processes and cause an
infinite hang if there are any subsequent communication attempts.

Hopefully this explains it more clearly?

Thanks!
Jason

-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110410/1cfd7bf9/attachment.html>


More information about the Python-list mailing list