Skip to content

Commit e654755

Browse files
Add new options for better parallelization of cpp tests in github action
1 parent 942b99f commit e654755

2 files changed

Lines changed: 39 additions & 26 deletions

File tree

.github/workflows/runcpptest.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ permissions:
1212

1313
jobs:
1414
CI_cpp_test_run:
15+
continue-on-error: true
1516
strategy:
17+
max-parallel: 6
1618
fail-fast: false
1719
matrix:
1820
# GCC currently has too many problems with the C++ API
1921
compiler: [AC6, CLANG]
2022
core: [M0, M4, M55]
23+
dt: [F64_DT,COMPLEX_F32_DT,F32_DT,COMPLEX_F16_DT,F16_DT,COMPLEX_Q31_DT,Q31_DT,COMPLEX_Q15_DT,Q15_DT,Q7_DT]
24+
test: [DOT_TEST,VECTOR_TEST,ROW_TEST,COL_TEST,MATRIX_TEST]
2125
runs-on: ubuntu-22.04
2226

2327
steps:
@@ -79,16 +83,16 @@ jobs:
7983
run: |
8084
cd dsppp
8185
echo "Running tests"
82-
python run_all.py -t -g ${{ matrix.compiler }} -c ${{ matrix.core }} -avh $AVH_FVP_PLUGINS/../bin
86+
python run_all.py -t -g ${{ matrix.compiler }} -c ${{ matrix.core }} --dt ${{matrix.dt}} --test ${{matrix.test}} -avh $AVH_FVP_PLUGINS/../bin
8387
8488
- name: Upload test report
8589
uses: actions/upload-artifact@v7
8690
with:
87-
name: test-cpp-report_${{ matrix.compiler }}_${{ matrix.core }}
88-
path: dsppp/${{ matrix.compiler }}_results/errors_${{ matrix.core }}.txt
91+
name: test-cpp-report_${{ matrix.compiler }}_${{ matrix.core }}_${{ matrix.dt }}_${{ matrix.test }}
92+
path: dsppp/${{ matrix.compiler }}_results/errors_${{ matrix.core }}_${{ matrix.dt }}_${{ matrix.test }}.txt
8993

9094
- name: Check error
9195
run: |
9296
cd dsppp
9397
echo "Checking output..."
94-
test "$(cat ${{ matrix.compiler }}_results/errors_${{ matrix.core }}.txt | wc -l)" -eq 0
98+
test "$(cat ${{ matrix.compiler }}_results/errors_${{ matrix.core }}_${{ matrix.dt }}_${{ matrix.test }}.txt | wc -l)" -eq 0

dsppp/run_all.py

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ def run(args,mustPrint=False,dumpStdErr=True,timeout=20,printCmd=False):
106106
parser.add_argument('-dump', action='store_true', help="Dump build output")
107107
parser.add_argument('-s', nargs='?',type = int,help="Force subtest")
108108

109+
parser.add_argument('--dt', nargs='?',type = str, default="ALL",help="Dataype to run")
110+
parser.add_argument('--test', nargs='?',type = str, default="ALL",help="Test to run")
111+
112+
109113
args = parser.parse_args()
110114

111115
GHACTION = False
@@ -176,16 +180,23 @@ def cmd_args():
176180

177181
AVHROOT = args.avh
178182

179-
180-
# Fusion F64 not working. To be analyzed
181-
TESTS=["DOT_TEST",
183+
ALL_TESTS=["DOT_TEST",
182184
"VECTOR_TEST",
183185
"ROW_TEST",
184186
"COL_TEST",
185187
"MATRIX_TEST",
186188
# "FUSION_TEST"
187189
]
188190

191+
# Fusion F64 not working. To be analyzed
192+
if args.test != "ALL":
193+
if args.test not in ALL_TESTS:
194+
print(f"Test {args.test} not known")
195+
exit(1)
196+
TESTS = [args.test]
197+
else:
198+
TESTS = ALL_TESTS
199+
189200
# Some tests are too big (code size) and needs to be decomposed
190201
# They contain SUBTEST1, SUBTEST2 ... #if in the code
191202
# This script must know how many subtests are defined in each test
@@ -201,26 +212,8 @@ def is_only_test(n,i):
201212
return(i in ONLY_TESTS[n[0]])
202213
return False
203214

204-
DATATYPES = ["COMPLEX_F64_DT",
205-
"F64_DT",
206-
"COMPLEX_F32_DT",
207-
"F32_DT",
208-
"COMPLEX_F16_DT",
209-
"F16_DT",
210-
"COMPLEX_Q31_DT",
211-
"Q31_DT",
212-
"COMPLEX_Q15_DT",
213-
"Q15_DT",
214-
"Q7_DT"
215-
]
216-
217-
MODE = ["STATIC_TEST",
218-
"DYNAMIC_TEST"
219-
]
220215

221-
# Restricted tests for debugging
222-
#TESTS=["DOT_TEST"]
223-
DATATYPES=[ #"COMPLEX_F64_DT",
216+
ALL_DATATYPES=[ #"COMPLEX_F64_DT",
224217
"F64_DT",
225218
"COMPLEX_F32_DT",
226219
"F32_DT",
@@ -233,6 +226,22 @@ def is_only_test(n,i):
233226
#"COMPLEX_Q7_DT",
234227
"Q7_DT"
235228
]
229+
230+
if args.dt != "ALL":
231+
if args.dt not in ALL_DATATYPES:
232+
print(f"Datatype {args.dt} not known")
233+
exit(1)
234+
DATATYPES = [args.dt]
235+
else:
236+
DATATYPES = ALL_DATATYPES
237+
238+
MODE = ["STATIC_TEST",
239+
"DYNAMIC_TEST"
240+
]
241+
242+
# Restricted tests for debugging
243+
#TESTS=["DOT_TEST"]
244+
236245
#DATATYPES=[
237246
# "COMPLEX_F16_DT",
238247
# "Q31_DT",

0 commit comments

Comments
 (0)