@@ -121,6 +121,7 @@ static void lookup_cbfunc(int status, opal_list_t *data, void *cbdata)
121121static void opcbfunc (int status , void * cbdata )
122122{
123123 struct lookup_caddy_t * cd = (struct lookup_caddy_t * )cbdata ;
124+ cd -> status = status ;
124125 cd -> active = false;
125126}
126127
@@ -155,27 +156,29 @@ int opal_pmix_base_exchange(opal_value_t *indat,
155156 return rc ;
156157 }
157158 } else {
158- caddy .active = true;
159- rc = opal_pmix .publish_nb (& ilist , opcbfunc , & caddy );
160- if (OPAL_SUCCESS != rc ) {
161- OPAL_ERROR_LOG (rc );
162- OPAL_LIST_DESTRUCT (& ilist );
163- return rc ;
164- }
165- while (caddy .active ) {
166- usleep (10 );
167- }
168- OPAL_LIST_DESTRUCT (& ilist );
169- if (OPAL_SUCCESS != caddy .status ) {
170- OPAL_ERROR_LOG (caddy .status );
171- return caddy .status ;
172- }
173- }
174-
175- /* lookup the other side's info - if a non-blocking form
176- * of lookup isn't available, then we use the blocking
177- * form and trust that the underlying system will WAIT
178- * until the other side publishes its data */
159+ caddy .status = -1 ;
160+ caddy .active = true;
161+ caddy .pdat = NULL ;
162+ rc = opal_pmix .publish_nb (& ilist , opcbfunc , & caddy );
163+ if (OPAL_SUCCESS != rc ) {
164+ OPAL_ERROR_LOG (rc );
165+ OPAL_LIST_DESTRUCT (& ilist );
166+ return rc ;
167+ }
168+ while (caddy .active ) {
169+ usleep (10 );
170+ }
171+ OPAL_LIST_DESTRUCT (& ilist );
172+ if (OPAL_SUCCESS != caddy .status ) {
173+ OPAL_ERROR_LOG (caddy .status );
174+ return caddy .status ;
175+ }
176+ }
177+
178+ /* lookup the other side's info - if a non-blocking form
179+ * of lookup isn't available, then we use the blocking
180+ * form and trust that the underlying system will WAIT
181+ * until the other side publishes its data */
179182 pdat = OBJ_NEW (opal_pmix_pdata_t );
180183 pdat -> value .key = strdup (outdat -> value .key );
181184 pdat -> value .type = outdat -> value .type ;
@@ -214,6 +217,7 @@ int opal_pmix_base_exchange(opal_value_t *indat,
214217 return rc ;
215218 }
216219 } else {
220+ caddy .status = -1 ;
217221 caddy .active = true;
218222 caddy .pdat = pdat ;
219223 keys = NULL ;
0 commit comments