@@ -50,6 +50,18 @@ extern opal_pmix_server_module_t *host_module;
5050static char * dbgvalue = NULL ;
5151static int errhdler_ref = 0 ;
5252
53+ static void completion_handler (void * cbdata ) {
54+ int * cond = (int * )cbdata ;
55+ * cond = 0 ;
56+ }
57+
58+ #define PMIX_WAIT_FOR_COMPLETION (a ) \
59+ do { \
60+ while ((a)) { \
61+ usleep(10); \
62+ } \
63+ } while (0);
64+
5365static void myerr (pmix_status_t status ,
5466 pmix_proc_t procs [], size_t nprocs ,
5567 pmix_info_t info [], size_t ninfo )
@@ -58,6 +70,7 @@ static void myerr(pmix_status_t status,
5870 opal_list_t plist , ilist ;
5971 opal_namelist_t * nm ;
6072 opal_value_t * iptr ;
73+ volatile int cond = 1 ;
6174 size_t n ;
6275
6376 /* convert the incoming status */
@@ -78,11 +91,13 @@ static void myerr(pmix_status_t status,
7891 iptr = OBJ_NEW (opal_value_t );
7992 iptr -> key = strdup (info [n ].key );
8093 pmix1_value_unload (iptr , & info [n ].value );
81- opal_list_append (& plist , & nm -> super );
94+ opal_list_append (& plist , & iptr -> super );
8295 }
8396
8497 /* call the base errhandler */
85- opal_pmix_base_errhandler (rc , & plist , & ilist );
98+ opal_pmix_base_errhandler (rc , & plist , & ilist , completion_handler , (void * )& cond );
99+ PMIX_WAIT_FOR_COMPLETION (cond );
100+
86101 OPAL_LIST_DESTRUCT (& plist );
87102 OPAL_LIST_DESTRUCT (& ilist );
88103}
0 commit comments