-
Notifications
You must be signed in to change notification settings - Fork 8
166 lines (156 loc) · 7.34 KB
/
TestSuites.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Workflow for unit tests
name: CI
# This Workflow is triggered by any PR or a direct push to master.
on:
push:
branches: [ master ]
pull_request:
# abort old runs if a new one is started
concurrency:
group: ${{ github.head_ref }}-tests
cancel-in-progress: true
jobs:
# Check that everything is formatted correctly. This does not apply any changes!
StyleCheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.16.2
with:
source: 'src tests examples applicationLibrary tools'
# exclude: 'none'
extensions: 'h,cpp'
clangFormatVersion: 14
style: file
# Make sure contribution guidelines are followed. This does not apply any changes!
CustomChecks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checks
# this exits immediately when any command returns != 0
run: |
# enable recursive globbing syntax
shopt -s globstar
# '!' at the beginning of the line negates the exit code
# all headers should contain pragma once
! grep --files-without-match '#pragma once' **/*.h
# all files should contain a file comment
! grep --files-without-match '@file' **/*.{h,cpp}
# no file should contain 'NULL'
! grep --word-regexp 'NULL' **/*.{h,cpp}
# no file should contain 'assert'
! grep --word-regexp 'assert' **/*.{h,cpp}
# no file should include autopas with '<>'
! grep '#include <autopas' **/*.{h,cpp}
# prohibit 'typedef' to force 'using'
! grep --word-regexp 'typedef' **/*.{h,cpp}
# prohibit old usage of AUTOPAS_OPENMP
! grep '#ifdef AUTOPAS_OPENMP' **/*.{h,cpp}
! grep '#if defined.AUTOPAS_OPENMP' **/*.{h,cpp}
MatrixJob:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
part: [1, 2] # Split tests into two parts, to be run by separate runners
md-flex-mode: [singlesite, multisite]
config: [
# 0 1 2 3 4 5 6 7 8
# container , CC , CXX , builder , mode , OpenMP , ASan, TSan, AVX
[autopas-build-clang , clang, clang++, Ninja , Debug , ON , ON , OFF , ON],
[autopas-build-clang , clang, clang++, Ninja , Release, OFF , ON , OFF , ON],
[autopas-build-archer, clang, clang++, Ninja , Release, ON , OFF , ON , ON],
[autopas-build-clang , clang, clang++, Ninja , Release, ON , ON , OFF , ON],
[autopas-build-gcc , gcc , g++ ,"'Unix Makefiles'", Release, ON , OFF , OFF , ON],
[autopas-build-gcc , mpicc, mpic++ ,"'Unix Makefiles'", Release, ON , ON , OFF , ON],
]
exclude:
# Exclude multisite tests (to later be re-added for some configurations)
- md-flex-mode: multisite
# Exclude MPI configuration from part 2, as there are not many tests and so don't need to be split
- config: [autopas-build-gcc , mpicc, mpic++ ,"'Unix Makefiles'", Release, ON , ON , OFF , ON]
part: 2
# For two configurations, compile with Multi-Site Molecule support for md-flexible. There are not so many tests
# so we only add tests for part 1
include:
- config: [autopas-build-archer, clang, clang++, Ninja , Release, ON , OFF , ON , OFF]
md-flex-mode: multisite
part: 1
- config: [autopas-build-gcc , mpicc, mpic++ ,"'Unix Makefiles'", Release, ON , ON , OFF , OFF]
md-flex-mode: multisite
part: 1
name: Matrix - ${{ matrix.config[1] }}|${{ matrix.config[4] }}|${{ matrix.md-flex-mode }}|OpenMP=${{ matrix.config[5] }}|ASan=${{ matrix.config[6] }}|TSan=${{ matrix.config[7] }} (${{ matrix.part }}/2)
container: autopas/${{ matrix.config[0] }}
env:
TSAN_OPTIONS: "ignore_noninstrumented_modules=1"
LSAN_OPTIONS: "verbosity=1:log_threads=1"
defaults:
run:
# make sure the scripts are executed with bash (needed for [[) and not sh.
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build everything
run: |
# derive whether or not to compile with MPI options ON.
[ "${{ matrix.config[1] }}" = 'mpicc' ] && UseMPI=ON || UseMPI=OFF
mkdir build && cd build
CC=${{ matrix.config[1] }} CXX=${{ matrix.config[2] }} cmake \
-G ${{ matrix.config[3] }} \
-DCCACHE=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.config[4] }} \
-DAUTOPAS_LOG_ALL=ON \
-DAUTOPAS_MIN_LOG_LVL:STRING=TRACE \
-DAUTOPAS_OPENMP=${{ matrix.config[5] }} \
-DAUTOPAS_ENABLE_ADDRESS_SANITIZER=${{ matrix.config[6] }} \
-DAUTOPAS_ENABLE_THREAD_SANITIZER=${{ matrix.config[7] }} \
-DAUTOPAS_INTERNODE_TUNING=${UseMPI} \
-DMD_FLEXIBLE_USE_MPI=${UseMPI} \
-DMD_FLEXIBLE_MODE=${{ matrix.md-flex-mode }} \
-DMD_FLEXIBLE_FUNCTOR_AUTOVEC=ON \
-DMD_FLEXIBLE_FUNCTOR_AUTOVEC_GLOBALS=OFF \
-DMD_FLEXIBLE_FUNCTOR_AVX=${{ matrix.config[8] }} \
-DMD_FLEXIBLE_FUNCTOR_SVE=OFF \
-DAUTOPAS_ENABLE_ALLLBL=${UseMPI} \
-DAUTOPAS_ENABLE_RULE_BASED_TUNING=ON \
..
entrypoint.sh cmake --build . --parallel 8
- name: Run tests ${{ matrix.part }}/2
run: |
# If single-site & No MPI, run every other AutoPas and example test
if [[ "${{ matrix.md-flex-mode }}" = 'singlesite' ]] && [[ "${{ matrix.config[1] }}" != 'mpicc' ]]
then
cd build
# Start with test 0 or 1 and do every second test
ctest --output-on-failure -I ${{ matrix.part }},,2 -j 2
cd applicationLibrary
ctest --output-on-failure -I ${{ matrix.part }},,2 -j 2
cd ../examples
ctest --output-on-failure --build-config checkExamples -I ${{ matrix.part }},,2 -j 2
fi
# If single-site & MPI, run MPI tests for AutoPas and example tests
if [[ "${{ matrix.md-flex-mode }}" = 'singlesite' ]] && [[ "${{ matrix.config[1] }}" = 'mpicc' ]]
then
cd build
# Only run MPI tests.
# No `--oversubscribe`, as MPI in container doesn't need it.
ctest --output-on-failure --tests-regex MPIParallelAutoPasTests
cd examples
# exclude examples that do not support MPI
ctest --output-on-failure --build-config checkExamples --exclude-regex 'sph-((main.test)|(diagram.*))'
fi
# If multi-site run every md-flexible test and multi site tests
if [[ "${{ matrix.md-flex-mode }}" = 'multisite' ]]
then
cd build/applicationLibrary
# Only run multi-site tests for non-mpi case
if [[ "${{ matrix.config[1] }}" != 'mpicc' ]]
then
ctest --output-on-failure --tests-regex '[mM]ulti[sS]ite'
fi
cd ../examples/md-flexible
ctest --output-on-failure --build-config mdFlexTests
fi