Skip to content

Commit 16a1fa6

Browse files
committed
Fix Singletons and Singleton Spawn
* Fixes #10590 * Singletons will not have a PMIx value for `PMIX_LOCAL_PEERS` so make that optional instead of required. * `&` is being confused as an application argument in `prte` instead of the background character * Replace with `--daemonize` which is probably better anyway Signed-off-by: Joshua Hursey <[email protected]>
1 parent 31d719d commit 16a1fa6

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

ompi/dpm/dpm.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
2424
* Copyright (c) 2018-2022 Triad National Security, LLC. All rights
2525
* reserved.
26+
* Copyright (c) 2022 IBM Corporation. All rights reserved.
2627
* $COPYRIGHT$
2728
*
2829
* Additional copyrights may follow
@@ -2032,7 +2033,7 @@ static int start_dvm(char **hostfiles, char **dash_host)
20322033
opal_asprintf(&tmp, "%d", death_pipe[0]);
20332034
opal_argv_append_nosize(&args, tmp);
20342035
free(tmp);
2035-
opal_argv_append_nosize(&args, "&");
2036+
opal_argv_append_nosize(&args, "--daemonize");
20362037

20372038
/* Fork off the child */
20382039
pid = fork();

ompi/runtime/ompi_rte.c

+9-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
1616
* reserved.
1717
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
18-
* Copyright (c) 2021 IBM Corporation. All rights reserved.
18+
* Copyright (c) 2021-2022 IBM Corporation. All rights reserved.
1919
* $COPYRIGHT$
2020
*/
2121
#include "ompi_config.h"
@@ -848,19 +848,21 @@ int ompi_rte_init(int *pargc, char ***pargv)
848848

849849
/* retrieve the local peers - defaults to local node */
850850
val = NULL;
851-
OPAL_MODEX_RECV_VALUE(rc, PMIX_LOCAL_PEERS,
852-
&pname, &val, PMIX_STRING);
851+
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCAL_PEERS,
852+
&pname, &val, PMIX_STRING);
853853
if (PMIX_SUCCESS == rc && NULL != val) {
854854
peers = opal_argv_split(val, ',');
855855
free(val);
856856
} else {
857-
ret = opal_pmix_convert_status(rc);
858-
error = "local peers";
859-
goto error;
857+
peers = NULL;
860858
}
861859
/* if we were unable to retrieve the #local peers, set it here */
862860
if (0 == opal_process_info.num_local_peers) {
863-
opal_process_info.num_local_peers = opal_argv_count(peers) - 1;
861+
if (NULL != peers) {
862+
opal_process_info.num_local_peers = opal_argv_count(peers) - 1;
863+
} else {
864+
opal_process_info.num_local_peers = 1;
865+
}
864866
}
865867
/* if my local rank if too high, then that's an error */
866868
if (opal_process_info.num_local_peers < opal_process_info.my_local_rank) {

0 commit comments

Comments
 (0)