46
46
ASAN_OPTIONS : suppressions=${{ github.workspace }}/.github/asan.supp:malloc_context_size=20:detect_leaks=1:verify_asan_link_order=0:detect_stack_use_after_return=1:detect_odr_violation=1:new_delete_type_mismatch=0:intercept_tls_get_addr=0
47
47
LSAN_OPTIONS : suppressions=${{ github.workspace }}/.github/lsan.supp
48
48
UBSAN_OPTIONS : suppressions=${{ github.workspace }}/.github/ubsan.supp:print_stacktrace=1:silence_unsigned_overflow=1:report_error_type=1
49
+ TSAN_OPTIONS : suppressions=${{ github.workspace }}/.github/tsan.supp
49
50
50
51
jobs :
51
52
env :
70
71
matrix :
71
72
CXX : [g++, clang++]
72
73
CMAKE_BUILD_TYPE : [Release, Debug]
74
+ USE_ASAN : [ON]
75
+ USE_TSAN : [OFF]
76
+ USE_UBSAN : [ON]
73
77
release : ${{ fromJSON(needs.env.outputs.release_json) }}
74
78
# note that entries that overwrite matrix values require a full specification
75
79
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow#expanding-or-adding-matrix-configurations
@@ -97,6 +101,13 @@ jobs:
97
101
- CXX : clang++
98
102
CMAKE_BUILD_TYPE : Release
99
103
release : nightly
104
+ - CXX : clang++
105
+ # thread sanitizer build
106
+ - CXX : clang++
107
+ CMAKE_BUILD_TYPE : Release
108
+ release : nightly
109
+ USE_ASAN : OFF
110
+ USE_TSAN : ON
100
111
- CXX : clang++
101
112
CMAKE_BUILD_TYPE : Release
102
113
release : 24.09.0-stable
@@ -115,12 +126,13 @@ jobs:
115
126
uses : actions/cache@v4
116
127
with :
117
128
path : .ccache
118
- key : ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.head_ref || github.ref_name }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
129
+ key : ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{matrix.USE_ASAN}}-${{matrix.USE_TSAN}}-${{ github.head_ref || github.ref_name }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
119
130
restore-keys : |
120
- ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.ref_name }}-
121
- ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.head_ref }}-
122
- ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.base_ref }}-
123
- ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.event.merge_group.base_ref }}-
131
+ ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{matrix.USE_ASAN}}-${{matrix.USE_TSAN}}-${{ github.ref_name }}-
132
+ ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{matrix.USE_ASAN}}-${{matrix.USE_TSAN}}-${{ github.head_ref }}-
133
+ ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{matrix.USE_ASAN}}-${{matrix.USE_TSAN}}-${{ github.base_ref }}-
134
+ ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{matrix.USE_ASAN}}-${{matrix.USE_TSAN}}-${{ github.event.merge_group.base_ref }}-
135
+ ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{matrix.USE_ASAN}}-${{matrix.USE_TSAN}}-
124
136
ccache-${{ matrix.CXX }}-${{ matrix.release }}-${{ matrix.CMAKE_BUILD_TYPE }}-
125
137
ccache-${{ matrix.CXX }}-${{ matrix.release }}-
126
138
ccache-${{ matrix.CXX }}-
@@ -138,7 +150,7 @@ jobs:
138
150
platform-release : " ${{ env.platform }}:${{ matrix.release }}"
139
151
run : |
140
152
# install this repo
141
- CXX="${{ matrix.CXX }}" CXXFLAGS="${{ matrix.CXXFLAGS }}" cmake --warn-uninitialized -B build -S . -DCMAKE_INSTALL_PREFIX=install -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DUSE_ASAN=ON -DUSE_TSAN=OFF -DUSE_UBSAN=ON
153
+ CXX="${{ matrix.CXX }}" CXXFLAGS="${{ matrix.CXXFLAGS }}" cmake --warn-uninitialized -B build -S . -DCMAKE_INSTALL_PREFIX=install -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DUSE_ASAN=${{matrix.USE_ASAN}} -DUSE_TSAN=${{matrix.USE_TSAN}} -DUSE_UBSAN=${{matrix.USE_UBSAN}}
142
154
cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target install
143
155
ccache --show-stats --verbose
144
156
ccache --evict-older-than 7d
@@ -164,10 +176,18 @@ jobs:
164
176
ctest --test-dir build -V
165
177
- name : Compress install directory
166
178
run : tar -caf install.tar.zst install/
167
- - name : Upload install directory
179
+ - name : Upload install directory (ASAN)
180
+ if : ${{ matrix.USE_ASAN == 'ON' && matrix.USE_TSAN == 'OFF' }}
168
181
uses : actions/upload-artifact@v4
169
182
with :
170
- name : install-${{ matrix.CXX }}-eic-shell-${{ matrix.CMAKE_BUILD_TYPE }}-${{ env.platform }}-${{ matrix.release }}
183
+ name : install-${{ matrix.CXX }}-eic-shell-${{ matrix.CMAKE_BUILD_TYPE }}-${{ env.platform }}-${{ matrix.release }}-ASAN
184
+ path : install.tar.zst
185
+ if-no-files-found : error
186
+ - name : Upload install directory (TSAN)
187
+ if : ${{ matrix.USE_ASAN == 'OFF' && matrix.USE_TSAN == 'ON' }}
188
+ uses : actions/upload-artifact@v4
189
+ with :
190
+ name : install-${{ matrix.CXX }}-eic-shell-${{ matrix.CMAKE_BUILD_TYPE }}-${{ env.platform }}-${{ matrix.release }}-TSAN
171
191
path : install.tar.zst
172
192
if-no-files-found : error
173
193
# Only compress and upload build directory if we are going to use it later
@@ -487,7 +507,7 @@ jobs:
487
507
- name : Download install directory
488
508
uses : actions/download-artifact@v4
489
509
with :
490
- name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}
510
+ name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}-ASAN
491
511
- name : Unarchive install directory
492
512
run : tar -xaf install.tar.zst
493
513
- name : Download simulation input
@@ -547,7 +567,7 @@ jobs:
547
567
- name : Download install directory
548
568
uses : actions/download-artifact@v4
549
569
with :
550
- name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}
570
+ name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}-ASAN
551
571
- name : Unarchive install directory
552
572
run : tar -xaf install.tar.zst
553
573
- uses : actions/download-artifact@v4
@@ -590,7 +610,7 @@ jobs:
590
610
- name : Download install directory
591
611
uses : actions/download-artifact@v4
592
612
with :
593
- name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}
613
+ name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}-ASAN
594
614
- name : Unarchive install directory
595
615
run : tar -xaf install.tar.zst
596
616
- uses : actions/download-artifact@v4
@@ -639,7 +659,7 @@ jobs:
639
659
- name : Download install directory
640
660
uses : actions/download-artifact@v4
641
661
with :
642
- name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}
662
+ name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}-ASAN
643
663
- name : Unarchive install directory
644
664
run : tar -xaf install.tar.zst
645
665
- uses : actions/download-artifact@v4
@@ -680,7 +700,7 @@ jobs:
680
700
- name : Download install directory
681
701
uses : actions/download-artifact@v4
682
702
with :
683
- name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}
703
+ name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}-ASAN
684
704
- name : Uncompress install directory
685
705
run : tar -xaf install.tar.zst
686
706
- uses : actions/download-artifact@v4
@@ -790,7 +810,7 @@ jobs:
790
810
- name : Download install directory
791
811
uses : actions/download-artifact@v4
792
812
with :
793
- name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}
813
+ name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}-ASAN
794
814
- name : Unarchive install directory
795
815
run : tar -xaf install.tar.zst
796
816
- uses : actions/download-artifact@v4
@@ -841,29 +861,47 @@ jobs:
841
861
- build
842
862
- npsim-dis
843
863
- npsim-minbias
864
+ continue-on-error : ${{ matrix.nthreads > 1 }}
844
865
strategy :
845
866
matrix :
846
867
include :
847
868
- CXX : clang++
848
869
beam : 5x41
849
870
minq2 : 0
850
871
detector_config : craterlake_5x41
872
+ sanitizer : ASAN
851
873
- CXX : clang++
852
874
beam : 10x100
853
875
minq2 : 0
854
876
detector_config : craterlake_10x100
877
+ sanitizer : TSAN
855
878
- CXX : clang++
856
879
beam : 18x275
857
880
minq2 : 0
858
881
detector_config : craterlake_18x275
882
+ sanitizer : ASAN
883
+ - CXX : clang++
884
+ beam : 18x275
885
+ minq2 : 0
886
+ detector_config : craterlake_18x275
887
+ sanitizer : TSAN
888
+ nthreads : 4
859
889
- CXX : clang++
860
890
beam : 10x100
861
891
minq2 : 1000
862
892
detector_config : craterlake_tracking_only
893
+ sanitizer : ASAN
894
+ - CXX : clang++
895
+ beam : 18x275
896
+ minq2 : 1000
897
+ detector_config : craterlake_18x275
898
+ sanitizer : ASAN
863
899
- CXX : clang++
864
900
beam : 18x275
865
901
minq2 : 1000
866
902
detector_config : craterlake_18x275
903
+ sanitizer : TSAN
904
+ nthreads : 4
867
905
steps :
868
906
- name : Checkout .github
869
907
uses : actions/checkout@v4
@@ -872,7 +910,7 @@ jobs:
872
910
- name : Download install directory
873
911
uses : actions/download-artifact@v4
874
912
with :
875
- name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}
913
+ name : install-${{ matrix.CXX }}-eic-shell-Release-${{ env.platform }}-${{ env.release }}-${{ matrix.sanitizer }}
876
914
- name : Unarchive install directory
877
915
run : tar -xaf install.tar.zst
878
916
- uses : actions/download-artifact@v4
@@ -891,15 +929,15 @@ jobs:
891
929
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH
892
930
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins:/usr/local/plugins
893
931
prmon --json-summary rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.prmon.json -- \
894
- $PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} -Ppodio:output_file=rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -Pacts:WriteObj=true -Pacts:WritePly=true -Pplugins=janadot,janatop $(<${{ github.workspace }}/.github/janadot.groups)
932
+ $PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{matrix.nthreads > 1 && format('-Pnthreads={0}', matrix.nthreads) || ''}} -Ppodio:output_file=rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -Pacts:WriteObj=true -Pacts:WritePly=true -Pplugins=janadot,janatop $(<${{ github.workspace }}/.github/janadot.groups)
895
933
- uses : actions/upload-artifact@v4
896
934
with :
897
- name : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root
935
+ name : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}} .edm4eic.root
898
936
path : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root
899
937
if-no-files-found : error
900
938
- uses : actions/upload-artifact@v4
901
939
with :
902
- name : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.prmon.json
940
+ name : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}} .prmon.json
903
941
path : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.prmon.json
904
942
if-no-files-found : error
905
943
- name : Convert execution graphs
@@ -914,21 +952,21 @@ jobs:
914
952
continue-on-error : true
915
953
- uses : actions/upload-artifact@v4
916
954
with :
917
- name : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.dot
955
+ name : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}} .dot
918
956
path : |
919
957
*.dot
920
958
*.svg
921
959
if-no-files-found : error
922
960
- uses : actions/upload-artifact@v4
923
961
with :
924
- name : obj_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}
962
+ name : obj_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}
925
963
path : |
926
964
*.mtl
927
965
*.obj
928
966
if-no-files-found : error
929
967
- uses : actions/upload-artifact@v4
930
968
with :
931
- name : ply_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}
969
+ name : ply_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}
932
970
path : |
933
971
*.ply
934
972
if-no-files-found : error
@@ -938,6 +976,9 @@ jobs:
938
976
with :
939
977
branch : ${{ github.base_ref || github.event.merge_group.base_ref || github.ref_name }}
940
978
path : ref/
979
+ # FIXME: compare multi-threaded here with single-threaded reference
980
+ # since multi-threaded has issues with randomness reproducibility
981
+ # name: rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}.edm4eic.root
941
982
name : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root
942
983
workflow : " .github/workflows/linux-eic-shell.yml"
943
984
workflow_conclusion : " completed"
@@ -953,15 +994,17 @@ jobs:
953
994
ln -sf ../rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root new/
954
995
# using nullglob to ensure ref/* does not fail
955
996
shopt -s nullglob
997
+ # FIXME: compare multi-threaded here with single-threaded reference
998
+ #capybara bara ref/*rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}.edm4eic.root new/rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root
956
999
capybara bara ref/*rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root new/rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root
957
- mv capybara-reports rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}
958
- touch .rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}
1000
+ mv capybara-reports rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}
1001
+ touch .rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}
959
1002
- uses : actions/upload-artifact@v4
960
1003
with :
961
- name : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.capy
1004
+ name : rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}} .capy
962
1005
path : |
963
- .rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}
964
- rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}/
1006
+ .rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}
1007
+ rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}} /
965
1008
if-no-files-found : error
966
1009
967
1010
trigger-container :
0 commit comments