Thanks, Ralph! So I tried using the signal module in python to handle the
SIGTERM and write an error message, and that seemed to work when using
Ctrl+C to kill python, but when using mpirun, python still dies without the
error message. I'm assuming that means mpirun wasn't able to SIGTERM
python, so it just SIGKILLed it? Is there a good reason SIGTERM might fail
that I could fix?
Thanks!
Seth

On Thu, May 7, 2015 at 4:00 PM Ralph Castain <r...@open-mpi.org> wrote:

> When mpirun receives a Ctrl-C, it hits each of its processes with a
> SIGTERM, followed a little later by SIGKILL if the proc didn’t terminate.
>
>
> On May 7, 2015, at 2:31 PM, Seth Axen <seth.a...@gmail.com> wrote:
>
> Hello,
> How does mpirun or mpiexec handle Ctrl+C? I noticed when I use Ctrl+C on a
> running python script (without MPI), this generates a KeyboardInterrupt
> exception which I can catch and do something with, but when I use mpirun to
> run the python script, so far as I can tell, no exception is generated; the
> script just dies. I'd like to be able to catch an exception within my
> script and do some cleaning up before killing the script, but I can't
> figure out how to do this. I've already posted on the mpi4py message board (
> https://groups.google.com/forum/#!topic/mpi4py/x8tloLNGWTk) and was
> referred here.
> Thanks!
> Seth
>
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post:
> http://www.open-mpi.org/community/lists/users/2015/05/26848.php
>
>
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post:
> http://www.open-mpi.org/community/lists/users/2015/05/26849.php

Reply via email to