Ensure that the orteds do not directly respond to USR1/2 signals. Those signals are trapped by mpirun and propagated from there - at most, the orteds are involved in the propagation process, but should never do anything on their own.
This commit was SVN r16098.
Этот коммит содержится в:
родитель
07c8fddeef
Коммит
f80ea093a2
@ -1613,6 +1613,11 @@ static int send_signal(pid_t pid, int signal)
|
||||
{
|
||||
int rc = ORTE_SUCCESS;
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_odls_globals.output,
|
||||
"%s sending signal %d to pid %ld",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
signal, (long)pid));
|
||||
|
||||
if (kill(pid, signal) != 0) {
|
||||
switch(errno) {
|
||||
case EINVAL:
|
||||
@ -1641,6 +1646,11 @@ int orte_odls_default_signal_local_procs(const orte_process_name_t *proc, int32_
|
||||
opal_list_item_t *item;
|
||||
orte_odls_child_t *child;
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_odls_globals.output,
|
||||
"%s signaling proc %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
(NULL == proc) ? "NULL" : ORTE_NAME_PRINT(proc)));
|
||||
|
||||
/* protect operations involving the global list of children */
|
||||
OPAL_THREAD_LOCK(&orte_odls_default.mutex);
|
||||
|
||||
|
@ -91,6 +91,10 @@
|
||||
static struct opal_event term_handler;
|
||||
static struct opal_event int_handler;
|
||||
static struct opal_event pipe_handler;
|
||||
#ifndef __WINDOWS__
|
||||
static struct opal_event sigusr1_handler;
|
||||
static struct opal_event sigusr2_handler;
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
static void shutdown_callback(int fd, short flags, void *arg);
|
||||
|
||||
@ -200,6 +204,8 @@ opal_cmd_line_init_t orte_cmd_line_opts[] = {
|
||||
NULL, OPAL_CMD_LINE_TYPE_NULL, NULL }
|
||||
};
|
||||
|
||||
static void signal_callback(int fd, short event, void *arg);
|
||||
|
||||
int orte_daemon(int argc, char *argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
@ -446,6 +452,16 @@ int orte_daemon(int argc, char *argv[])
|
||||
shutdown_callback, NULL);
|
||||
opal_event_add(&int_handler, NULL);
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
/** setup callbacks for signals we should ignore */
|
||||
opal_signal_set(&sigusr1_handler, SIGUSR1,
|
||||
signal_callback, &sigusr1_handler);
|
||||
opal_signal_add(&sigusr1_handler, NULL);
|
||||
opal_signal_set(&sigusr2_handler, SIGUSR2,
|
||||
signal_callback, &sigusr2_handler);
|
||||
opal_signal_add(&sigusr2_handler, NULL);
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
/* if requested, report my uri to the indicated pipe */
|
||||
if (orted_globals.uri_pipe > 0) {
|
||||
write(orted_globals.uri_pipe, orte_universe_info.seed_uri,
|
||||
@ -601,3 +617,7 @@ static void shutdown_callback(int fd, short flags, void *arg)
|
||||
opal_condition_signal(&orted_comm_cond);
|
||||
}
|
||||
|
||||
static void signal_callback(int fd, short event, void *arg)
|
||||
{
|
||||
/* just ignore these signals */
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user