Enhance cmake and releng handling of GMX_USE_RDTSCP
commit935e84030fc70ddb5e01959073a8990c986deba0
authorMark Abraham <mark.j.abraham@gmail.com>
Sun, 2 Jul 2017 23:22:17 +0000 (3 01:22 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 27 Jul 2017 19:41:34 +0000 (27 21:41 +0200)
tree4cebc6e1bdf4ea5e0fc00dbdd5b58ce5c5a2c932
parent75e7a98b19aa22029a8cfb40d2611c1d97e05551
Enhance cmake and releng handling of GMX_USE_RDTSCP

It is possible for a physical or virtual CPU to support avx and not
rdtscp, or the other way around, so the previous workaround was always
a bit hacky.

This change refactors the implementation to preserve the existing
behaviour of both explicitly setting GMX_USE_RDTSCP to be ON or OFF,
and the default behaviour of relying on the rdtscp detection, unless
we should make a guess associated with an explicit user choice of SIMD
level.

It adds GMX_USE_RDTSCP=DETECT, which is now useful in Jenkins, where a
hypervisor does expose AVX instructions and not RDTSCP, so the above
fallback is not very effective for (e.g.) matrix configurations where
we specify the SIMD level. Various jobs now use either OFF or DETECT
according to the intent of the job. This will be useful in migrating
verification jobs between hosts without having hidden
incompatibilities.

Switched usage of HAVE_RDTSCP to be always defined, for better
checking by the compiler for any errors made.

Improved status messages when the setting changes, and why, if it
depends on the detection result.

Change-Id: I932c1764d91ec317475ef71400802e7b8d07c887
CMakeLists.txt
admin/builds/clang-analyzer.py
admin/builds/coverage.py
admin/builds/cppcheck.py
admin/builds/documentation.py
admin/builds/gromacs.py
admin/builds/source-package.py
src/config.h.cmakein
src/gromacs/hardware/detecthardware.cpp
src/gromacs/timing/cyclecounter.h
src/gromacs/utility/binaryinformation.cpp