Skip to content

Commit 5a55e69

Browse files
author
valentin petrov
authored
Merge pull request #6599 from vspetrov/osc_ucx_no_op_null_addr_handling
OSC/UCX: correctly handle NULL origin addr and MPI_NO_OP
2 parents 63cb6b2 + 30970bd commit 5a55e69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/mca/osc/ucx/osc_ucx_comm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ int ompi_osc_ucx_fetch_and_op(const void *origin_addr, void *result_addr,
603603
if (op == &ompi_mpi_op_no_op.op || op == &ompi_mpi_op_replace.op ||
604604
op == &ompi_mpi_op_sum.op) {
605605
uint64_t remote_addr = (module->addrs[target]) + target_disp * OSC_UCX_GET_DISP(module, target);
606-
uint64_t value = *(uint64_t *)origin_addr;
606+
uint64_t value = origin_addr ? *(uint64_t *)origin_addr : 0;
607607
ucp_atomic_fetch_op_t opcode;
608608
size_t dt_bytes;
609609

@@ -631,7 +631,7 @@ int ompi_osc_ucx_fetch_and_op(const void *origin_addr, void *result_addr,
631631
}
632632

633633
ret = opal_common_ucx_wpmem_fetch(module->mem, opcode, value, target,
634-
(void *)origin_addr, dt_bytes, remote_addr);
634+
(void *)result_addr, dt_bytes, remote_addr);
635635
if (ret != OMPI_SUCCESS) {
636636
return ret;
637637
}

0 commit comments

Comments
 (0)