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

atomics: add the --disable-cx16-atomics #9023

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ggouaillardet
Copy link
Contributor

Do not try the -mcx16 flag if --disable-cx16-atomics is used,
and prevent the generation of instructions that are not available
on all x86 platforms (such as Celeron N4000).

Always try to run a simple test to make sure the selected atomic
generate correct results.

Thanks Orion Poplawski for reporting this issue.

Refs. #9022

Signed-off-by: Gilles Gouaillardet gilles@rist.or.jp

@jsquyres
Copy link
Member

jsquyres commented Jun 1, 2021

@bwbarrett This PR uses AC_RUN_IFELSE, which has the obvious cross-compliation complications. Do we still support cross-compliation? (I know we used to at one point -- i.e., we avoided using AC_TRY_RUN / AC_RUN_IFELSE, and/or provided some kind of trapdoor for those things if you were cross compiling...?)

config/opal_config_asm.m4 Outdated Show resolved Hide resolved
Do not try the -mcx16 flag if --disable-cx16-atomics is used,
and prevent the generation of instructions that are not available
on all x86 platforms (such as Celeron N4000).

Always try to run a simple test to make sure the selected atomic
generate correct results.

Thanks Orion Poplawski for reporting this issue.

Refs. open-mpi#9022

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
@ggouaillardet
Copy link
Contributor Author

@bwbarrett Currently, OPAL_ASM_CHECK_ATOMIC_FUNC() in used to test

  • __sync_bool_compare_and_swap()
  • __atomic_compare_exchange_n()
  • atomic_compare_exchange_strong_16()
  • cmpxchg16b()

Not only it checks if a given subroutine is usable, but it also gathers the need for -mcx16 and -latomic flags

It is pretty trivial to cache the availability of a given subroutine, but I do not have any elegant idea on how to handle the flags.
My best bet would be to only cache the availability of the subroutine, and let the user explicitly pass the required flags on the configure command line (e.g. ompi_cv_atomic___sync_bool_compare_and_sway=yes ... configure ... CFLAGS=-mcx16 LIBS=-latomic)

Does that sound good enough?

@bwbarrett
Copy link
Member

Yeah, that's what we do with the Fortran interface, where there's no way to figure out the answer without running a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants