88 * reserved.
99 * Copyright (c) 2014-2018 Cisco Systems, Inc. All rights reserved
1010 * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
11- * Copyright (c) 2018-2020 Triad National Security, LLC. All rights
11+ * Copyright (c) 2018-2022 Triad National Security, LLC. All rights
1212 * reserved.
1313 * Copyright (c) 2019 Research Organization for Information Science
1414 * and Technology (RIST). All rights reserved.
6161/* storage to support OMPI */
6262opal_process_name_t pmix_name_wildcard = {UINT32_MAX-1, UINT32_MAX-1};
6363opal_process_name_t pmix_name_invalid = {UINT32_MAX, UINT32_MAX};
64- bool ompi_singleton = false;
6564
6665static int _setup_top_session_dir(char **sdir);
6766static int _setup_job_session_dir(char **sdir);
@@ -541,6 +540,7 @@ int ompi_rte_init(int *pargc, char ***pargv)
541540 pmix_value_t pval;
542541 pmix_status_t rc;
543542 char **tmp;
543+ bool singleton = false;
544544
545545 u32ptr = &u32;
546546 u16ptr = &u16;
@@ -586,7 +586,7 @@ int ompi_rte_init(int *pargc, char ***pargv)
586586 opal_show_help("help-mpi-runtime.txt", "no-pmix-but", false, size);
587587 }
588588 }
589- ompi_singleton = true;
589+ singleton = true;
590590 } else {
591591 /* we cannot run - this could be due to being direct launched
592592 * without the required PMI support being built, so print
@@ -605,6 +605,11 @@ int ompi_rte_init(int *pargc, char ***pargv)
605605 OPAL_PROC_MY_NAME.vpid = pname.vpid;
606606 opal_process_info.my_name.jobid = OPAL_PROC_MY_NAME.jobid;
607607 opal_process_info.my_name.vpid = OPAL_PROC_MY_NAME.vpid;
608+ if (singleton) {
609+ opal_process_info.is_singleton = true;
610+ } else {
611+ opal_process_info.is_singleton = false;
612+ }
608613
609614
610615 /* set our hostname */
@@ -623,7 +628,7 @@ int ompi_rte_init(int *pargc, char ***pargv)
623628 OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCAL_RANK,
624629 &opal_process_info.my_name, &u16ptr, PMIX_UINT16);
625630 if (PMIX_SUCCESS != rc) {
626- if (ompi_singleton ) {
631+ if (opal_process_info.is_singleton ) {
627632 /* just assume 0 */
628633 u16 = 0;
629634 } else {
@@ -638,7 +643,7 @@ int ompi_rte_init(int *pargc, char ***pargv)
638643 OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_NODE_RANK,
639644 &opal_process_info.my_name, &u16ptr, PMIX_UINT16);
640645 if (PMIX_SUCCESS != rc) {
641- if (ompi_singleton ) {
646+ if (opal_process_info.is_singleton ) {
642647 /* just assume 0 */
643648 u16 = 0;
644649 } else {
@@ -657,7 +662,7 @@ int ompi_rte_init(int *pargc, char ***pargv)
657662 OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_JOB_SIZE,
658663 &pname, &u32ptr, PMIX_UINT32);
659664 if (PMIX_SUCCESS != rc) {
660- if (ompi_singleton ) {
665+ if ( opal_process_info.is_singleton ) {
661666 /* just assume 1 */
662667 u32 = 1;
663668 } else {
@@ -672,7 +677,7 @@ int ompi_rte_init(int *pargc, char ***pargv)
672677 OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_UNIV_SIZE,
673678 &pname, &u32ptr, PMIX_UINT32);
674679 if (PMIX_SUCCESS != rc) {
675- if (ompi_singleton ) {
680+ if (opal_process_info.is_singleton ) {
676681 /* just assume 1 */
677682 u32 = 1;
678683 } else {
0 commit comments