@@ -553,6 +553,14 @@ static uint32_t get_package_rank(opal_process_info_t *process_info)
553
553
pname .jobid = OPAL_PROC_MY_NAME .jobid ;
554
554
pname .vpid = OPAL_VPID_WILDCARD ;
555
555
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
+
556
564
#if HAVE_DECL_PMIX_PACKAGE_RANK
557
565
// Try to get the PACKAGE_RANK from PMIx
558
566
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)
561
569
}
562
570
#endif
563
571
564
- // Get the local peers - note there may not always be local peers,e.g. .singleton launch case
572
+ // Get the local peers
565
573
OPAL_MODEX_RECV_VALUE (rc , PMIX_LOCAL_PEERS , & pname , & local_peers , PMIX_STRING );
566
574
if (PMIX_SUCCESS != rc || NULL == local_peers ) {
567
575
// 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);
571
577
return (uint32_t ) process_info -> myprocid .rank ;
572
578
}
573
579
peers = opal_argv_split (local_peers , ',' );
0 commit comments