@@ -585,9 +585,11 @@ int ompi_rte_init(int *pargc, char ***pargv)
585
585
/* just assume 0 */
586
586
u16 = 0 ;
587
587
} else {
588
- ret = opal_pmix_convert_status (rc );
589
- error = "node rank" ;
590
- goto error ;
588
+ /* we may be in an environment that doesn't quite adhere
589
+ * to the Standard - we can safely assume it is the same
590
+ * as the local rank as such environments probably aren't
591
+ * going to care */
592
+ u16 = opal_process_info .my_local_rank ;
591
593
}
592
594
}
593
595
opal_process_info .my_node_rank = u16 ;
@@ -668,6 +670,7 @@ int ompi_rte_init(int *pargc, char ***pargv)
668
670
}
669
671
}
670
672
673
+ #ifdef PMIX_APP_ARGV
671
674
/* get our command - defaults to our appnum */
672
675
ev1 = NULL ;
673
676
OPAL_MODEX_RECV_VALUE_OPTIONAL (rc , PMIX_APP_ARGV ,
@@ -681,24 +684,28 @@ int ompi_rte_init(int *pargc, char ***pargv)
681
684
opal_process_info .command = opal_argv_join (tmp , ' ' );
682
685
}
683
686
}
687
+ #else
688
+ tmp = * pargv ;
689
+ if (NULL != tmp ) {
690
+ opal_process_info .command = opal_argv_join (tmp , ' ' );
691
+ }
692
+ #endif
684
693
694
+ #ifdef PMIX_REINCARNATION
685
695
/* get our reincarnation number */
686
696
OPAL_MODEX_RECV_VALUE_OPTIONAL (rc , PMIX_REINCARNATION ,
687
697
& OPAL_PROC_MY_NAME , & u32ptr , PMIX_UINT32 );
688
698
if (PMIX_SUCCESS == rc ) {
689
699
opal_process_info .reincarnation = u32 ;
690
700
}
701
+ #endif
691
702
692
703
/* get the number of local peers - required for wireup of
693
704
* shared memory BTL, defaults to local node */
694
705
OPAL_MODEX_RECV_VALUE_OPTIONAL (rc , PMIX_LOCAL_SIZE ,
695
706
& pname , & u32ptr , PMIX_UINT32 );
696
707
if (PMIX_SUCCESS == rc ) {
697
708
opal_process_info .num_local_peers = u32 - 1 ; // want number besides ourselves
698
- } else {
699
- ret = opal_pmix_convert_status (rc );
700
- error = "local size" ;
701
- goto error ;
702
709
}
703
710
704
711
/* retrieve temp directories info */
@@ -768,28 +775,27 @@ int ompi_rte_init(int *pargc, char ***pargv)
768
775
opal_process_info .proc_is_bound = false;
769
776
}
770
777
771
- /* get our local peers */
772
- if (0 < opal_process_info .num_local_peers ) {
773
- /* if my local rank if too high, then that's an error */
774
- if (opal_process_info .num_local_peers < opal_process_info .my_local_rank ) {
775
- ret = OPAL_ERR_BAD_PARAM ;
776
- error = "num local peers" ;
777
- goto error ;
778
- }
779
- /* retrieve the local peers - defaults to local node */
780
- val = NULL ;
781
- OPAL_MODEX_RECV_VALUE (rc , PMIX_LOCAL_PEERS ,
782
- & pname , & val , PMIX_STRING );
783
- if (PMIX_SUCCESS == rc && NULL != val ) {
784
- peers = opal_argv_split (val , ',' );
785
- free (val );
786
- } else {
787
- ret = opal_pmix_convert_status (rc );
788
- error = "local peers" ;
789
- goto error ;
790
- }
778
+ /* retrieve the local peers - defaults to local node */
779
+ val = NULL ;
780
+ OPAL_MODEX_RECV_VALUE (rc , PMIX_LOCAL_PEERS ,
781
+ & pname , & val , PMIX_STRING );
782
+ if (PMIX_SUCCESS == rc && NULL != val ) {
783
+ peers = opal_argv_split (val , ',' );
784
+ free (val );
791
785
} else {
792
- peers = NULL ;
786
+ ret = opal_pmix_convert_status (rc );
787
+ error = "local peers" ;
788
+ goto error ;
789
+ }
790
+ /* if we were unable to retrieve the #local peers, set it here */
791
+ if (0 == opal_process_info .num_local_peers ) {
792
+ opal_process_info .num_local_peers = opal_argv_count (peers ) - 1 ;
793
+ }
794
+ /* if my local rank if too high, then that's an error */
795
+ if (opal_process_info .num_local_peers < opal_process_info .my_local_rank ) {
796
+ ret = OPAL_ERR_BAD_PARAM ;
797
+ error = "num local peers" ;
798
+ goto error ;
793
799
}
794
800
795
801
/* set the locality */
0 commit comments