@@ -358,10 +358,14 @@ static int do_atomic_op_replace_sum(
358
358
}
359
359
360
360
ucp_atomic_fetch_op_t opcode ;
361
+ bool is_no_op = false;
361
362
if (op == & ompi_mpi_op_replace .op ) {
362
363
opcode = UCP_ATOMIC_FETCH_OP_SWAP ;
363
364
} else {
364
365
opcode = UCP_ATOMIC_FETCH_OP_FADD ;
366
+ if (op == & ompi_mpi_op_no_op .op ) {
367
+ is_no_op = true;
368
+ }
365
369
}
366
370
367
371
opal_common_ucx_user_req_handler_t user_req_cb = NULL ;
@@ -381,7 +385,11 @@ static int do_atomic_op_replace_sum(
381
385
}
382
386
}
383
387
}
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
+ }
385
393
ret = opal_common_ucx_wpmem_fetch_nb (module -> mem , opcode , value , target ,
386
394
result_addr ? result_addr : & (module -> req_result ),
387
395
origin_dt_bytes , remote_addr , user_req_cb , user_req_ptr );
@@ -507,7 +515,9 @@ int do_atomic_op(
507
515
{
508
516
int ret ;
509
517
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 ) {
511
521
ret = do_atomic_op_replace_sum (module , op , target ,
512
522
origin_addr , origin_count , origin_dt ,
513
523
target_disp , target_count , target_dt ,
0 commit comments