@@ -465,12 +465,14 @@ static const char* ompi_osc_ucx_set_no_lock_info(opal_infosubscriber_t *obj, con
465
465
return module -> no_locks ? "true" : "false" ;
466
466
}
467
467
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 ,
469
469
ptrdiff_t * disp_unit , void * baseptr ) {
470
470
471
+ int rc ;
471
472
ucp_ep_h * dflt_ep ;
472
473
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 );
474
476
ucs_status_t status ;
475
477
opal_common_ucx_winfo_t * winfo ; // ignored
476
478
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
482
484
if (UCS_OK != ucp_rkey_ptr (rkey , module -> addrs [peer ], & addr_p )) {
483
485
return OMPI_ERR_NOT_AVAILABLE ;
484
486
}
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 ];
488
490
489
491
return OMPI_SUCCESS ;
490
492
}
@@ -510,10 +512,8 @@ int ompi_osc_ucx_shared_query(struct ompi_win_t *win, int rank, size_t *size,
510
512
}
511
513
}
512
514
} 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 );
517
517
}
518
518
}
519
519
return OMPI_ERR_NOT_SUPPORTED ;
0 commit comments