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

Option to disable non-fetch AMO #1131

Merged
merged 3 commits into from
Jun 5, 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 @@ -147,6 +147,9 @@ jobs:
- config_name: Without OFI inject
sos_config: --disable-ofi-inject --enable-pmi-simple
libfabric_version: v1.13.x
- config_name: Without Non-fetch AMO
sos_config: --disable-nonfetch-amo --enable-pmi-simple
libfabric_version: v1.13.x

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

Expand Down
8 changes: 7 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ AC_ARG_ENABLE([ofi-inject],
[AC_HELP_STRING([--disable-ofi-inject],
[Disable OFI inject by default (default: enabled)])])
AS_IF([test "$enable_ofi_inject" = "no"],
[AC_DEFINE([DISABLE_OFI_INJECT], [0], [If defined, the OFI will not use fi_inject.])])
[AC_DEFINE([DISABLE_OFI_INJECT], [1], [If defined, the OFI will not use fi_inject.])])

AC_ARG_ENABLE([nonfetch-amo],
[AC_HELP_STRING([--disable-nonfetch-amo],
[Disable non-fetching AMO and replace them with fetching AMO (default: enabled)])])
AS_IF([test "$enable_nonfetch_amo" = "no"],
[AC_DEFINE([DISABLE_NONFETCH_AMO], [1], [If defined, SOS will fetch values for any AMO.])])

AC_ARG_WITH([oshrun-launcher],
[AC_HELP_STRING([--with-oshrun-launcher],
Expand Down
14 changes: 14 additions & 0 deletions src/shmem_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,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 {
#ifdef DISABLE_NONFETCH_AMO
unsigned long long tmp_fetch = 0;
shmem_transport_fetch_atomic((shmem_transport_ctx_t *)ctx, target,
source, &tmp_fetch, len, pe, op, datatype);
shmem_transport_get_wait((shmem_transport_ctx_t *)ctx);
#else
shmem_transport_atomic((shmem_transport_ctx_t *)ctx, target, source,
len, pe, op, datatype);
#endif
}
}

Expand Down Expand Up @@ -276,8 +283,15 @@ shmem_internal_atomic_set(shmem_ctx_t ctx, void *target, const void *source, siz
if (shmem_shr_transport_use_atomic(ctx, target, len, pe, datatype)) {
shmem_shr_transport_atomic_set(ctx, target, source, len, pe, datatype);
} else {
#ifdef DISABLE_NONFETCH_AMO
unsigned long long tmp_fetch = 0;
shmem_transport_fetch_atomic((shmem_transport_ctx_t *)ctx, target,
source, &tmp_fetch, len, pe, FI_ATOMIC_WRITE, datatype);
shmem_transport_get_wait((shmem_transport_ctx_t *)ctx);
#else
shmem_transport_atomic_set((shmem_transport_ctx_t *)ctx, target,
source, len, pe, datatype);
#endif
}
}

Expand Down
Loading