c - Error in signal handling in OpenMPI -
i'm working understand signal handling in openmpi. read "open mpi forward sigusr1 , sigusr2 mpiexec other processes". question is feature enabled default installation.
the scenario 1 mpi process raises sigusr1, has detected 'orted' forwarded other processes.
in test code, define custom signal handler sigusr1 , register signal handler accordingly. send signal using kill() or raise(). assume orte daemon receive signal , has forward signal remaining processes.
// test.c
void handle_signal(int signal){ if(signal==sigusr1) printf("received sigusr1 signal \n"); } int main(){ mpi_init(null, null); int my_rank; mpi_comm_rank(mpi_comm_world, &my_rank); signal(sigusr1, handle_signal); if(my_rank == 1) // process rank 1 raises sigusr1 kill(getpid(), sigusr1); mpi_finalize(); return 0; }
if run mpirun -np 3 ./test
i expect have statement printed twice other 2 processes. when run code, prints once, , orte hnp, unlike application processes. need call other api on orted explicitly pass signal, application processes receive sigusr1.
- marc
you cannot use signal forwarding way describe:
open mpi forward sigusr1 , sigusr2 from mpiexec other processes
you can't send signal yourself, have find mpiexec
process. process can run on different node, cannot send signal anyway.
i cannot think of reasonable way interrupt other mpi ranks that, except mpi_abort
, not want. depending on actual goal, have chose asynchronous point point communication, one-side communication or threads.
Comments
Post a Comment