Skip to content

Commit ab2242f

Browse files
committed
Add OMP thread control and refactor environment handling
Introduced `omp_set_num_threads` for OpenMP thread control in functional and performance runners. Refactored `PPCRunner` to rely on a custom environment dictionary rather than `os.environ`, improving encapsulation and configurability. Enhanced error checks for required environment variables (`PPC_NUM_THREADS` and `PPC_NUM_PROC`).
1 parent a42c6be commit ab2242f

File tree

4 files changed

+84
-17
lines changed

4 files changed

+84
-17
lines changed

.github/workflows/main.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,22 @@ jobs:
134134
- name: Run func tests (threads, num_threads=1)
135135
run: python3 scripts/run_tests.py --running-type="threads"
136136
env:
137+
PPC_NUM_PROC: 1
137138
PPC_NUM_THREADS: 1
138139
- name: Run func tests (threads, num_threads=2)
139140
run: python3 scripts/run_tests.py --running-type="threads"
140141
env:
142+
PPC_NUM_PROC: 1
141143
PPC_NUM_THREADS: 2
142144
- name: Run func tests (threads, num_threads=3)
143145
run: python3 scripts/run_tests.py --running-type="threads"
144146
env:
147+
PPC_NUM_PROC: 1
145148
PPC_NUM_THREADS: 3
146149
- name: Run func tests (threads, num_threads=4)
147150
run: python3 scripts/run_tests.py --running-type="threads"
148151
env:
152+
PPC_NUM_PROC: 1
149153
PPC_NUM_THREADS: 4
150154
ubuntu-gcc-test-extended:
151155
needs:
@@ -172,18 +176,22 @@ jobs:
172176
- name: Run func tests (threads, num_threads=5)
173177
run: python3 scripts/run_tests.py --running-type="threads"
174178
env:
179+
PPC_NUM_PROC: 1
175180
PPC_NUM_THREADS: 5
176181
- name: Run func tests (threads, num_threads=7)
177182
run: python3 scripts/run_tests.py --running-type="threads"
178183
env:
184+
PPC_NUM_PROC: 1
179185
PPC_NUM_THREADS: 7
180186
- name: Run func tests (threads, num_threads=11)
181187
run: python3 scripts/run_tests.py --running-type="threads"
182188
env:
189+
PPC_NUM_PROC: 1
183190
PPC_NUM_THREADS: 11
184191
- name: Run func tests (threads, num_threads=13)
185192
run: python3 scripts/run_tests.py --running-type="threads"
186193
env:
194+
PPC_NUM_PROC: 1
187195
PPC_NUM_THREADS: 13
188196
ubuntu-clang-build:
189197
needs:
@@ -283,18 +291,22 @@ jobs:
283291
- name: Run tests (threads, num_threads=1)
284292
run: python3 scripts/run_tests.py --running-type="threads"
285293
env:
294+
PPC_NUM_PROC: 1
286295
PPC_NUM_THREADS: 1
287296
- name: Run tests (threads, num_threads=2)
288297
run: python3 scripts/run_tests.py --running-type="threads"
289298
env:
299+
PPC_NUM_PROC: 1
290300
PPC_NUM_THREADS: 2
291301
- name: Run tests (threads, num_threads=3)
292302
run: python3 scripts/run_tests.py --running-type="threads"
293303
env:
304+
PPC_NUM_PROC: 1
294305
PPC_NUM_THREADS: 3
295306
- name: Run tests (threads, num_threads=4)
296307
run: python3 scripts/run_tests.py --running-type="threads"
297308
env:
309+
PPC_NUM_PROC: 1
298310
PPC_NUM_THREADS: 4
299311
ubuntu-clang-test-extended:
300312
needs:
@@ -323,18 +335,22 @@ jobs:
323335
- name: Run tests (threads, num_threads=5)
324336
run: python3 scripts/run_tests.py --running-type="threads"
325337
env:
338+
PPC_NUM_PROC: 1
326339
PPC_NUM_THREADS: 5
327340
- name: Run tests (threads, num_threads=7)
328341
run: python3 scripts/run_tests.py --running-type="threads"
329342
env:
343+
PPC_NUM_PROC: 1
330344
PPC_NUM_THREADS: 7
331345
- name: Run tests (threads, num_threads=11)
332346
run: python3 scripts/run_tests.py --running-type="threads"
333347
env:
348+
PPC_NUM_PROC: 1
334349
PPC_NUM_THREADS: 11
335350
- name: Run tests (threads, num_threads=13)
336351
run: python3 scripts/run_tests.py --running-type="threads"
337352
env:
353+
PPC_NUM_PROC: 1
338354
PPC_NUM_THREADS: 13
339355
ubuntu-clang-sanitizer-build:
340356
needs:
@@ -424,27 +440,31 @@ jobs:
424440
- name: Run tests (threads, num_threads=1)
425441
run: python3 scripts/run_tests.py --running-type="threads"
426442
env:
443+
PPC_NUM_PROC: 1
427444
PPC_NUM_THREADS: 1
428445
PPC_ASAN_RUN: 1
429446
ASAN_OPTIONS: abort_on_error=1
430447
UBSAN_OPTIONS: halt_on_error=1
431448
- name: Run tests (threads, num_threads=2)
432449
run: python3 scripts/run_tests.py --running-type="threads"
433450
env:
451+
PPC_NUM_PROC: 1
434452
PPC_NUM_THREADS: 2
435453
PPC_ASAN_RUN: 1
436454
ASAN_OPTIONS: abort_on_error=1
437455
UBSAN_OPTIONS: halt_on_error=1
438456
- name: Run tests (threads, num_threads=3)
439457
run: python3 scripts/run_tests.py --running-type="threads"
440458
env:
459+
PPC_NUM_PROC: 1
441460
PPC_NUM_THREADS: 3
442461
PPC_ASAN_RUN: 1
443462
ASAN_OPTIONS: abort_on_error=1
444463
UBSAN_OPTIONS: halt_on_error=1
445464
- name: Run tests (threads, num_threads=4)
446465
run: python3 scripts/run_tests.py --running-type="threads"
447466
env:
467+
PPC_NUM_PROC: 1
448468
PPC_NUM_THREADS: 4
449469
PPC_ASAN_RUN: 1
450470
ASAN_OPTIONS: abort_on_error=1
@@ -477,21 +497,25 @@ jobs:
477497
- name: Run tests (threads, num_threads=5)
478498
run: python3 scripts/run_tests.py --running-type="threads"
479499
env:
500+
PPC_NUM_PROC: 1
480501
PPC_NUM_THREADS: 5
481502
PPC_ASAN_RUN: 1
482503
- name: Run tests (threads, num_threads=7)
483504
run: python3 scripts/run_tests.py --running-type="threads"
484505
env:
506+
PPC_NUM_PROC: 1
485507
PPC_NUM_THREADS: 7
486508
PPC_ASAN_RUN: 1
487509
- name: Run tests (threads, num_threads=11)
488510
run: python3 scripts/run_tests.py --running-type="threads"
489511
env:
512+
PPC_NUM_PROC: 1
490513
PPC_NUM_THREADS: 11
491514
PPC_ASAN_RUN: 1
492515
- name: Run tests (threads, num_threads=13)
493516
run: python3 scripts/run_tests.py --running-type="threads"
494517
env:
518+
PPC_NUM_PROC: 1
495519
PPC_NUM_THREADS: 13
496520
PPC_ASAN_RUN: 1
497521
macos-clang-build:
@@ -584,18 +608,22 @@ jobs:
584608
- name: Run tests (threads, num_threads=1)
585609
run: python3 scripts/run_tests.py --running-type="threads"
586610
env:
611+
PPC_NUM_PROC: 1
587612
PPC_NUM_THREADS: 1
588613
- name: Run tests (threads, num_threads=2)
589614
run: python3 scripts/run_tests.py --running-type="threads"
590615
env:
616+
PPC_NUM_PROC: 1
591617
PPC_NUM_THREADS: 2
592618
- name: Run tests (threads, num_threads=3)
593619
run: python3 scripts/run_tests.py --running-type="threads"
594620
env:
621+
PPC_NUM_PROC: 1
595622
PPC_NUM_THREADS: 3
596623
- name: Run tests (threads, num_threads=4)
597624
run: python3 scripts/run_tests.py --running-type="threads"
598625
env:
626+
PPC_NUM_PROC: 1
599627
PPC_NUM_THREADS: 4
600628
macos-clang-test-extended:
601629
needs:
@@ -622,18 +650,22 @@ jobs:
622650
- name: Run tests (threads, num_threads=5)
623651
run: python3 scripts/run_tests.py --running-type="threads"
624652
env:
653+
PPC_NUM_PROC: 1
625654
PPC_NUM_THREADS: 5
626655
- name: Run tests (threads, num_threads=7)
627656
run: python3 scripts/run_tests.py --running-type="threads"
628657
env:
658+
PPC_NUM_PROC: 1
629659
PPC_NUM_THREADS: 7
630660
- name: Run tests (threads, num_threads=11)
631661
run: python3 scripts/run_tests.py --running-type="threads"
632662
env:
663+
PPC_NUM_PROC: 1
633664
PPC_NUM_THREADS: 11
634665
- name: Run tests (threads, num_threads=13)
635666
run: python3 scripts/run_tests.py --running-type="threads"
636667
env:
668+
PPC_NUM_PROC: 1
637669
PPC_NUM_THREADS: 13
638670
windows-msvc-build:
639671
needs:
@@ -731,18 +763,22 @@ jobs:
731763
- name: Run tests (threads, num_threads=1)
732764
run: python3 scripts/run_tests.py --running-type="threads"
733765
env:
766+
PPC_NUM_PROC: 1
734767
PPC_NUM_THREADS: 1
735768
- name: Run tests (threads, num_threads=2)
736769
run: python3 scripts/run_tests.py --running-type="threads"
737770
env:
771+
PPC_NUM_PROC: 1
738772
PPC_NUM_THREADS: 2
739773
- name: Run tests (threads, num_threads=3)
740774
run: python3 scripts/run_tests.py --running-type="threads"
741775
env:
776+
PPC_NUM_PROC: 1
742777
PPC_NUM_THREADS: 3
743778
- name: Run tests (threads, num_threads=4)
744779
run: python3 scripts/run_tests.py --running-type="threads"
745780
env:
781+
PPC_NUM_PROC: 1
746782
PPC_NUM_THREADS: 4
747783
windows-msvc-test-extended:
748784
needs:
@@ -771,18 +807,22 @@ jobs:
771807
- name: Run tests (threads, num_threads=5)
772808
run: python3 scripts/run_tests.py --running-type="threads"
773809
env:
810+
PPC_NUM_PROC: 1
774811
PPC_NUM_THREADS: 5
775812
- name: Run tests (threads, num_threads=7)
776813
run: python3 scripts/run_tests.py --running-type="threads"
777814
env:
815+
PPC_NUM_PROC: 1
778816
PPC_NUM_THREADS: 7
779817
- name: Run tests (threads, num_threads=11)
780818
run: python3 scripts/run_tests.py --running-type="threads"
781819
env:
820+
PPC_NUM_PROC: 1
782821
PPC_NUM_THREADS: 11
783822
- name: Run tests (threads, num_threads=13)
784823
run: python3 scripts/run_tests.py --running-type="threads"
785824
env:
825+
PPC_NUM_PROC: 1
786826
PPC_NUM_THREADS: 13
787827
windows-clang-build:
788828
needs:
@@ -876,18 +916,22 @@ jobs:
876916
- name: Run tests (threads, num_threads=1)
877917
run: python3 scripts/run_tests.py --running-type="threads"
878918
env:
919+
PPC_NUM_PROC: 1
879920
PPC_NUM_THREADS: 1
880921
- name: Run tests (threads, num_threads=2)
881922
run: python3 scripts/run_tests.py --running-type="threads"
882923
env:
924+
PPC_NUM_PROC: 1
883925
PPC_NUM_THREADS: 2
884926
- name: Run tests (threads, num_threads=3)
885927
run: python3 scripts/run_tests.py --running-type="threads"
886928
env:
929+
PPC_NUM_PROC: 1
887930
PPC_NUM_THREADS: 3
888931
- name: Run tests (threads, num_threads=4)
889932
run: python3 scripts/run_tests.py --running-type="threads"
890933
env:
934+
PPC_NUM_PROC: 1
891935
PPC_NUM_THREADS: 4
892936
windows-clang-test-extended:
893937
needs:
@@ -916,18 +960,22 @@ jobs:
916960
- name: Run tests (threads, num_threads=5)
917961
run: python3 scripts/run_tests.py --running-type="threads"
918962
env:
963+
PPC_NUM_PROC: 1
919964
PPC_NUM_THREADS: 5
920965
- name: Run tests (threads, num_threads=7)
921966
run: python3 scripts/run_tests.py --running-type="threads"
922967
env:
968+
PPC_NUM_PROC: 1
923969
PPC_NUM_THREADS: 7
924970
- name: Run tests (threads, num_threads=11)
925971
run: python3 scripts/run_tests.py --running-type="threads"
926972
env:
973+
PPC_NUM_PROC: 1
927974
PPC_NUM_THREADS: 11
928975
- name: Run tests (threads, num_threads=13)
929976
run: python3 scripts/run_tests.py --running-type="threads"
930977
env:
978+
PPC_NUM_PROC: 1
931979
PPC_NUM_THREADS: 13
932980
ubuntu-gcc-build-codecov:
933981
needs:
@@ -967,18 +1015,22 @@ jobs:
9671015
- name: Run tests (threads, num_threads=1)
9681016
run: python3 scripts/run_tests.py --running-type="threads"
9691017
env:
1018+
PPC_NUM_PROC: 1
9701019
PPC_NUM_THREADS: 1
9711020
- name: Run tests (threads, num_threads=2)
9721021
run: python3 scripts/run_tests.py --running-type="threads"
9731022
env:
1023+
PPC_NUM_PROC: 1
9741024
PPC_NUM_THREADS: 2
9751025
- name: Run tests (threads, num_threads=3)
9761026
run: python3 scripts/run_tests.py --running-type="threads"
9771027
env:
1028+
PPC_NUM_PROC: 1
9781029
PPC_NUM_THREADS: 3
9791030
- name: Run tests (threads, num_threads=4)
9801031
run: python3 scripts/run_tests.py --running-type="threads"
9811032
env:
1033+
PPC_NUM_PROC: 1
9821034
PPC_NUM_THREADS: 4
9831035
- name: Generate gcovr Coverage Data
9841036
run: |

0 commit comments

Comments
 (0)