Skip to content

Commit bb81f3b

Browse files
author
Ralph Castain
committed
Always setup the attach fifo, even when we initially launch under a debugger so that the user can detach and reattach later
Signed-off-by: Ralph Castain <[email protected]>
1 parent bea7d9e commit bb81f3b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

orte/orted/orted_submit.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,23 @@ static void orte_debugger_init_before_spawn(orte_job_t *jdata)
22782278
opal_setenv(env_name, "1", true, &app->env);
22792279
}
22802280
free(env_name);
2281+
2282+
/* setup the attach fifo in case someone wants to re-attach */
2283+
if (orte_create_session_dirs) {
2284+
/* create the attachment FIFO and setup readevent - cannot be
2285+
* done if no session dirs exist!
2286+
*/
2287+
attach_fifo = opal_os_path(false, orte_process_info.job_session_dir,
2288+
"debugger_attach_fifo", NULL);
2289+
if ((mkfifo(attach_fifo, FILE_MODE) < 0) && errno != EEXIST) {
2290+
opal_output(0, "CANNOT CREATE FIFO %s: errno %d", attach_fifo, errno);
2291+
free(attach_fifo);
2292+
return;
2293+
}
2294+
strncpy(MPIR_attach_fifo, attach_fifo, MPIR_MAX_PATH_LENGTH - 1);
2295+
free(attach_fifo);
2296+
open_fifo();
2297+
}
22812298
}
22822299

22832300
static bool mpir_breakpoint_fired = false;

0 commit comments

Comments
 (0)