Skip to content

Commit

Permalink
TST, CI: add ARM64 Graviton 2 to CI (#2956)
Browse files Browse the repository at this point in the history
* TST, CI: add ARM64 Graviton 2 to CI

* start testing MDAnalysis on ARM64 using
new AWS Graviton 2 architecture available
in Travis CI

* testing on my fork shows only two failures
in the MDAnalysis test suite using a fairly
minimal set of dependencies; we can probably
either fix those or skip them and open an issue

* the test failures are:
`test_written_remarks_property`
`TestEncoreClustering.test_clustering_three_ensembles_two_identical`

* run time for this CI entry is about
23 minutes, which is solid for ARM; we save a lot
of time using experimental upstream wheels in some
cases and excluding (source builds of) dependencies
where possible until the ARM64 binary wheel ecosystem
matures a bit more

* MAINT: ARM64 shims

* adjust `CAffinityPropagation()` C-level function to use `double`
instead of `float` in some strategic locations that allow the
`test_clustering_three_ensembles_two_identical()` test to pass
on gcc115 ARM64 machine

* mark `test_written_remarks_property()` as a known failure on
ARM64; it fails in Travis CI on that platform, but not on gcc115
ARM64 machine; that said, this test is already known to be flaky
on Windows 32-bit (may depend on character settings on machine?)

* MAINT: MR 2956 revisions

* reduce optimization level of MDAnalysis builds on
ARM64 to avoid problems with `ap.c` causing test failures
on that architecture

* revert any source changes to `ap.c`
  • Loading branch information
tylerjereddy authored Oct 19, 2020
1 parent beb5232 commit daee516
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,31 @@ matrix:
INSTALL_HOLE="false"
CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis"

- os: linux
language: python
arch: arm64-graviton2
python:
- "3.7"
dist: focal
virt: vm
group: edge
before_install:
- python -m pip install cython numpy
# special test SciPy wheel for ARM64:
- python -m pip install https://anaconda.org/multibuild-wheels-staging/scipy/1.6.0.dev0+a240c17/download/scipy-1.6.0.dev0+a240c17-cp37-cp37m-manylinux2014_aarch64.whl
- python -m pip install --no-build-isolation hypothesis matplotlib pytest pytest-cov pytest-xdist tqdm
install:
- cd package
- python setup.py install
- cd ../testsuite
- python setup.py install
- cd ..
script:
- cd testsuite
- python -m pytest ./MDAnalysisTests --disable-pytest-warnings -n 8 -rsx --cov=MDAnalysis
after_success:
- echo "Override this stage for ARM64"

allow_failures:
- env: NUMPY_VERSION=dev EVENT_TYPE="cron"

Expand Down
11 changes: 9 additions & 2 deletions package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,15 @@ def extensions(config):
use_cython = config.get('use_cython', default=not is_release)
use_openmp = config.get('use_openmp', default=True)

extra_compile_args = ['-std=c99', '-ffast-math', '-O3', '-funroll-loops',
'-fsigned-zeros'] # see #2722
if platform.machine() == 'aarch64':
# reduce optimization level for ARM64 machines
# because of issues with test failures sourcing to:
# MDAnalysis/analysis/encore/clustering/src/ap.c
extra_compile_args = ['-std=c99', '-ffast-math', '-O1', '-funroll-loops',
'-fsigned-zeros']
else:
extra_compile_args = ['-std=c99', '-ffast-math', '-O3', '-funroll-loops',
'-fsigned-zeros'] # see #2722
define_macros = []
if config.get('debug_cflags', default=False):
extra_compile_args.extend(['-Wall', '-pedantic'])
Expand Down
7 changes: 5 additions & 2 deletions testsuite/MDAnalysisTests/formats/test_libdcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import sys
import string
import struct
import platform

import hypothesis.strategies as strategies
from hypothesis import example, given
Expand Down Expand Up @@ -351,8 +352,10 @@ def write_dcd(in_name, out_name, remarks='testing', header=None):
f_out.write(xyz=frame.xyz, box=frame.unitcell)


@pytest.mark.xfail(os.name == 'nt' and sys.maxsize <= 2**32,
reason="occasional fail on 32-bit windows")
@pytest.mark.xfail((os.name == 'nt'
and sys.maxsize <= 2**32) or
platform.machine() == 'aarch64',
reason="occasional fail on 32-bit windows and ARM")
@given(remarks=strategies.text(
alphabet=string.printable, min_size=0,
max_size=239)) # handle the printable ASCII strings
Expand Down

0 comments on commit daee516

Please sign in to comment.