Skip to content

Commit beeab68

Browse files
authored
Allow batch test counts (#475)
- Extend `run_tests.py` to accept a list of counts and loop internally - Collapse repeated CI test steps in workflow files by providing all counts in a single call - Refactor main logic in `run_tests.py` into a helper to remove duplication - Print each count before execution in batch mode
1 parent 597edcf commit beeab68

File tree

4 files changed

+69
-328
lines changed

4 files changed

+69
-328
lines changed

.github/workflows/mac.yml

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -100,46 +100,14 @@ jobs:
100100
run: |
101101
mkdir -p install
102102
tar -xzvf macos-clang-sanitizer-install.tar.gz -C install
103-
- name: Run func tests (MPI, num_proc=1)
104-
run: python3 scripts/run_tests.py --running-type="processes"
103+
- name: Run func tests (MPI)
104+
run: python3 scripts/run_tests.py --running-type="processes" --counts 1 2 3 4
105105
env:
106-
PPC_NUM_PROC: 1
107-
PPC_NUM_THREADS: 3
108-
- name: Run func tests (MPI, num_proc=2)
109-
run: python3 scripts/run_tests.py --running-type="processes"
110-
env:
111-
PPC_NUM_PROC: 2
112-
PPC_NUM_THREADS: 2
113-
- name: Run func tests (MPI, num_proc=3)
114-
run: python3 scripts/run_tests.py --running-type="processes"
115-
env:
116-
PPC_NUM_PROC: 3
117-
PPC_NUM_THREADS: 1
118-
- name: Run func tests (MPI, num_proc=4)
119-
run: python3 scripts/run_tests.py --running-type="processes"
120-
env:
121-
PPC_NUM_PROC: 4
122106
PPC_NUM_THREADS: 1
123-
- name: Run tests (threads, num_threads=1)
124-
run: python3 scripts/run_tests.py --running-type="threads"
125-
env:
126-
PPC_NUM_PROC: 1
127-
PPC_NUM_THREADS: 1
128-
- name: Run tests (threads, num_threads=2)
129-
run: python3 scripts/run_tests.py --running-type="threads"
130-
env:
131-
PPC_NUM_PROC: 1
132-
PPC_NUM_THREADS: 2
133-
- name: Run tests (threads, num_threads=3)
134-
run: python3 scripts/run_tests.py --running-type="threads"
135-
env:
136-
PPC_NUM_PROC: 1
137-
PPC_NUM_THREADS: 3
138-
- name: Run tests (threads, num_threads=4)
139-
run: python3 scripts/run_tests.py --running-type="threads"
107+
- name: Run tests (threads)
108+
run: python3 scripts/run_tests.py --running-type="threads" --counts 1 2 3 4
140109
env:
141110
PPC_NUM_PROC: 1
142-
PPC_NUM_THREADS: 4
143111
macos-clang-test-extended:
144112
needs:
145113
- macos-clang-test
@@ -162,23 +130,7 @@ jobs:
162130
run: |
163131
mkdir -p install
164132
tar -xzvf macos-clang-sanitizer-install.tar.gz -C install
165-
- name: Run tests (threads, num_threads=5)
166-
run: python3 scripts/run_tests.py --running-type="threads"
167-
env:
168-
PPC_NUM_PROC: 1
169-
PPC_NUM_THREADS: 5
170-
- name: Run tests (threads, num_threads=7)
171-
run: python3 scripts/run_tests.py --running-type="threads"
172-
env:
173-
PPC_NUM_PROC: 1
174-
PPC_NUM_THREADS: 7
175-
- name: Run tests (threads, num_threads=11)
176-
run: python3 scripts/run_tests.py --running-type="threads"
177-
env:
178-
PPC_NUM_PROC: 1
179-
PPC_NUM_THREADS: 11
180-
- name: Run tests (threads, num_threads=13)
181-
run: python3 scripts/run_tests.py --running-type="threads"
133+
- name: Run tests (threads extended)
134+
run: python3 scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
182135
env:
183136
PPC_NUM_PROC: 1
184-
PPC_NUM_THREADS: 13

.github/workflows/ubuntu.yml

Lines changed: 19 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -114,46 +114,14 @@ jobs:
114114
run: |
115115
mkdir -p install
116116
tar -xzvf ubuntu-gcc-install-${{ matrix.os }}.tar.gz -C install
117-
- name: Run func tests (MPI, num_proc=1)
118-
run: python3 scripts/run_tests.py --running-type="processes"
119-
env:
120-
PPC_NUM_PROC: 1
121-
PPC_NUM_THREADS: 3
122-
- name: Run func tests (MPI, num_proc=2)
123-
run: python3 scripts/run_tests.py --running-type="processes"
124-
env:
125-
PPC_NUM_PROC: 2
126-
PPC_NUM_THREADS: 2
127-
- name: Run func tests (MPI, num_proc=3)
128-
run: python3 scripts/run_tests.py --running-type="processes"
129-
env:
130-
PPC_NUM_PROC: 3
131-
PPC_NUM_THREADS: 1
132-
- name: Run func tests (MPI, num_proc=4)
133-
run: python3 scripts/run_tests.py --running-type="processes"
117+
- name: Run func tests (MPI)
118+
run: python3 scripts/run_tests.py --running-type="processes" --counts 1 2 3 4
134119
env:
135-
PPC_NUM_PROC: 4
136120
PPC_NUM_THREADS: 1
137-
- name: Run func tests (threads, num_threads=1)
138-
run: python3 scripts/run_tests.py --running-type="threads"
121+
- name: Run func tests (threads)
122+
run: python3 scripts/run_tests.py --running-type="threads" --counts 1 2 3 4
139123
env:
140124
PPC_NUM_PROC: 1
141-
PPC_NUM_THREADS: 1
142-
- name: Run func tests (threads, num_threads=2)
143-
run: python3 scripts/run_tests.py --running-type="threads"
144-
env:
145-
PPC_NUM_PROC: 1
146-
PPC_NUM_THREADS: 2
147-
- name: Run func tests (threads, num_threads=3)
148-
run: python3 scripts/run_tests.py --running-type="threads"
149-
env:
150-
PPC_NUM_PROC: 1
151-
PPC_NUM_THREADS: 3
152-
- name: Run func tests (threads, num_threads=4)
153-
run: python3 scripts/run_tests.py --running-type="threads"
154-
env:
155-
PPC_NUM_PROC: 1
156-
PPC_NUM_THREADS: 4
157125
ubuntu-gcc-test-extended:
158126
needs:
159127
- ubuntu-gcc-test
@@ -176,26 +144,10 @@ jobs:
176144
run: |
177145
mkdir -p install
178146
tar -xzvf ubuntu-gcc-install-${{ matrix.os }}.tar.gz -C install
179-
- name: Run func tests (threads, num_threads=5)
180-
run: python3 scripts/run_tests.py --running-type="threads"
147+
- name: Run func tests (threads extended)
148+
run: python3 scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
181149
env:
182150
PPC_NUM_PROC: 1
183-
PPC_NUM_THREADS: 5
184-
- name: Run func tests (threads, num_threads=7)
185-
run: python3 scripts/run_tests.py --running-type="threads"
186-
env:
187-
PPC_NUM_PROC: 1
188-
PPC_NUM_THREADS: 7
189-
- name: Run func tests (threads, num_threads=11)
190-
run: python3 scripts/run_tests.py --running-type="threads"
191-
env:
192-
PPC_NUM_PROC: 1
193-
PPC_NUM_THREADS: 11
194-
- name: Run func tests (threads, num_threads=13)
195-
run: python3 scripts/run_tests.py --running-type="threads"
196-
env:
197-
PPC_NUM_PROC: 1
198-
PPC_NUM_THREADS: 13
199151
ubuntu-clang-build:
200152
runs-on: ${{ matrix.os }}
201153
strategy:
@@ -264,46 +216,14 @@ jobs:
264216
run: |
265217
mkdir -p install
266218
tar -xzvf ubuntu-clang-install-${{ matrix.os }}.tar.gz -C install
267-
- name: Run func tests (MPI, num_proc=1)
268-
run: python3 scripts/run_tests.py --running-type="processes"
269-
env:
270-
PPC_NUM_PROC: 1
271-
PPC_NUM_THREADS: 3
272-
- name: Run func tests (MPI, num_proc=2)
273-
run: python3 scripts/run_tests.py --running-type="processes"
274-
env:
275-
PPC_NUM_PROC: 2
276-
PPC_NUM_THREADS: 2
277-
- name: Run func tests (MPI, num_proc=3)
278-
run: python3 scripts/run_tests.py --running-type="processes"
219+
- name: Run func tests (MPI)
220+
run: python3 scripts/run_tests.py --running-type="processes" --counts 1 2 3 4
279221
env:
280-
PPC_NUM_PROC: 3
281222
PPC_NUM_THREADS: 1
282-
- name: Run func tests (MPI, num_proc=4)
283-
run: python3 scripts/run_tests.py --running-type="processes"
284-
env:
285-
PPC_NUM_PROC: 4
286-
PPC_NUM_THREADS: 1
287-
- name: Run tests (threads, num_threads=1)
288-
run: python3 scripts/run_tests.py --running-type="threads"
289-
env:
290-
PPC_NUM_PROC: 1
291-
PPC_NUM_THREADS: 1
292-
- name: Run tests (threads, num_threads=2)
293-
run: python3 scripts/run_tests.py --running-type="threads"
223+
- name: Run tests (threads)
224+
run: python3 scripts/run_tests.py --running-type="threads" --counts 1 2 3 4
294225
env:
295226
PPC_NUM_PROC: 1
296-
PPC_NUM_THREADS: 2
297-
- name: Run tests (threads, num_threads=3)
298-
run: python3 scripts/run_tests.py --running-type="threads"
299-
env:
300-
PPC_NUM_PROC: 1
301-
PPC_NUM_THREADS: 3
302-
- name: Run tests (threads, num_threads=4)
303-
run: python3 scripts/run_tests.py --running-type="threads"
304-
env:
305-
PPC_NUM_PROC: 1
306-
PPC_NUM_THREADS: 4
307227
ubuntu-clang-test-extended:
308228
needs:
309229
- ubuntu-clang-test
@@ -328,26 +248,10 @@ jobs:
328248
run: |
329249
mkdir -p install
330250
tar -xzvf ubuntu-clang-install-${{ matrix.os }}.tar.gz -C install
331-
- name: Run tests (threads, num_threads=5)
332-
run: python3 scripts/run_tests.py --running-type="threads"
333-
env:
334-
PPC_NUM_PROC: 1
335-
PPC_NUM_THREADS: 5
336-
- name: Run tests (threads, num_threads=7)
337-
run: python3 scripts/run_tests.py --running-type="threads"
251+
- name: Run tests (threads extended)
252+
run: python3 scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
338253
env:
339254
PPC_NUM_PROC: 1
340-
PPC_NUM_THREADS: 7
341-
- name: Run tests (threads, num_threads=11)
342-
run: python3 scripts/run_tests.py --running-type="threads"
343-
env:
344-
PPC_NUM_PROC: 1
345-
PPC_NUM_THREADS: 11
346-
- name: Run tests (threads, num_threads=13)
347-
run: python3 scripts/run_tests.py --running-type="threads"
348-
env:
349-
PPC_NUM_PROC: 1
350-
PPC_NUM_THREADS: 13
351255
ubuntu-clang-sanitizer-build:
352256
needs:
353257
- ubuntu-clang-build
@@ -423,42 +327,16 @@ jobs:
423327
mkdir -p install
424328
tar -xzvf ubuntu-clang-sanitizer-install-${{ matrix.os }}.tar.gz -C install
425329
- name: Run tests (MPI)
426-
run: python3 scripts/run_tests.py --running-type="processes" --additional-mpi-args="--oversubscribe"
330+
run: python3 scripts/run_tests.py --running-type="processes" --counts 2 --additional-mpi-args="--oversubscribe"
427331
env:
428-
PPC_NUM_PROC: 2
429332
PPC_NUM_THREADS: 2
430333
PPC_ASAN_RUN: 1
431334
ASAN_OPTIONS: abort_on_error=1
432335
UBSAN_OPTIONS: halt_on_error=1
433-
- name: Run tests (threads, num_threads=1)
434-
run: python3 scripts/run_tests.py --running-type="threads"
435-
env:
436-
PPC_NUM_PROC: 1
437-
PPC_NUM_THREADS: 1
438-
PPC_ASAN_RUN: 1
439-
ASAN_OPTIONS: abort_on_error=1
440-
UBSAN_OPTIONS: halt_on_error=1
441-
- name: Run tests (threads, num_threads=2)
442-
run: python3 scripts/run_tests.py --running-type="threads"
443-
env:
444-
PPC_NUM_PROC: 1
445-
PPC_NUM_THREADS: 2
446-
PPC_ASAN_RUN: 1
447-
ASAN_OPTIONS: abort_on_error=1
448-
UBSAN_OPTIONS: halt_on_error=1
449-
- name: Run tests (threads, num_threads=3)
450-
run: python3 scripts/run_tests.py --running-type="threads"
451-
env:
452-
PPC_NUM_PROC: 1
453-
PPC_NUM_THREADS: 3
454-
PPC_ASAN_RUN: 1
455-
ASAN_OPTIONS: abort_on_error=1
456-
UBSAN_OPTIONS: halt_on_error=1
457-
- name: Run tests (threads, num_threads=4)
458-
run: python3 scripts/run_tests.py --running-type="threads"
336+
- name: Run tests (threads)
337+
run: python3 scripts/run_tests.py --running-type="threads" --counts 1 2 3 4
459338
env:
460339
PPC_NUM_PROC: 1
461-
PPC_NUM_THREADS: 4
462340
PPC_ASAN_RUN: 1
463341
ASAN_OPTIONS: abort_on_error=1
464342
UBSAN_OPTIONS: halt_on_error=1
@@ -487,29 +365,10 @@ jobs:
487365
run: |
488366
mkdir -p install
489367
tar -xzvf ubuntu-clang-sanitizer-install-${{ matrix.os }}.tar.gz -C install
490-
- name: Run tests (threads, num_threads=5)
491-
run: python3 scripts/run_tests.py --running-type="threads"
368+
- name: Run tests (threads extended)
369+
run: python3 scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
492370
env:
493371
PPC_NUM_PROC: 1
494-
PPC_NUM_THREADS: 5
495-
PPC_ASAN_RUN: 1
496-
- name: Run tests (threads, num_threads=7)
497-
run: python3 scripts/run_tests.py --running-type="threads"
498-
env:
499-
PPC_NUM_PROC: 1
500-
PPC_NUM_THREADS: 7
501-
PPC_ASAN_RUN: 1
502-
- name: Run tests (threads, num_threads=11)
503-
run: python3 scripts/run_tests.py --running-type="threads"
504-
env:
505-
PPC_NUM_PROC: 1
506-
PPC_NUM_THREADS: 11
507-
PPC_ASAN_RUN: 1
508-
- name: Run tests (threads, num_threads=13)
509-
run: python3 scripts/run_tests.py --running-type="threads"
510-
env:
511-
PPC_NUM_PROC: 1
512-
PPC_NUM_THREADS: 13
513372
PPC_ASAN_RUN: 1
514373
ubuntu-gcc-build-codecov:
515374
needs:
@@ -545,26 +404,10 @@ jobs:
545404
env:
546405
PPC_NUM_PROC: 2
547406
PPC_NUM_THREADS: 2
548-
- name: Run tests (threads, num_threads=1)
549-
run: python3 scripts/run_tests.py --running-type="threads"
550-
env:
551-
PPC_NUM_PROC: 1
552-
PPC_NUM_THREADS: 1
553-
- name: Run tests (threads, num_threads=2)
554-
run: python3 scripts/run_tests.py --running-type="threads"
555-
env:
556-
PPC_NUM_PROC: 1
557-
PPC_NUM_THREADS: 2
558-
- name: Run tests (threads, num_threads=3)
559-
run: python3 scripts/run_tests.py --running-type="threads"
560-
env:
561-
PPC_NUM_PROC: 1
562-
PPC_NUM_THREADS: 3
563-
- name: Run tests (threads, num_threads=4)
564-
run: python3 scripts/run_tests.py --running-type="threads"
407+
- name: Run tests (threads)
408+
run: python3 scripts/run_tests.py --running-type="threads" --counts 1 2 3 4
565409
env:
566410
PPC_NUM_PROC: 1
567-
PPC_NUM_THREADS: 4
568411
- name: Generate gcovr Coverage Data
569412
run: |
570413
mkdir cov-report

0 commit comments

Comments
 (0)