@@ -468,12 +468,14 @@ static const char* ompi_osc_ucx_set_no_lock_info(opal_infosubscriber_t *obj, con
468
468
return module -> no_locks ? "true" : "false" ;
469
469
}
470
470
471
- static int ompi_osc_ucx_shared_query_peer (ompi_osc_ucx_module_t * module , int rank , size_t * size ,
471
+ static int ompi_osc_ucx_shared_query_peer (ompi_osc_ucx_module_t * module , int peer , size_t * size ,
472
472
ptrdiff_t * disp_unit , void * baseptr ) {
473
473
474
+ int rc ;
474
475
ucp_ep_h * dflt_ep ;
475
476
ucp_ep_h ep ; // ignored
476
- OSC_UCX_GET_DEFAULT_EP (dflt_ep , module , peer ); // TODO: needed?
477
+ ucp_rkey_h rkey ;
478
+ OSC_UCX_GET_DEFAULT_EP (dflt_ep , module , peer );
477
479
ucs_status_t status ;
478
480
opal_common_ucx_winfo_t * winfo ; // ignored
479
481
rc = opal_common_ucx_tlocal_fetch (module -> mem , peer , & ep , & rkey , & winfo , dflt_ep );
@@ -485,9 +487,9 @@ static int ompi_osc_ucx_shared_query_peer(ompi_osc_ucx_module_t *module, int ran
485
487
if (UCS_OK != ucp_rkey_ptr (rkey , module -> addrs [peer ], & addr_p )) {
486
488
return OMPI_ERR_NOT_AVAILABLE ;
487
489
}
488
- * size = module -> sizes [i ];
489
- * ((void * * ) baseptr ) = (void * )module -> shmem_addrs [i ];
490
- * disp_unit = module -> disp_units [i ];
490
+ * size = module -> sizes [peer ];
491
+ * ((void * * ) baseptr ) = (void * )module -> shmem_addrs [peer ];
492
+ * disp_unit = module -> disp_units [peer ];
491
493
492
494
return OMPI_SUCCESS ;
493
495
}
@@ -513,10 +515,8 @@ int ompi_osc_ucx_shared_query(struct ompi_win_t *win, int rank, size_t *size,
513
515
}
514
516
}
515
517
} else {
516
- if (0 != module -> sizes [i ]) {
517
- if (OMPI_SUCCESS == ompi_osc_ucx_shared_query_peer (module , i , size , disp_unit , baseptr )) {
518
- return OMPI_SUCCESS ;
519
- }
518
+ if (0 != module -> sizes [rank ]) {
519
+ return ompi_osc_ucx_shared_query_peer (module , rank , size , disp_unit , baseptr );
520
520
}
521
521
}
522
522
return OMPI_ERR_NOT_SUPPORTED ;
0 commit comments