1
1

RDMA osc: perform CAS in shared memory if possible

Signed-off-by: Joseph Schuchart <schuchart@hlrs.de>
Этот коммит содержится в:
Joseph Schuchart 2019-10-28 11:24:16 +01:00
родитель ecd990a67c
Коммит 02dd877d8a

Просмотреть файл

@ -812,7 +812,16 @@ int ompi_osc_rdma_compare_and_swap (const void *origin_addr, const void *compare
lock_acquired = true;
}
/* either we have and exclusive lock (via MPI_Win_lock() or the accumulate lock) or the
/* operate in (shared) memory if there is only a single node
* OR if we have an exclusive lock
* OR if other processes won't try to use the network either */
bool use_shared_mem = module->single_node ||
(ompi_osc_rdma_peer_local_base (peer) &&
(ompi_osc_rdma_peer_is_exclusive (peer) ||
!module->acc_single_intrinsic));
if (!use_shared_mem) {
/* either we have an exclusive lock (via MPI_Win_lock() or the accumulate lock) or the
* user has indicated that they will only use the same op (or same op and no op) for
* operations on overlapping memory ranges. that indicates it is safe to go ahead and
* use network atomic operations. */
@ -821,6 +830,7 @@ int ompi_osc_rdma_compare_and_swap (const void *origin_addr, const void *compare
if (OMPI_SUCCESS == ret) {
return OMPI_SUCCESS;
}
}
if (!(lock_acquired || ompi_osc_rdma_peer_is_exclusive (peer))) {
(void) ompi_osc_rdma_lock_acquire_exclusive (module, peer, offsetof (ompi_osc_rdma_state_t, accumulate_lock));