@@ -465,12 +465,14 @@ static const char* ompi_osc_ucx_set_no_lock_info(opal_infosubscriber_t *obj, con
465465 return module -> no_locks ? "true" : "false" ;
466466}
467467
468- static int ompi_osc_ucx_shared_query_peer (ompi_osc_ucx_module_t * module , int rank , size_t * size ,
468+ static int ompi_osc_ucx_shared_query_peer (ompi_osc_ucx_module_t * module , int peer , size_t * size ,
469469 ptrdiff_t * disp_unit , void * baseptr ) {
470470
471+ int rc ;
471472 ucp_ep_h * dflt_ep ;
472473 ucp_ep_h ep ; // ignored
473- OSC_UCX_GET_DEFAULT_EP (dflt_ep , module , peer ); // TODO: needed?
474+ ucp_rkey_h rkey ;
475+ OSC_UCX_GET_DEFAULT_EP (dflt_ep , module , peer );
474476 ucs_status_t status ;
475477 opal_common_ucx_winfo_t * winfo ; // ignored
476478 rc = opal_common_ucx_tlocal_fetch (module -> mem , peer , & ep , & rkey , & winfo , dflt_ep );
@@ -482,9 +484,9 @@ static int ompi_osc_ucx_shared_query_peer(ompi_osc_ucx_module_t *module, int ran
482484 if (UCS_OK != ucp_rkey_ptr (rkey , module -> addrs [peer ], & addr_p )) {
483485 return OMPI_ERR_NOT_AVAILABLE ;
484486 }
485- * size = module -> sizes [i ];
486- * ((void * * ) baseptr ) = (void * )module -> shmem_addrs [i ];
487- * disp_unit = module -> disp_units [i ];
487+ * size = module -> sizes [peer ];
488+ * ((void * * ) baseptr ) = (void * )module -> shmem_addrs [peer ];
489+ * disp_unit = module -> disp_units [peer ];
488490
489491 return OMPI_SUCCESS ;
490492}
@@ -510,10 +512,8 @@ int ompi_osc_ucx_shared_query(struct ompi_win_t *win, int rank, size_t *size,
510512 }
511513 }
512514 } else {
513- if (0 != module -> sizes [i ]) {
514- if (OMPI_SUCCESS == ompi_osc_ucx_shared_query_peer (module , i , size , disp_unit , baseptr )) {
515- return OMPI_SUCCESS ;
516- }
515+ if (0 != module -> sizes [rank ]) {
516+ return ompi_osc_ucx_shared_query_peer (module , rank , size , disp_unit , baseptr );
517517 }
518518 }
519519 return OMPI_ERR_NOT_SUPPORTED ;
0 commit comments