@@ -297,7 +297,6 @@ pmix_status_t pmix_server_get(pmix_buffer_t *buf,
297
297
cbfunc (PMIX_ERR_NOT_FOUND , NULL , 0 , cbdata , NULL , NULL );
298
298
PMIX_INFO_FREE (info , ninfo );
299
299
pmix_list_remove_item (& pmix_server_globals .local_reqs , & lcd -> super );
300
- PMIX_LIST_DESTRUCT (& lcd -> loc_reqs );
301
300
PMIX_RELEASE (lcd );
302
301
rc = PMIX_ERR_NOT_FOUND ;
303
302
}
@@ -542,46 +541,51 @@ static pmix_status_t _satisfy_request(pmix_nspace_t *nptr, pmix_rank_t rank,
542
541
pmix_status_t pmix_pending_resolve (pmix_nspace_t * nptr , pmix_rank_t rank ,
543
542
pmix_status_t status , pmix_dmdx_local_t * lcd )
544
543
{
545
- pmix_dmdx_local_t * cd ;
544
+ pmix_dmdx_local_t * cd , * ptr ;
545
+ pmix_dmdx_request_t * req ;
546
546
547
547
/* find corresponding request (if exists) */
548
- if (NULL == lcd && NULL != nptr ) {
549
- PMIX_LIST_FOREACH (cd , & pmix_server_globals .local_reqs , pmix_dmdx_local_t ) {
550
- if (0 != strncmp (nptr -> nspace , cd -> proc .nspace , PMIX_MAX_NSLEN ) ||
551
- rank != cd -> proc .rank ) {
552
- continue ;
548
+ if (NULL == lcd ) {
549
+ ptr = NULL ;
550
+ if (NULL != nptr ) {
551
+ PMIX_LIST_FOREACH (cd , & pmix_server_globals .local_reqs , pmix_dmdx_local_t ) {
552
+ if (0 != strncmp (nptr -> nspace , cd -> proc .nspace , PMIX_MAX_NSLEN ) ||
553
+ rank != cd -> proc .rank ) {
554
+ continue ;
555
+ }
556
+ ptr = cd ;
557
+ break ;
553
558
}
554
- lcd = cd ;
555
- break ;
556
559
}
560
+ if (NULL == ptr ) {
561
+ return PMIX_SUCCESS ;
562
+ }
563
+ } else {
564
+ ptr = lcd ;
557
565
}
558
566
559
- /* If somebody was interested in this rank */
560
- if (NULL != lcd ) {
561
- pmix_dmdx_request_t * req ;
562
-
563
- if (PMIX_SUCCESS != status ){
564
- /* if we've got an error for this request - just forward it*/
565
- PMIX_LIST_FOREACH (req , & lcd -> loc_reqs , pmix_dmdx_request_t ) {
566
- /* if we can't satisfy this request - respond with error */
567
- req -> cbfunc (status , NULL , 0 , req -> cbdata , NULL , NULL );
568
- }
569
- } else if (NULL != nptr ) {
570
- /* if we've got the blob - try to satisfy requests */
571
- /* run through all the requests to this rank */
572
- PMIX_LIST_FOREACH (req , & lcd -> loc_reqs , pmix_dmdx_request_t ) {
573
- pmix_status_t rc ;
574
- rc = _satisfy_request (nptr , rank , NULL , req -> cbfunc , req -> cbdata , NULL );
575
- if ( PMIX_SUCCESS != rc ){
576
- /* if we can't satisfy this particular request (missing key?) */
577
- req -> cbfunc (rc , NULL , 0 , req -> cbdata , NULL , NULL );
578
- }
567
+ /* somebody was interested in this rank */
568
+ if (PMIX_SUCCESS != status ){
569
+ /* if we've got an error for this request - just forward it*/
570
+ PMIX_LIST_FOREACH (req , & ptr -> loc_reqs , pmix_dmdx_request_t ) {
571
+ req -> cbfunc (status , NULL , 0 , req -> cbdata , NULL , NULL );
572
+ }
573
+ } else if (NULL != nptr ) {
574
+ /* if we've got the blob - try to satisfy requests */
575
+ /* run through all the requests to this rank */
576
+ PMIX_LIST_FOREACH (req , & ptr -> loc_reqs , pmix_dmdx_request_t ) {
577
+ pmix_status_t rc ;
578
+ rc = _satisfy_request (nptr , rank , NULL , req -> cbfunc , req -> cbdata , NULL );
579
+ if ( PMIX_SUCCESS != rc ){
580
+ /* if we can't satisfy this particular request (missing key?) */
581
+ req -> cbfunc (rc , NULL , 0 , req -> cbdata , NULL , NULL );
579
582
}
580
583
}
581
- /* remove all requests to this rank and cleanup the corresponding structure */
582
- pmix_list_remove_item (& pmix_server_globals .local_reqs , (pmix_list_item_t * )lcd );
583
- PMIX_RELEASE (lcd );
584
584
}
585
+ /* remove all requests to this rank and cleanup the corresponding structure */
586
+ pmix_list_remove_item (& pmix_server_globals .local_reqs , (pmix_list_item_t * )ptr );
587
+ PMIX_RELEASE (ptr );
588
+
585
589
return PMIX_SUCCESS ;
586
590
}
587
591
0 commit comments