Skip to content

Commit 3687ce0

Browse files
committed
osc/ucx: Fix return values and exchange of disp_unit/sizes
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent d25ca1d commit 3687ce0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ompi/mca/osc/ucx/osc_ucx_component.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,11 @@ static int ompi_osc_ucx_shared_query_peer(ompi_osc_ucx_module_t *module, int pee
479479
opal_common_ucx_winfo_t *winfo; // ignored
480480
rc = opal_common_ucx_tlocal_fetch(module->mem, peer, &ep, &rkey, &winfo, dflt_ep);
481481
if (OMPI_SUCCESS != rc) {
482-
return rc;
482+
return OMPI_ERR_NOT_SUPPORTED;
483483
}
484484
void *addr_p;
485485
if (UCS_OK != ucp_rkey_ptr(rkey, module->addrs[peer], &addr_p)) {
486-
return OMPI_ERR_NOT_AVAILABLE;
486+
return OMPI_ERR_NOT_SUPPORTED;
487487
}
488488
*size = ompi_osc_ucx_get_size(module, peer);
489489
*((void**) baseptr) = addr_p;
@@ -719,18 +719,21 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, pt
719719
if (same_disp_unit) { /* everyone has the same disp_unit, we do not need O(p) space */
720720
module->disp_unit = disp_unit;
721721
module->disp_units = NULL;
722+
} else {
722723
values[val_count++] = disp_unit;
723724
}
724725

725726
if (same_size) {
726727
module->same_size = true;
727728
module->sizes = NULL;
729+
} else {
728730
values[val_count++] = size;
729731
}
730732

731733
if (!same_disp_unit || !same_size) {
734+
long* peer_values = malloc(comm_size * val_count * sizeof(long));
732735
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,
734737
module->comm,
735738
module->comm->c_coll->coll_allgather_module);
736739
if (OMPI_SUCCESS != ret) {
@@ -745,7 +748,7 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, pt
745748
goto error;
746749
}
747750
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];
749752
}
750753
}
751754

@@ -758,9 +761,10 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, pt
758761
}
759762

760763
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];
762765
}
763766
}
767+
free(peer_values);
764768
}
765769

766770
ret = opal_common_ucx_wpctx_create(mca_osc_ucx_component.wpool, comm_size,

0 commit comments

Comments
 (0)