Skip to content

Commit d888b4f

Browse files
committed
UCX osc: correctly handle MPI_NO_OP
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent 7cfc0e7 commit d888b4f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

ompi/mca/osc/ucx/osc_ucx_comm.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,14 @@ static int do_atomic_op_replace_sum(
358358
}
359359

360360
ucp_atomic_fetch_op_t opcode;
361+
bool is_no_op = false;
361362
if (op == &ompi_mpi_op_replace.op) {
362363
opcode = UCP_ATOMIC_FETCH_OP_SWAP;
363364
} else {
364365
opcode = UCP_ATOMIC_FETCH_OP_FADD;
366+
if (op == &ompi_mpi_op_no_op.op) {
367+
is_no_op = true;
368+
}
365369
}
366370

367371
opal_common_ucx_user_req_handler_t user_req_cb = NULL;
@@ -381,7 +385,11 @@ static int do_atomic_op_replace_sum(
381385
}
382386
}
383387
}
384-
memcpy(&value, origin_addr, origin_dt_bytes);
388+
if (is_no_op) {
389+
value = 0;
390+
} else {
391+
memcpy(&value, origin_addr, origin_dt_bytes);
392+
}
385393
ret = opal_common_ucx_wpmem_fetch_nb(module->mem, opcode, value, target,
386394
result_addr ? result_addr : &(module->req_result),
387395
origin_dt_bytes, remote_addr, user_req_cb, user_req_ptr);
@@ -507,7 +515,9 @@ int do_atomic_op(
507515
{
508516
int ret;
509517

510-
if (op == &ompi_mpi_op_replace.op || op == &ompi_mpi_op_sum.op) {
518+
if (op == &ompi_mpi_op_replace.op ||
519+
op == &ompi_mpi_op_sum.op ||
520+
op == &ompi_mpi_op_no_op.op) {
511521
ret = do_atomic_op_replace_sum(module, op, target,
512522
origin_addr, origin_count, origin_dt,
513523
target_disp, target_count, target_dt,

0 commit comments

Comments
 (0)