MPI signal handling

Posted by Seth Johnson on Stack Overflow See other posts from Stack Overflow or by Seth Johnson
Published on 2009-07-17T21:18:05Z Indexed on 2010/05/12 11:04 UTC
Read the original article Hit count: 475

Filed under:
|
|

When using mpirun, is it possible to catch signals (for example, the SIGINT generated by ^C) in the code being run?

For example, I'm running a parallelized python code. I can except KeyboardInterrupt to catch those errors when running python blah.py by itself, but I can't when doing mpirun -np 1 python blah.py.

Does anyone have a suggestion? Even finding how to catch signals in a C or C++ compiled program would be a helpful start.

If I send a signal to the spawned Python processes, they can handle the signals properly; however, signals sent to the parent orterun process (i.e. from exceeding wall time on a cluster, or pressing control-C in a terminal) will kill everything immediately.

© Stack Overflow or respective owner

Related posts about mpi

Related posts about signals