@@ -7,126 +7,72 @@ permissions:
7
7
contents : read
8
8
9
9
jobs :
10
- benchmarks-ubuntu :
11
- name : Ubuntu
10
+ benchmarks :
11
+ name : Benchmarks
12
+ env :
13
+ BUILD_DIR : " ${{github.workspace}}/build/"
14
+ VCPKG_PATH : " ${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows"
12
15
strategy :
13
16
matrix :
14
- os : ['ubuntu-22.04']
15
- build_type : [Release]
16
- compiler : [{c: gcc, cxx: g++}]
17
- shared_library : ['ON', 'OFF']
17
+ include :
18
+ - os : ubuntu-latest
19
+ pool_jemalloc : ' ON'
20
+
21
+ - os : windows-latest
22
+ pool_jemalloc : ' OFF'
23
+
18
24
runs-on : ${{matrix.os}}
19
25
20
26
steps :
21
27
- name : Checkout
22
28
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23
29
24
30
- name : Install apt packages
31
+ if : matrix.os == 'ubuntu-latest'
25
32
run : |
26
33
sudo apt-get update
27
34
sudo apt-get install -y cmake libhwloc-dev libnuma-dev libjemalloc-dev libtbb-dev
28
35
36
+ - name : Initialize vcpkg
37
+ if : matrix.os == 'windows-latest'
38
+ uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
39
+ with :
40
+ vcpkgGitCommitId : 3dd44b931481d7a8e9ba412621fa810232b66289
41
+ vcpkgDirectory : ${{env.BUILD_DIR}}/vcpkg
42
+ vcpkgJsonGlob : ' **/vcpkg.json'
43
+
44
+ - name : Install vcpkg packages
45
+ if : matrix.os == 'windows-latest'
46
+ run : vcpkg install
47
+ shell : pwsh # Specifies PowerShell as the shell for running the script.
48
+
29
49
- name : Configure build
30
50
run : >
31
51
cmake
32
- -B ${{github.workspace}}/build
33
- -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
34
- -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
35
- -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
36
- -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
52
+ -B ${{env.BUILD_DIR}}
53
+ -DCMAKE_BUILD_TYPE=Release
54
+ -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
55
+ -DUMF_BUILD_SHARED_LIBRARY=ON
37
56
-DUMF_BUILD_BENCHMARKS=ON
38
57
-DUMF_BUILD_BENCHMARKS_MT=ON
39
58
-DUMF_BUILD_TESTS=OFF
40
59
-DUMF_FORMAT_CODE_STYLE=OFF
41
60
-DUMF_DEVELOPER_MODE=OFF
42
61
-DUMF_BUILD_OS_MEMORY_PROVIDER=ON
43
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
44
62
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
63
+ -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=${{matrix.pool_jemalloc}}
45
64
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
46
65
-DUMF_ENABLE_POOL_TRACKING=OFF
47
66
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
48
67
49
- - name : Build UMF
50
- run : cmake --build ${{github.workspace}}/build -j $(nproc)
51
-
52
- - name : Run benchmarks
53
- working-directory : ${{github.workspace}}/build
54
- # The benchmark of TBB pool manager fails very often with the
55
- # "confidence interval exceeds maximum permitted 2.5%" error.
56
- # Do not treat that as a failure in CI.
57
- run : |
58
- export LOG=/tmp/ubench.log
59
- if ! ./benchmark/ubench 2>/dev/null > $LOG; then \
60
- cat $LOG; \
61
- if ! grep -q -e "exceeds maximum permitted 2.5" $LOG; then \
62
- echo "[ FAILED ] The CI benchmark job FAILED."; \
63
- exit 1; \
64
- fi; \
65
- fi
66
- cat $LOG
67
- echo "[ PASSED ] The CI benchmark job PASSED."
68
+ - name : Build UMF on Linux
69
+ if : matrix.os == 'ubuntu-latest'
70
+ run : cmake --build ${{env.BUILD_DIR}} -j $(nproc)
68
71
69
- - name : Run MT benchmarks
70
- working-directory : ${{github.workspace}}/build
71
- run : ./benchmark/multithread_bench
72
+ - name : Build UMF on Windows
73
+ if : matrix.os == 'windows-latest'
74
+ run : cmake --build ${{env.BUILD_DIR}} --config Release -j $Env:NUMBER_OF_PROCESSORS
72
75
73
- benchmarks-windows :
74
- name : Windows
75
- env :
76
- BUILD_DIR : " ${{github.workspace}}/build/"
77
- VCPKG_PATH : " ${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows"
78
- VCPKG_PATH_BIN : " ${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows/bin;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows/bin"
79
- strategy :
80
- fail-fast : false
81
- matrix :
82
- build_type : [Release]
83
- compiler : [{c: cl, cxx: cl}]
84
- shared_library : ['ON', 'OFF']
85
- runs-on : ' windows-2022'
86
-
87
- steps :
88
- - name : Checkout
89
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
90
-
91
- - name : Initialize vcpkg
92
- uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
93
- with :
94
- vcpkgGitCommitId : 3dd44b931481d7a8e9ba412621fa810232b66289
95
- vcpkgDirectory : ${{github.workspace}}/build/vcpkg
96
- vcpkgJsonGlob : ' **/vcpkg.json'
97
-
98
- - name : Install dependencies
99
- run : vcpkg install
100
- shell : pwsh # Specifies PowerShell as the shell for running the script.
101
-
102
- - name : Configure build
103
- run : >
104
- cmake
105
- -B ${{env.BUILD_DIR}}
106
- -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
107
- -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
108
- -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
109
- -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
110
- -DUMF_BUILD_BENCHMARKS=ON
111
- -DUMF_BUILD_BENCHMARKS_MT=OFF
112
- -DUMF_BUILD_TESTS=OFF
113
- -DUMF_FORMAT_CODE_STYLE=OFF
114
- -DUMF_DEVELOPER_MODE=OFF
115
- -DUMF_BUILD_OS_MEMORY_PROVIDER=ON
116
- -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
117
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
118
- -DUMF_BUILD_LIBUMF_POOL_SCALABLE=OFF
119
- -DUMF_ENABLE_POOL_TRACKING=OFF
120
-
121
- - name : Build UMF
122
- run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
123
-
124
- - name : Run benchmarks
125
- working-directory : ${{env.BUILD_DIR}}
126
- shell : pwsh # Specifies PowerShell as the shell for running the script.
127
- run : |
128
- # add path to umf.dll
129
- $env:PATH += ";${{env.BUILD_DIR}}\bin\${{matrix.build_type}}"
130
- # add path to DLL directories
131
- $env:PATH += ";${{env.VCPKG_PATH_BIN}}"
132
- .\benchmark\${{matrix.build_type}}\ubench.exe
76
+ - name : Run benchmarks
77
+ working-directory : ${{env.BUILD_DIR}}
78
+ run : ctest -V --test-dir benchmark -C Release
0 commit comments