@@ -71,33 +71,24 @@ static int pmi_component_query(mca_base_module_t **module, int *priority)
7171
7272 /* all APPS must use pmix */
7373 if (ORTE_PROC_IS_APP ) {
74- /* open and setup pmix */
75- if (OPAL_SUCCESS != (ret = mca_base_framework_open (& opal_pmix_base_framework , 0 ))) {
76- ORTE_ERROR_LOG (ret );
77- * priority = -1 ;
78- * module = NULL ;
79- return ret ;
80- }
81- if (OPAL_SUCCESS != (ret = opal_pmix_base_select ())) {
82- /* don't error log this as it might not be an error at all */
83- * priority = -1 ;
84- * module = NULL ;
85- (void ) mca_base_framework_close (& opal_pmix_base_framework );
86- return ret ;
87- }
88- /* initialize the selected module */
89- if (OPAL_SUCCESS != (ret = opal_pmix .init ())) {
90- /* cannot run */
91- * priority = -1 ;
92- * module = NULL ;
93- (void ) mca_base_framework_close (& opal_pmix_base_framework );
94- return ret ;
74+ if (NULL == opal_pmix .initialized ) {
75+ /* open and setup pmix */
76+ if (OPAL_SUCCESS != (ret = mca_base_framework_open (& opal_pmix_base_framework , 0 ))) {
77+ ORTE_ERROR_LOG (ret );
78+ * priority = -1 ;
79+ * module = NULL ;
80+ return ret ;
81+ }
82+ if (OPAL_SUCCESS != (ret = opal_pmix_base_select ())) {
83+ /* don't error log this as it might not be an error at all */
84+ * priority = -1 ;
85+ * module = NULL ;
86+ (void ) mca_base_framework_close (& opal_pmix_base_framework );
87+ return ret ;
88+ }
9589 }
96- if (!opal_pmix .initialized ()) {
97- /* we may have everything setup, but we are not
98- * in a PMIx environment and so we need to disqualify
99- * ourselves - we are likely a singleton and will
100- * pick things up from there */
90+ if (!opal_pmix .initialized () && (OPAL_SUCCESS != (ret = opal_pmix .init ()))) {
91+ /* we cannot be in a PMI environment */
10192 * priority = -1 ;
10293 * module = NULL ;
10394 return ORTE_ERROR ;
0 commit comments