@@ -479,11 +479,11 @@ static int ompi_osc_ucx_shared_query_peer(ompi_osc_ucx_module_t *module, int pee
479
479
opal_common_ucx_winfo_t * winfo ; // ignored
480
480
rc = opal_common_ucx_tlocal_fetch (module -> mem , peer , & ep , & rkey , & winfo , dflt_ep );
481
481
if (OMPI_SUCCESS != rc ) {
482
- return rc ;
482
+ return OMPI_ERR_NOT_SUPPORTED ;
483
483
}
484
484
void * addr_p ;
485
485
if (UCS_OK != ucp_rkey_ptr (rkey , module -> addrs [peer ], & addr_p )) {
486
- return OMPI_ERR_NOT_AVAILABLE ;
486
+ return OMPI_ERR_NOT_SUPPORTED ;
487
487
}
488
488
* size = ompi_osc_ucx_get_size (module , peer );
489
489
* ((void * * ) baseptr ) = addr_p ;
@@ -719,18 +719,21 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, pt
719
719
if (same_disp_unit ) { /* everyone has the same disp_unit, we do not need O(p) space */
720
720
module -> disp_unit = disp_unit ;
721
721
module -> disp_units = NULL ;
722
+ } else {
722
723
values [val_count ++ ] = disp_unit ;
723
724
}
724
725
725
726
if (same_size ) {
726
727
module -> same_size = true;
727
728
module -> sizes = NULL ;
729
+ } else {
728
730
values [val_count ++ ] = size ;
729
731
}
730
732
731
733
if (!same_disp_unit || !same_size ) {
734
+ long * peer_values = malloc (comm_size * val_count * sizeof (long ));
732
735
ret = module -> comm -> c_coll -> coll_allgather (values , val_count * sizeof (long ), MPI_BYTE ,
733
- ( void * ) my_info , sizeof (long ) * val_count , MPI_BYTE ,
736
+ peer_values , sizeof (long ) * val_count , MPI_BYTE ,
734
737
module -> comm ,
735
738
module -> comm -> c_coll -> coll_allgather_module );
736
739
if (OMPI_SUCCESS != ret ) {
@@ -745,7 +748,7 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, pt
745
748
goto error ;
746
749
}
747
750
for (i = 0 ; i < comm_size ; i ++ ) {
748
- module -> disp_units [i ] = (ptrdiff_t )values [i * val_count ];
751
+ module -> disp_units [i ] = (ptrdiff_t )peer_values [i * val_count ];
749
752
}
750
753
}
751
754
@@ -758,9 +761,10 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, pt
758
761
}
759
762
760
763
for (i = 0 ; i < comm_size ; i ++ ) {
761
- module -> sizes [i ] = (size_t )values [ i * val_count + val_count - 1 ];
764
+ module -> sizes [i ] = (size_t )peer_values [( i + 1 ) * val_count - 1 ];
762
765
}
763
766
}
767
+ free (peer_values );
764
768
}
765
769
766
770
ret = opal_common_ucx_wpctx_create (mca_osc_ucx_component .wpool , comm_size ,
0 commit comments