Skip to content

Commit 1876cb2

Browse files
committed
Fix Singletons and Singleton Spawn
* Fixes open-mpi#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]> (cherry picked from commit 16a1fa6)
1 parent 0449459 commit 1876cb2

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

ompi/dpm/dpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ static int start_dvm(char **hostfiles, char **dash_host)
20382038
opal_asprintf(&tmp, "%d", death_pipe[0]);
20392039
opal_argv_append_nosize(&args, tmp);
20402040
free(tmp);
2041-
opal_argv_append_nosize(&args, "&");
2041+
opal_argv_append_nosize(&args, "--daemonize");
20422042

20432043
/* Fork off the child */
20442044
pid = fork();

ompi/runtime/ompi_rte.c

Lines changed: 9 additions & 7 deletions
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"
@@ -843,19 +843,21 @@ int ompi_rte_init(int *pargc, char ***pargv)
843843

844844
/* retrieve the local peers - defaults to local node */
845845
val = NULL;
846-
OPAL_MODEX_RECV_VALUE(rc, PMIX_LOCAL_PEERS,
847-
&pname, &val, PMIX_STRING);
846+
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCAL_PEERS,
847+
&pname, &val, PMIX_STRING);
848848
if (PMIX_SUCCESS == rc && NULL != val) {
849849
peers = opal_argv_split(val, ',');
850850
free(val);
851851
} else {
852-
ret = opal_pmix_convert_status(rc);
853-
error = "local peers";
854-
goto error;
852+
peers = NULL;
855853
}
856854
/* if we were unable to retrieve the #local peers, set it here */
857855
if (0 == opal_process_info.num_local_peers) {
858-
opal_process_info.num_local_peers = opal_argv_count(peers) - 1;
856+
if (NULL != peers) {
857+
opal_process_info.num_local_peers = opal_argv_count(peers) - 1;
858+
} else {
859+
opal_process_info.num_local_peers = 1;
860+
}
859861
}
860862
/* if my local rank if too high, then that's an error */
861863
if (opal_process_info.num_local_peers < opal_process_info.my_local_rank) {

0 commit comments

Comments
 (0)