Skip to content

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 [email protected]

@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...?)

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 <[email protected]>
@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.

@hppritcha
Copy link
Member

@ggouaillardet can this PR be closed?

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.

4 participants