Skip to content

Commit

Permalink
Disable atomic inject
Browse files Browse the repository at this point in the history
  • Loading branch information
wrrobin committed May 6, 2024
1 parent 7857a35 commit d4c7b60
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/shmem_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,17 @@ shmem_internal_put_signal_nbi(shmem_ctx_t ctx, void *target, const void *source,
uint64_t *sig_addr, uint64_t signal, int sig_op, int pe)
{
if (len == 0) {
if (sig_op == SHMEM_SIGNAL_ADD)
if (sig_op == SHMEM_SIGNAL_ADD) {
#ifndef DISABLE_OFI_INJECT
shmem_transport_atomic((shmem_transport_ctx_t *) ctx, sig_addr, &signal, sizeof(uint64_t),
pe, SHM_INTERNAL_SUM, SHM_INTERNAL_UINT64);
#else
long completion = 0;
shmem_transport_atomicv((shmem_transport_ctx_t *) ctx, sig_addr, &signal, sizeof(uint64_t),
pe, SHM_INTERNAL_SUM, SHM_INTERNAL_UINT64, &completion);
shmem_internal_put_wait(ctx, &completion);
#endif
}
else
shmem_transport_atomic_set((shmem_transport_ctx_t *) ctx, sig_addr, &signal,
sizeof(uint64_t), pe, SHM_INTERNAL_UINT64);
Expand Down Expand Up @@ -244,8 +252,15 @@ shmem_internal_atomic(shmem_ctx_t ctx, void *target, const void *source, size_t
if (shmem_shr_transport_use_atomic(ctx, target, len, pe, datatype)) {
shmem_shr_transport_atomic(ctx, target, source, len, pe, op, datatype);
} else {
#ifndef DISABLE_OFI_INJECT
shmem_transport_atomic((shmem_transport_ctx_t *)ctx, target, source,
len, pe, op, datatype);
#else
long completion = 0;
shmem_transport_atomicv((shmem_transport_ctx_t *)ctx, target, source,
len, pe, op, datatype, &completion);
shmem_internal_put_wait(ctx, &completion);
#endif
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/transport_ofi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1335,8 +1335,15 @@ void shmem_transport_atomic_set(shmem_transport_ctx_t* ctx, void *target,
const void *source, size_t len, int pe,
int datatype)
{
#ifndef DISABLE_OFI_INJECT
shmem_transport_atomic(ctx, target, source, len, pe, FI_ATOMIC_WRITE,
datatype);
#else
long completion = 0;
shmem_transport_atomicv(ctx, target, source, len, pe, FI_ATOMIC_WRITE,
datatype, &completion);
shmem_transport_put_wait(ctx, &completion);
#endif
}


Expand Down

0 comments on commit d4c7b60

Please sign in to comment.