Skip to content

Commit cf1afee

Browse files
authored
Merge branch 'develop' into Dependabot-GitHub-Actions
2 parents c2194ec + 40e82f4 commit cf1afee

30 files changed

Lines changed: 10933 additions & 131 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Regression tests running on Linux ARM64
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
8+
jobs:
9+
build_on_arm64:
10+
name: Run the jobs on Linux ARM64
11+
uses: './.github/workflows/regression.yml'
12+
with:
13+
runner: 'ARM64'

.github/workflows/regression.yml

Lines changed: 95 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
branches:
1010
- 'develop'
1111
- 'master'
12+
workflow_call:
13+
inputs:
14+
runner:
15+
description: 'The github runner to use'
16+
default: 'ubuntu-latest'
17+
required: false
18+
type: string
1219

1320
jobs:
1421
build:
@@ -36,25 +43,37 @@ jobs:
3643
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3 --werror'
3744
- config_set: ForwardOMP
3845
flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3 --werror'
39-
runs-on: ubuntu-latest
46+
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
4047
steps:
4148
- name: Cache Object Files
42-
uses: actions/cache@v1
49+
uses: actions/cache@v3
4350
with:
4451
path: ccache
4552
key: ${{ matrix.config_set }}-${{ github.sha }}
4653
restore-keys: ${{ matrix.config_set }}
54+
- name: Pre Cleanup
55+
uses: docker://ghcr.io/su2code/su2/build-su2:220614-1237
56+
with:
57+
entrypoint: /bin/rm
58+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
4759
- name: Build
48-
uses: docker://su2code/build-su2:20191105
60+
uses: docker://ghcr.io/su2code/su2/build-su2:220614-1237
4961
with:
5062
args: -b ${{github.ref}} -f "${{matrix.flags}}"
63+
- name: Compress binaries
64+
run: tar -zcvf install_bin.tgz install/bin
5165
- name: Upload Binaries
52-
uses: actions/upload-artifact@v1
66+
uses: actions/upload-artifact@v3
5367
with:
5468
name: ${{ matrix.config_set }}
55-
path: install/bin
69+
path: install_bin.tgz
70+
- name: Post Cleanup
71+
uses: docker://ghcr.io/su2code/su2/build-su2:220614-1237
72+
with:
73+
entrypoint: /bin/rm
74+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
5675
regression_tests:
57-
runs-on: ubuntu-latest
76+
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
5877
name: Regression Tests
5978
needs: build
6079
strategy:
@@ -79,22 +98,44 @@ jobs:
7998
- testscript: 'hybrid_regression_AD.py'
8099
tag: OMP
81100
steps:
82-
- name: Download All artifact
83-
uses: actions/download-artifact@v2
84-
- name: Move Binaries
101+
- name: Pre Cleanup
102+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
103+
with:
104+
entrypoint: /bin/rm
105+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
106+
- name: Download All artifacts
107+
uses: actions/download-artifact@v3
108+
- name: Uncompress and Move Binaries
85109
run: |
86-
mkdir -p install/bin
87-
if [ -d "${{format('Base{0}', matrix.tag)}}" ]; then cp -r ${{format('Base{0}', matrix.tag)}}/. install/bin/; fi
88-
if [ -d "${{format('Reverse{0}', matrix.tag)}}" ]; then cp -r ${{format('Reverse{0}', matrix.tag)}}/. install/bin/; fi
89-
if [ -d "${{format('Forward{0}', matrix.tag)}}" ]; then cp -r ${{format('Forward{0}', matrix.tag)}}/. install/bin/; fi
90-
chmod a+x install/bin/*
110+
BIN_FOLDER="$PWD/install/bin"
111+
mkdir -p $BIN_FOLDER
112+
ls -lah $BIN_FOLDER
113+
for type in Base Reverse Forward; do
114+
TYPE_FOLDER="${type}${{matrix.tag}}"
115+
echo "Processing '$TYPE_FOLDER' ..."
116+
if [ -d $TYPE_FOLDER ]; then
117+
pushd $TYPE_FOLDER
118+
ls -lah
119+
tar -zxvf install_bin.tgz
120+
ls -lah install/bin/
121+
cp -r install/bin/* $BIN_FOLDER;
122+
popd;
123+
fi
124+
done
125+
chmod a+x $BIN_FOLDER/*
126+
ls -lahR $BIN_FOLDER
91127
- name: Run Tests in Container
92-
uses: docker://su2code/test-su2:20200303
128+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
93129
with:
94130
# -t <Tutorials-branch> -c <Testcases-branch>
95131
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
132+
- name: Cleanup
133+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
134+
with:
135+
entrypoint: /bin/rm
136+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
96137
unit_tests:
97-
runs-on: ubuntu-latest
138+
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
98139
name: Unit Tests
99140
needs: build
100141
strategy:
@@ -109,26 +150,54 @@ jobs:
109150
- testdriver: 'test_driver_DD'
110151
tag: MPI
111152
steps:
153+
- name: Pre Cleanup
154+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
155+
with:
156+
entrypoint: /bin/rm
157+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
112158
- name: Download Base
113-
uses: actions/download-artifact@v1
159+
uses: actions/download-artifact@v3
114160
with:
115161
name: ${{format('Base{0}', matrix.tag)}}
162+
path: ${{format('Base{0}', matrix.tag)}}
116163
- name: Download Reverse
117-
uses: actions/download-artifact@v1
164+
uses: actions/download-artifact@v3
118165
with:
119166
name: ${{format('Reverse{0}', matrix.tag)}}
167+
path: ${{format('Reverse{0}', matrix.tag)}}
120168
- name: Download Forward
121-
uses: actions/download-artifact@v1
169+
uses: actions/download-artifact@v3
122170
with:
123171
name: ${{format('Forward{0}', matrix.tag)}}
124-
- name: Move Binaries
172+
path: ${{format('Forward{0}', matrix.tag)}}
173+
- name: Uncompress and Move Binaries
125174
run: |
126-
mkdir -p install/bin
127-
cp -r ${{format('Base{0}', matrix.tag)}}/. install/bin/
128-
cp -r ${{format('Reverse{0}', matrix.tag)}}/. install/bin/
129-
cp -r ${{format('Forward{0}', matrix.tag)}}/. install/bin/
130-
chmod a+x install/bin/*
175+
ls -lah
176+
BIN_FOLDER="$PWD/install/bin"
177+
mkdir -p $BIN_FOLDER
178+
ls -laH $BIN_FOLDER
179+
for type in Base Reverse Forward; do
180+
TYPE_FOLDER="${type}${{matrix.tag}}"
181+
if [ -d $TYPE_FOLDER ]; then
182+
echo "Processing '$TYPE_FOLDER' ..."
183+
pushd $TYPE_FOLDER
184+
ls -lah
185+
tar -zxvf install_bin.tgz
186+
ls -laH install/bin/
187+
cp -r install/bin/* $BIN_FOLDER;
188+
popd;
189+
else
190+
echo "$TYPE_FOLDER does not exist!"
191+
fi
192+
done
193+
find $BIN_FOLDER -type f -exec chmod a+x '{}' \;
194+
ls -lahR $BIN_FOLDER
131195
- name: Run Unit Tests
132-
uses: docker://su2code/test-su2:20191031
196+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
133197
with:
134198
entrypoint: install/bin/${{matrix.testdriver}}
199+
- name: Post Cleanup
200+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
201+
with:
202+
entrypoint: /bin/rm
203+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}

TestCases/TestCase.py

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from __future__ import print_function, division, absolute_import
2828
import time, os, subprocess, datetime, sys
2929
import difflib
30+
import platform
3031

3132

3233
def print_vals(vals, name="Values"):
@@ -63,6 +64,9 @@ def __init__(self,tag_in):
6364
self.test_iter = 1
6465
self.ntest_vals = 4
6566
self.test_vals = []
67+
self.test_vals_aarch64 = []
68+
self.cpu_arch = platform.processor()
69+
self.enabled_on_cpu_arch = ["x86_64", "aarch64"]
6670

6771
# These can be optionally varied
6872
self.su2_exec = "SU2_CFD"
@@ -71,10 +75,14 @@ def __init__(self,tag_in):
7175

7276
# Options for file-comparison tests
7377
self.reference_file = "of_grad.dat.ref"
78+
self.reference_file_aarch64 = ""
7479
self.test_file = "of_grad.dat"
7580

7681
def run_test(self):
7782

83+
if not self.is_enabled():
84+
return True
85+
7886
print('==================== Start Test: %s ===================='%self.tag)
7987
passed = True
8088
exceed_tol = False
@@ -109,6 +117,8 @@ def run_test(self):
109117
self.cfg_file,
110118
logfilename)
111119

120+
self.adjust_test_data()
121+
112122
# Run SU2
113123
workdir = os.getcwd()
114124
os.chdir(self.cfg_dir)
@@ -208,6 +218,8 @@ def run_test(self):
208218
if iter_missing:
209219
print('ERROR: The iteration number %d could not be found.'%self.test_iter)
210220

221+
print('CPU architecture=%s' % self.cpu_arch)
222+
211223
if len(self.test_vals) != 0:
212224
print('test_iter=%d' % self.test_iter)
213225

@@ -225,13 +237,19 @@ def run_test(self):
225237
return passed
226238

227239
def run_filediff(self):
240+
241+
if not self.is_enabled():
242+
return True
243+
228244
print('==================== Start Test: %s ===================='%self.tag)
229245
passed = True
230246
timed_out = False
231247

232248
# Adjust the number of iterations in the config file
233249
self.adjust_iter()
234250

251+
self.adjust_test_data()
252+
235253
# if root, add flag to mpirun
236254
if os.geteuid()==0:
237255
if self.su2_exec.startswith('mpirun'):
@@ -305,6 +323,7 @@ def run_filediff(self):
305323
else:
306324
passed = False
307325

326+
print('CPU architecture=%s'%self.cpu_arch)
308327
print('test duration: %.2f min'%(running_time/60.0))
309328
print('==================== End Test: %s ====================\n'%self.tag)
310329

@@ -314,6 +333,9 @@ def run_filediff(self):
314333

315334
def run_opt(self):
316335

336+
if not self.is_enabled():
337+
return True
338+
317339
print('==================== Start Test: %s ===================='%self.tag)
318340
passed = True
319341
exceed_tol = False
@@ -324,6 +346,8 @@ def run_opt(self):
324346
# Adjust the number of iterations in the config file
325347
self.adjust_opt_iter()
326348

349+
self.adjust_test_data()
350+
327351
# Assemble the shell command to run SU2
328352
logfilename = '%s.log' % os.path.splitext(self.cfg_file)[0]
329353
command = "%s %s > %s 2>&1" % (self.su2_exec, self.cfg_file, logfilename)
@@ -434,6 +458,9 @@ def run_opt(self):
434458

435459
def run_geo(self):
436460

461+
if not self.is_enabled():
462+
return True
463+
437464
print('==================== Start Test: %s ===================='%self.tag)
438465
passed = True
439466
exceed_tol = False
@@ -446,6 +473,8 @@ def run_geo(self):
446473
found_twist = False
447474
found_chord = False
448475

476+
self.adjust_test_data()
477+
449478
# if root, add flag to mpirun
450479
if os.geteuid()==0:
451480
if self.su2_exec.startswith('mpirun'):
@@ -562,14 +591,19 @@ def run_geo(self):
562591
return passed
563592

564593
def run_def(self):
565-
594+
595+
if not self.is_enabled():
596+
return True
597+
566598
print('==================== Start Test: %s ===================='%self.tag)
567599
passed = True
568600
exceed_tol = False
569601
timed_out = False
570602
iter_missing = True
571603
start_solver = True
572604

605+
self.adjust_test_data()
606+
573607
# if root, add flag to mpirun
574608
if os.geteuid()==0:
575609
if self.su2_exec.startswith('mpirun'):
@@ -760,3 +794,20 @@ def disable_restart(self):
760794
os.chdir(workdir)
761795

762796
return
797+
798+
def is_enabled(self):
799+
is_enabled = self.cpu_arch in self.enabled_on_cpu_arch
800+
801+
if not is_enabled:
802+
print('Ignoring test "%s" because it is not enabled for the current CPU architecture: %s' % (self.tag, self.cpu_arch))
803+
804+
return is_enabled
805+
806+
def adjust_test_data(self):
807+
808+
if self.cpu_arch == 'aarch64':
809+
if len(self.test_vals_aarch64) != 0:
810+
self.test_vals = self.test_vals_aarch64
811+
812+
if len(self.reference_file_aarch64) != 0:
813+
self.reference_file = self.reference_file_aarch64
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
VARIABLES="VARIABLE" , "GRADIENT" , "FINDIFF_STEP"
2+
0 , -2656.96 , 0.001
3+
1 , -12995.9 , 0.001
4+
2 , -21781.3 , 0.001
5+
3 , -27675.3 , 0.001
6+
4 , -30437.9 , 0.001
7+
5 , -30443.9 , 0.001
8+
6 , -28343.1 , 0.001
9+
7 , -24794.2 , 0.001
10+
8 , -20329.4 , 0.001
11+
9 , -15376.6 , 0.001
12+
10 , -10418.0 , 0.001
13+
11 , -6201.67 , 0.001
14+
12 , -3878.08 , 0.001
15+
13 , -4910.93 , 0.001
16+
14 , -10573.5 , 0.001
17+
15 , -20610.7 , 0.001
18+
16 , -30110.4 , 0.001
19+
17 , -26294.5 , 0.001
20+
18 , -62393.8 , 0.001
21+
19 , -2797.26 , 0.001
22+
20 , -832.067 , 0.001
23+
21 , -668.081 , 0.001
24+
22 , -1773.25 , 0.001
25+
23 , -5718.86 , 0.001
26+
24 , -13717.8 , 0.001
27+
25 , -25699.0 , 0.001
28+
26 , -40061.9 , 0.001
29+
27 , -53729.8 , 0.001
30+
28 , -62415.6 , 0.001
31+
29 , -61293.4 , 0.001
32+
30 , -46505.9 , 0.001
33+
31 , -17841.7 , 0.001
34+
32 , 18183.8 , 0.001
35+
33 , 48447.5 , 0.001
36+
34 , 62322.0 , 0.001
37+
35 , 64139.5 , 0.001
38+
36 , 54568.2 , 0.001
39+
37 , 64856.8 , 0.001
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
VARIABLES="VARIABLE" , "DRAG" , "EFFICIENCY" , "FORCE_X" , "FORCE_Y" , "FORCE_Z" , "LIFT" , "MOMENT_X" , "MOMENT_Y" , "MOMENT_Z" , "SIDEFORCE"
2+
0 , 0.2253591473 , -105.6097088 , 0.2588459007 , -1.5322178 , 0.0 , -1.537499867 , 0.0 , 0.0 , 1.202899757 , 0.0
3+
1 , 0.3835809166 , -173.3502205 , 0.4363886002 , -2.415957492 , 0.0 , -2.424902327 , 0.0 , 0.0 , 1.053347497 , 0.0
4+
2 , 0.5151776249 , -228.9760041 , 0.5835870252 , -3.129538494 , 0.0 , -3.141524632 , 0.0 , 0.0 , 0.6540715539 , 0.0

0 commit comments

Comments
 (0)