@@ -553,6 +553,14 @@ static uint32_t get_package_rank(opal_process_info_t *process_info)
553553 pname .jobid = OPAL_PROC_MY_NAME .jobid ;
554554 pname .vpid = OPAL_VPID_WILDCARD ;
555555
556+ /*
557+ * if we are a singleton just return myprocid.rank
558+ * because we by definition don't know about any local peers
559+ */
560+ if (opal_process_info .is_singleton ) {
561+ return (uint32_t ) process_info -> myprocid .rank ;
562+ }
563+
556564#if HAVE_DECL_PMIX_PACKAGE_RANK
557565 // Try to get the PACKAGE_RANK from PMIx
558566 OPAL_MODEX_RECV_VALUE_OPTIONAL (rc , PMIX_PACKAGE_RANK , & pname , & package_rank_ptr , PMIX_UINT16 );
@@ -561,13 +569,11 @@ static uint32_t get_package_rank(opal_process_info_t *process_info)
561569 }
562570#endif
563571
564- // Get the local peers - note there may not always be local peers,e.g. .singleton launch case
572+ // Get the local peers
565573 OPAL_MODEX_RECV_VALUE (rc , PMIX_LOCAL_PEERS , & pname , & local_peers , PMIX_STRING );
566574 if (PMIX_SUCCESS != rc || NULL == local_peers ) {
567575 // We can't find package_rank, fall back to procid
568- if (10 <= opal_common_ofi_verbose_level ) {
569- opal_show_help ("help-common-ofi.txt" , "package_rank failed" , true, 10 );
570- }
576+ opal_show_help ("help-common-ofi.txt" , "package_rank failed" , true);
571577 return (uint32_t ) process_info -> myprocid .rank ;
572578 }
573579 peers = opal_argv_split (local_peers , ',' );
0 commit comments