Skip to content

Commit

Permalink
Merge pull request #1110 from wrrobin/pr/iput-iget-fix
Browse files Browse the repository at this point in the history
Disabling put_scalar when disable-ofi-inject is used
  • Loading branch information
wrrobin authored Feb 16, 2024
2 parents 12cd72b + d1ff333 commit 7dd4488
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ jobs:
- config_name: Manpages
sos_config: --enable-manpages --enable-pmi-simple
libfabric_version: v1.13.x
- config_name: Without OFI inject
sos_config: --disable-ofi-inject --enable-pmi-simple
libfabric_version: v1.13.x

name: OFI ${{ matrix.libfabric_version }} (${{ matrix.config_name }})

Expand Down
44 changes: 25 additions & 19 deletions src/shmem_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,45 @@

static inline
void
shmem_internal_put_scalar(shmem_ctx_t ctx, void *target, const void *source, size_t len, int pe)
shmem_internal_put_nb(shmem_ctx_t ctx, void *target, const void *source, size_t len, int pe,
long *completion)
{
shmem_internal_assert(len > 0);
if (len == 0)
return;

if (shmem_shr_transport_use_write(ctx, target, source, len, pe)) {
shmem_shr_transport_put_scalar(ctx, target, source, len, pe);
shmem_shr_transport_put(ctx, target, source, len, pe);
} else {
shmem_transport_put_scalar((shmem_transport_ctx_t *)ctx, target, source, len, pe);
shmem_transport_put_nb((shmem_transport_ctx_t *)ctx, target, source, len, pe, completion);
}
}


static inline
void
shmem_internal_put_nb(shmem_ctx_t ctx, void *target, const void *source, size_t len, int pe,
long *completion)
shmem_internal_put_wait(shmem_ctx_t ctx, long *completion)
{
if (len == 0)
return;
shmem_transport_put_wait((shmem_transport_ctx_t *)ctx, completion);
/* on-node is always blocking, so this is a no-op for them */
}


static inline
void
shmem_internal_put_scalar(shmem_ctx_t ctx, void *target, const void *source, size_t len, int pe)
{
shmem_internal_assert(len > 0);

if (shmem_shr_transport_use_write(ctx, target, source, len, pe)) {
shmem_shr_transport_put(ctx, target, source, len, pe);
shmem_shr_transport_put_scalar(ctx, target, source, len, pe);
} else {
shmem_transport_put_nb((shmem_transport_ctx_t *)ctx, target, source, len, pe, completion);
#ifndef DISABLE_OFI_INJECT
shmem_transport_put_scalar((shmem_transport_ctx_t *)ctx, target, source, len, pe);
#else
long completion = 0;
shmem_transport_put_nb((shmem_transport_ctx_t *)ctx, target, source, len, pe, &completion);
shmem_internal_put_wait(ctx, &completion);
#endif
}
}

Expand Down Expand Up @@ -106,15 +121,6 @@ shmem_internal_put_ct_nb(shmemx_ct_t ct, void *target, const void *source, size_
}


static inline
void
shmem_internal_put_wait(shmem_ctx_t ctx, long *completion)
{
shmem_transport_put_wait((shmem_transport_ctx_t *)ctx, completion);
/* on-node is always blocking, so this is a no-op for them */
}


static inline
void
shmem_internal_get(shmem_ctx_t ctx, void *target, const void *source, size_t len, int pe)
Expand Down

0 comments on commit 7dd4488

Please sign in to comment.