@@ -7,125 +7,74 @@ 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
+ pool_scalable : ' ON'
20
+ pool_jemalloc : ' ON'
21
+
22
+ - os : windows-latest # shared library on Windows
23
+ pool_scalable : ' OFF'
24
+ pool_jemalloc : ' OFF'
25
+
18
26
runs-on : ${{matrix.os}}
19
27
20
28
steps :
21
29
- name : Checkout
22
30
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23
31
24
32
- name : Install apt packages
33
+ if : matrix.os == 'ubuntu-latest'
25
34
run : |
26
35
sudo apt-get update
27
36
sudo apt-get install -y cmake libhwloc-dev libnuma-dev libjemalloc-dev libtbb-dev
28
37
38
+ - name : Initialize vcpkg
39
+ if : matrix.os == 'windows-latest'
40
+ uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
41
+ with :
42
+ vcpkgGitCommitId : 3dd44b931481d7a8e9ba412621fa810232b66289
43
+ vcpkgDirectory : ${{env.BUILD_DIR}}/vcpkg
44
+ vcpkgJsonGlob : ' **/vcpkg.json'
45
+
46
+ - name : Install vcpkg packages
47
+ if : matrix.os == 'windows-latest'
48
+ run : vcpkg install
49
+ shell : pwsh # Specifies PowerShell as the shell for running the script.
50
+
29
51
- name : Configure build
30
52
run : >
31
53
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}}
54
+ -B ${{env.BUILD_DIR}}
55
+ -DCMAKE_BUILD_TYPE=Release
56
+ -DCMAKE_PREFIX_PATH="${{env.HWLOC_PATH}}"
57
+ -DUMF_BUILD_SHARED_LIBRARY=ON
37
58
-DUMF_BUILD_BENCHMARKS=ON
38
59
-DUMF_BUILD_BENCHMARKS_MT=ON
39
60
-DUMF_BUILD_TESTS=OFF
40
61
-DUMF_FORMAT_CODE_STYLE=OFF
41
62
-DUMF_DEVELOPER_MODE=OFF
42
63
-DUMF_BUILD_OS_MEMORY_PROVIDER=ON
43
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
44
64
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
45
- -DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
65
+ -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=${{matrix.pool_jemalloc}}
66
+ -DUMF_BUILD_LIBUMF_POOL_SCALABLE=${{matrix.pool_scalable}}
46
67
-DUMF_ENABLE_POOL_TRACKING=OFF
47
68
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
48
69
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."
70
+ - name : Build UMF on Linux
71
+ if : matrix.os == 'ubuntu-latest'
72
+ run : cmake --build ${{env.BUILD_DIR}} -j $(nproc)
68
73
69
- - name : Run MT benchmarks
70
- working-directory : ${{github.workspace}}/build
71
- run : ./benchmark/multithread_bench
74
+ - name : Build UMF on Windows
75
+ if : matrix.os == 'windows-latest'
76
+ run : cmake --build ${{env.BUILD_DIR}} --config Release -j $Env:NUMBER_OF_PROCESSORS
72
77
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
78
+ - name : Run benchmarks
79
+ working-directory : ${{env.BUILD_DIR}}
80
+ run : ctest -V --test-dir benchmark -C Release
0 commit comments