Hi all,

I'm working to understand signal handling in OpenMPI. I read that "Open MPI
will forward SIGUSR1 and SIGUSR2 from mpiexec to the other processes". My
question is that is this feature enabled by default installation.

The scenario is that one MPI process raises a SIGUSR1, which has to be
detected by 'orted' which is then forwarded to other processes.

In my test code, I define a custom signal handler for SIGUSR1 and register
this signal handler accordingly. I send a signal by using kill() or
raise(). I assume that ORTE daemon will receive this signal and has to
forward this signal to the 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 with rank 1 raises SIGUSR1
     kill(getpid(), SIGUSR1);

MPI_Finalize();
}

If I run this as
mpirun -np 3 ./test

I would expect to have the statement printed twice from the other two
processes. But when I run this code, it only prints once, and that too from
ORTE HNP, unlike the application processes. Do I need to call any other API
on orted explicitly pass this signal, so that the application processes
receive the SIGUSR1.

-
Marc
_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users

Reply via email to