Skip to content

Commit 4e34bf0

Browse files
committed
Avoid atomic compare-and-swap on an unaligned address.
Signed-off-by: Austen Lauria <[email protected]>
1 parent c9b8580 commit 4e34bf0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,12 @@ int ompi_osc_rdma_compare_and_swap (const void *origin_addr, const void *compare
845845
* user has indicated that they will only use the same op (or same op and no op) for
846846
* operations on overlapping memory ranges. that indicates it is safe to go ahead and
847847
* use network atomic operations. */
848-
ret = ompi_osc_rdma_cas_atomic (sync, origin_addr, compare_addr, result_addr, dt,
849-
peer, target_address, target_handle, lock_acquired);
850-
if (OMPI_SUCCESS == ret) {
851-
return OMPI_SUCCESS;
848+
if(ompi_osc_base_is_atomic_size_supported(target_address, dt->super.size)) {
849+
ret = ompi_osc_rdma_cas_atomic (sync, origin_addr, compare_addr, result_addr, dt,
850+
peer, target_address, target_handle, lock_acquired);
851+
if (OMPI_SUCCESS == ret) {
852+
return OMPI_SUCCESS;
853+
}
852854
}
853855
}
854856

0 commit comments

Comments
 (0)