Skip to content

Commit

Permalink
Fix Singletons and Singleton Spawn
Browse files Browse the repository at this point in the history
 * 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 <jhursey@us.ibm.com>
  • Loading branch information
jjhursey authored and Mamzi Bayatpour mbayatpour@nvidia.com () committed Oct 26, 2022
1 parent ae6435f commit fe08e32
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion ompi/dpm/dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
* Copyright (c) 2018-2022 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2022 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -2042,7 +2043,7 @@ static int start_dvm(char **hostfiles, char **dash_host)
opal_asprintf(&tmp, "%d", death_pipe[0]);
opal_argv_append_nosize(&args, tmp);
free(tmp);
opal_argv_append_nosize(&args, "&");
opal_argv_append_nosize(&args, "--daemonize");

/* Fork off the child */
pid = fork();
Expand Down
16 changes: 9 additions & 7 deletions ompi/runtime/ompi_rte.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
* reserved.
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
* Copyright (c) 2021 IBM Corporation. All rights reserved.
* Copyright (c) 2021-2022 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*/
#include "ompi_config.h"
Expand Down Expand Up @@ -848,19 +848,21 @@ int ompi_rte_init(int *pargc, char ***pargv)

/* retrieve the local peers - defaults to local node */
val = NULL;
OPAL_MODEX_RECV_VALUE(rc, PMIX_LOCAL_PEERS,
&pname, &val, PMIX_STRING);
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCAL_PEERS,
&pname, &val, PMIX_STRING);
if (PMIX_SUCCESS == rc && NULL != val) {
peers = opal_argv_split(val, ',');
free(val);
} else {
ret = opal_pmix_convert_status(rc);
error = "local peers";
goto error;
peers = NULL;
}
/* if we were unable to retrieve the #local peers, set it here */
if (0 == opal_process_info.num_local_peers) {
opal_process_info.num_local_peers = opal_argv_count(peers) - 1;
if (NULL != peers) {
opal_process_info.num_local_peers = opal_argv_count(peers) - 1;
} else {
opal_process_info.num_local_peers = 1;
}
}
/* if my local rank if too high, then that's an error */
if (opal_process_info.num_local_peers < opal_process_info.my_local_rank) {
Expand Down

0 comments on commit fe08e32

Please sign in to comment.