diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17e21f7f..3bb942ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }}) diff --git a/src/shmem_comm.h b/src/shmem_comm.h index 8624f653..f10c6b0d 100644 --- a/src/shmem_comm.h +++ b/src/shmem_comm.h @@ -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 } } @@ -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)