Skip to content

Commit 1c1d4e1

Browse files
committed
Output IO as singleton, support background commands
When running as a singleton, setup to handle any IO from spawned children. Do not identify an ampersand as a cmd line "tail" as this falsely implies it is an application. Signed-off-by: Ralph Castain <[email protected]>
1 parent 7838bc7 commit 1c1d4e1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/client/pmix_client.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ static pmix_status_t pmix_init_result = PMIX_ERR_INIT;
8484
#include "src/util/pmix_show_help.h"
8585

8686
#include "pmix_client_ops.h"
87+
#include "src/server/pmix_server_ops.h"
8788

8889
#define PMIX_MAX_RETRIES 10
8990

@@ -481,7 +482,8 @@ static void client_iof_handler(struct pmix_peer_t *pr, pmix_ptl_hdr_t *hdr, pmix
481482
pmix_iof_req_t *req;
482483
pmix_info_t *info = NULL;
483484

484-
pmix_output_verbose(2, pmix_client_globals.iof_output, "recvd IOF with %d bytes",
485+
pmix_output_verbose(2, pmix_client_globals.iof_output,
486+
"recvd IOF with %d bytes",
485487
(int) buf->bytes_used);
486488

487489
PMIX_HIDE_UNUSED_PARAMS(hdr, cbdata);
@@ -697,6 +699,10 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc, pmix_info_t info[], size_
697699
PMIX_LOAD_PROCID(proc, pmix_globals.myid.nspace, pmix_globals.myid.rank);
698700
}
699701
pmix_globals.mypeer->nptr->nspace = strdup(pmix_globals.myid.nspace);
702+
/* define us as an IOF endpoint so any output will be printed */
703+
pmix_globals.iof_flags.local_output = true;
704+
PMIX_CONSTRUCT(&pmix_server_globals.iof, pmix_list_t);
705+
PMIX_CONSTRUCT(&pmix_server_globals.iof_residuals, pmix_list_t);
700706
} else {
701707
if (NULL != proc) {
702708
pmix_strncpy(proc->nspace, evar, PMIX_MAX_NSLEN);

src/util/pmix_cmd_line.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ int pmix_cmd_line_parse(char **pargv, char *shorts,
336336
}
337337
}
338338
if (optind < argc) {
339-
results->tail = pmix_argv_copy(&argv[optind]);
339+
/* if this is an '&', it simply indicates that the executable
340+
* was being pushed into the background - ignore it */
341+
if (0 != strcmp(argv[optind], "&")) {
342+
results->tail = pmix_argv_copy(&argv[optind]);
343+
}
340344
}
341345
pmix_argv_free(argv);
342346
return PMIX_SUCCESS;

0 commit comments

Comments
 (0)