@@ -7,125 +7,89 @@ 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
+ HWLOC_PATH : " ${{github.workspace}}/build/vcpkg/packages/hwloc_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 # shared library on Linux
19
+ shared_library : ' ON'
20
+ pool_scalable : ' ON'
21
+ pool_jemalloc : ' ON'
22
+ bench_mt : ' ON'
23
+
24
+ - os : ubuntu-latest # static library on Linux
25
+ shared_library : ' OFF'
26
+ pool_scalable : ' ON'
27
+ pool_jemalloc : ' ON'
28
+ bench_mt : ' ON'
29
+
30
+ - os : windows-latest # shared library on Windows
31
+ shared_library : ' ON'
32
+ pool_scalable : ' OFF'
33
+ pool_jemalloc : ' OFF'
34
+ bench_mt : ' OFF' # TODO: enable multithread_bench on Windows
35
+
36
+ - os : windows-latest # static library on Windows
37
+ shared_library : ' OFF'
38
+ pool_scalable : ' OFF'
39
+ bench_mt : ' OFF' # TODO: enable multithread_bench on Windows
40
+
18
41
runs-on : ${{matrix.os}}
19
42
20
43
steps :
21
44
- name : Checkout
22
45
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23
46
24
47
- name : Install apt packages
48
+ if : matrix.os == 'ubuntu-latest'
25
49
run : |
26
50
sudo apt-get update
27
51
sudo apt-get install -y cmake libhwloc-dev libnuma-dev libjemalloc-dev libtbb-dev
28
52
53
+ - name : Initialize vcpkg
54
+ if : matrix.os == 'windows-latest'
55
+ uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
56
+ with :
57
+ vcpkgGitCommitId : 3dd44b931481d7a8e9ba412621fa810232b66289
58
+ vcpkgDirectory : ${{env.BUILD_DIR}}/vcpkg
59
+ vcpkgJsonGlob : ' **/vcpkg.json'
60
+
61
+ - name : Install dependencies
62
+ if : matrix.os == 'windows-latest'
63
+ run : vcpkg install
64
+ shell : pwsh # Specifies PowerShell as the shell for running the script.
65
+
29
66
- name : Configure build
30
67
run : >
31
68
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}}
69
+ -B ${{env.BUILD_DIR}}
70
+ -DCMAKE_BUILD_TYPE=Release
71
+ -DCMAKE_PREFIX_PATH="${{env.HWLOC_PATH}}"
36
72
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
37
73
-DUMF_BUILD_BENCHMARKS=ON
38
- -DUMF_BUILD_BENCHMARKS_MT=ON
74
+ -DUMF_BUILD_BENCHMARKS_MT=${{matrix.bench_mt}}
39
75
-DUMF_BUILD_TESTS=OFF
40
76
-DUMF_FORMAT_CODE_STYLE=OFF
41
77
-DUMF_DEVELOPER_MODE=OFF
42
78
-DUMF_BUILD_OS_MEMORY_PROVIDER=ON
43
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
44
79
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
45
- -DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
80
+ -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=${{matrix.pool_jemalloc}}
81
+ -DUMF_BUILD_LIBUMF_POOL_SCALABLE=${{matrix.pool_scalable}}
46
82
-DUMF_ENABLE_POOL_TRACKING=OFF
47
83
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
48
84
49
- - name : Build UMF
50
- run : cmake --build ${{github.workspace}}/build -j $(nproc)
85
+ - name : Build UMF on Linux
86
+ if : matrix.os == 'ubuntu-latest'
87
+ run : cmake --build ${{env.BUILD_DIR}} -j $(nproc)
51
88
89
+ - name : Build UMF on Windows
90
+ if : matrix.os == 'windows-latest'
91
+ run : cmake --build ${{env.BUILD_DIR}} --config Release -j $Env:NUMBER_OF_PROCESSORS
92
+
52
93
- 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
-
69
- - name : Run MT benchmarks
70
- working-directory : ${{github.workspace}}/build
71
- run : ./benchmark/multithread_bench
72
-
73
- benchmarks-windows :
74
- name : Windows
75
- env :
76
- BUILD_DIR : " ${{github.workspace}}/build/"
77
- HWLOC_PATH : " ${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows"
78
- strategy :
79
- fail-fast : false
80
- matrix :
81
- build_type : [Release]
82
- compiler : [{c: cl, cxx: cl}]
83
- shared_library : ['ON', 'OFF']
84
- runs-on : ' windows-2022'
85
-
86
- steps :
87
- - name : Checkout
88
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
89
-
90
- - name : Initialize vcpkg
91
- uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
92
- with :
93
- vcpkgGitCommitId : 3dd44b931481d7a8e9ba412621fa810232b66289
94
- vcpkgDirectory : ${{github.workspace}}/build/vcpkg
95
- vcpkgJsonGlob : ' **/vcpkg.json'
96
-
97
- - name : Install dependencies
98
- run : vcpkg install
99
- shell : pwsh # Specifies PowerShell as the shell for running the script.
100
-
101
- - name : Configure build
102
- run : >
103
- cmake
104
- -B ${{env.BUILD_DIR}}
105
- -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
106
- -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
107
- -DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
108
- -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
109
- -DUMF_BUILD_BENCHMARKS=ON
110
- -DUMF_BUILD_BENCHMARKS_MT=OFF
111
- -DUMF_BUILD_TESTS=OFF
112
- -DUMF_FORMAT_CODE_STYLE=OFF
113
- -DUMF_DEVELOPER_MODE=OFF
114
- -DUMF_BUILD_OS_MEMORY_PROVIDER=ON
115
- -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
116
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
117
- -DUMF_BUILD_LIBUMF_POOL_SCALABLE=OFF
118
- -DUMF_ENABLE_POOL_TRACKING=OFF
119
-
120
- - name : Build UMF
121
- run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
122
-
123
- - name : Run benchmarks
124
- working-directory : ${{env.BUILD_DIR}}
125
- shell : pwsh # Specifies PowerShell as the shell for running the script.
126
- run : |
127
- # add path to umf.dll
128
- $env:PATH += ";${{env.BUILD_DIR}}\bin\${{matrix.build_type}}"
129
- # add path to hwloc-15.dll
130
- $env:PATH += ";${{env.HWLOC_PATH}}\bin"
131
- .\benchmark\${{matrix.build_type}}\ubench.exe
94
+ working-directory : ${{env.BUILD_DIR}}
95
+ run : ctest -V --test-dir benchmark -C Release
0 commit comments