Skip to content

Commit 862846b

Browse files
committed
Review: return types and wrong variables
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent a3b1650 commit 862846b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ompi/mca/osc/ucx/osc_ucx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ int ompi_osc_ucx_dynamic_lock(ompi_osc_ucx_module_t *module, int target);
277277
int ompi_osc_ucx_dynamic_unlock(ompi_osc_ucx_module_t *module, int target);
278278

279279
/* returns the size at the peer */
280-
static inline int ompi_osc_ucx_get_size(ompi_osc_ucx_module_t *module, int rank)
280+
static inline size_t ompi_osc_ucx_get_size(ompi_osc_ucx_module_t *module, int rank)
281281
{
282282
if (module->sizes) {
283283
return module->sizes[rank];
@@ -287,7 +287,7 @@ static inline int ompi_osc_ucx_get_size(ompi_osc_ucx_module_t *module, int rank)
287287
}
288288

289289
/* returns the displacement unit for the given peer */
290-
static inline int ompi_osc_ucx_get_disp_unit(ompi_osc_ucx_module_t *module, int rank)
290+
static inline ptrdiff_t ompi_osc_ucx_get_disp_unit(ompi_osc_ucx_module_t *module, int rank)
291291
{
292292
if (module->disp_units) {
293293
return module->disp_units[rank];

ompi/mca/osc/ucx/osc_ucx_component.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,10 @@ int ompi_osc_ucx_shared_query(struct ompi_win_t *win, int rank, size_t *size,
526526
} else { // shared memory window with MPI_PROC_NULL
527527
for (int i = 0 ; i < ompi_comm_size(module->comm) ; ++i) {
528528
size_t peer_size = ompi_osc_ucx_get_size(module, i);
529-
if (0 != size) {
529+
if (0 != peer_size) {
530530
*size = peer_size;
531531
*((void**) baseptr) = (void *)module->shmem_addrs[i];
532-
*disp_unit = ompi_osc_ucx_get_disp_unit(module, rank);
532+
*disp_unit = ompi_osc_ucx_get_disp_unit(module, i);
533533
break;
534534
}
535535
}
@@ -777,7 +777,7 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, pt
777777
if (flavor == MPI_WIN_FLAVOR_SHARED) {
778778
/* create the segment */
779779

780-
unsigned long total = 0;
780+
size_t total = 0;
781781
for (i = 0 ; i < comm_size ; ++i) {
782782
total += ompi_osc_ucx_get_size(module, i);
783783
}

0 commit comments

Comments
 (0)