orterun.c: set an fd to be close-on-exec
Make sure the debugger attach fifo is marked as close-on-exec so that children procs don't inherit it. For example, if you salloc a SLURM allocation and run "mpirun ..." in there (i.e., mpirun is running on the head node, and launching on to back-end nodes), the forked srun's will inherit this fd if it is still open. Refs trac:4550 This commit was SVN r31499. The following Trac tickets were found above: Ticket 4550 --> https://svn.open-mpi.org/trac/ompi/ticket/4550
This commit is contained in:
parent
b65e7caa77
commit
87e6232e67
@ -2999,6 +2999,16 @@ static void open_fifo (void)
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set this fd to be close-on-exec so that children don't see it */
|
||||
if (fcntl(attach_fd, F_SETFD, FD_CLOEXEC) == -1) {
|
||||
opal_output(0, "%s unable to set debugger attach fifo to CLOEXEC",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
|
||||
close(attach_fd);
|
||||
attach_fd = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
opal_output_verbose(2, orte_debug_output,
|
||||
"%s Monitoring debugger attach fifo %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
|
Loading…
x
Reference in New Issue
Block a user