Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling put_scalar when disable-ofi-inject is used #1110

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading