Skip to content

Need a way to disable use of -mcx16 compile flag #9022

Open
@opoplawski

Description

@opoplawski

Background information

What version of Open MPI are you using? (e.g., v3.0.5, v4.0.2, git branch name and hash, etc.)

4.1.1

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

This is regarding build the Fedora openmpi package

Details of the problem

From https://bugzilla.redhat.com/show_bug.cgi?id=1965692:

I recently acquired a cheap wintel toy tablet/laptop (a Kano PC), which has a
Celeron N4000 processor. I tried running HPL benchmarks on it to figure out how
fast the thing is. However, xhpl_openmpi crashed with an illegal instruction. I
then installed the MPICH version of HPL, and xhpl_mpich runs fine. The issue is
thus in OpenMPI.

Looking at the build logs of openmpi-4.1.0-5.fc34.x86_64, I see that it has
been compiled with the -mcx16 flag detected by configure. According to the GCC
man page

       This option enables GCC to generate "CMPXCHG16B" instructions in
       64-bit code to implement compare-and-exchange operations on 16-byte
       aligned 128-bit objects.  This is useful for atomic updates of data
       structures exceeding one machine word in size.  The compiler uses
       this instruction to implement __sync Builtins.  However, for
       __atomic Builtins operating on 128-bit integers, a library call is
       always used.

However, because the instruction is not available on all x86_64 processors, the
use of the flag should be disabled in OpenMPI.

However, I see no easy way to do this in configure, especially since I think we may need to fallback to using -latomic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions