Skip to content

Commit 3c2513c

Browse files
authored
Merge pull request #472 from bratpiorka/rrudnick_scalable_always
merge scalable_pool with UMF
2 parents 8d8243f + 5f486f1 commit 3c2513c

27 files changed

+122
-132
lines changed

.github/workflows/basic.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,53 @@ jobs:
2020
compiler: [{c: gcc, cxx: g++}]
2121
shared_library: ['OFF']
2222
level_zero_provider: ['ON']
23+
install_tbb: ['ON']
2324
include:
2425
- os: 'ubuntu-20.04'
2526
build_type: Release
2627
compiler: {c: gcc-7, cxx: g++-7}
2728
shared_library: 'OFF'
2829
level_zero_provider: 'ON'
30+
install_tbb: 'ON'
2931
- os: 'ubuntu-22.04'
3032
build_type: Release
3133
compiler: {c: clang, cxx: clang++}
3234
shared_library: 'OFF'
3335
level_zero_provider: 'ON'
36+
install_tbb: 'ON'
3437
- os: 'ubuntu-22.04'
3538
build_type: Release
3639
compiler: {c: gcc, cxx: g++}
3740
shared_library: 'ON'
3841
level_zero_provider: 'ON'
42+
install_tbb: 'ON'
3943
- os: 'ubuntu-22.04'
4044
build_type: Debug
4145
compiler: {c: gcc, cxx: g++}
4246
shared_library: 'ON'
4347
level_zero_provider: 'ON'
48+
install_tbb: 'ON'
4449
# test level_zero_provider='OFF'
4550
- os: 'ubuntu-22.04'
4651
build_type: Release
4752
compiler: {c: gcc, cxx: g++}
4853
shared_library: 'OFF'
4954
level_zero_provider: 'OFF'
55+
install_tbb: 'ON'
5056
# test icx compiler
5157
- os: 'ubuntu-22.04'
5258
build_type: Release
5359
compiler: {c: icx, cxx: icpx}
5460
shared_library: 'ON'
5561
level_zero_provider: 'ON'
62+
install_tbb: 'ON'
63+
# test without installing TBB
64+
- os: 'ubuntu-22.04'
65+
build_type: Release
66+
compiler: {c: gcc, cxx: g++}
67+
shared_library: 'ON'
68+
level_zero_provider: 'ON'
69+
install_tbb: 'OFF'
5670
env:
5771
BUILD_DIR : "${{github.workspace}}/build/"
5872
INSTL_DIR : "${{github.workspace}}/../install-dir"
@@ -65,7 +79,12 @@ jobs:
6579
- name: Install apt packages
6680
run: |
6781
sudo apt-get update
68-
sudo apt-get install -y clang cmake libnuma-dev libjemalloc-dev libtbb-dev
82+
sudo apt-get install -y clang cmake libnuma-dev libjemalloc-dev
83+
84+
- name: Install TBB apt package
85+
if: matrix.install_tbb == 'ON'
86+
run: |
87+
sudo apt-get install -y libtbb-dev
6988
7089
- name: Install oneAPI basekit
7190
if: matrix.compiler.cxx == 'icpx'
@@ -101,7 +120,6 @@ jobs:
101120
-DUMF_DEVELOPER_MODE=ON
102121
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
103122
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
104-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
105123
-DUMF_TESTS_FAIL_ON_SKIP=ON
106124
107125
- name: Build UMF
@@ -122,7 +140,7 @@ jobs:
122140
--build-type ${{matrix.build_type}}
123141
--disjoint-pool
124142
--jemalloc-pool
125-
--scalable-pool
143+
${{ matrix.install_tbb == 'ON' && '--proxy' || '' }}
126144
--umf-version ${{env.UMF_VERSION}}
127145
${{ matrix.shared_library == 'ON' && '--shared-library' || '' }}
128146
@@ -186,7 +204,6 @@ jobs:
186204
-DUMF_FORMAT_CODE_STYLE=OFF
187205
-DUMF_DEVELOPER_MODE=ON
188206
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
189-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
190207
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
191208
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
192209
-DUMF_TESTS_FAIL_ON_SKIP=ON
@@ -207,7 +224,7 @@ jobs:
207224
--build-type ${{matrix.build_type}}
208225
--disjoint-pool
209226
--jemalloc-pool
210-
--scalable-pool
227+
--proxy
211228
--umf-version ${{env.UMF_VERSION}}
212229
${{ matrix.shared_library == 'ON' && '--shared-library' || ''}}
213230
@@ -242,7 +259,6 @@ jobs:
242259
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
243260
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
244261
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
245-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
246262
-DUMF_BUILD_SHARED_LIBRARY=ON
247263
-DUMF_TESTS_FAIL_ON_SKIP=ON
248264
@@ -257,6 +273,6 @@ jobs:
257273
--build-type ${{env.BUILD_TYPE}}
258274
--disjoint-pool
259275
--jemalloc-pool
260-
--scalable-pool
276+
--proxy
261277
--umf-version ${{env.UMF_VERSION}}
262278
--shared-library

.github/workflows/benchmarks.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
6060
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
6161
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
62-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
6362
6463
- name: Build UMF on Linux
6564
if: matrix.os == 'ubuntu-latest'

.github/workflows/codeql.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ jobs:
7171
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
7272
-DUMF_FORMAT_CODE_STYLE=OFF
7373
-DUMF_DEVELOPER_MODE=ON
74-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
7574
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
7675
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
7776
-DUMF_TESTS_FAIL_ON_SKIP=ON

.github/workflows/coverity.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ jobs:
4444
-DUMF_FORMAT_CODE_STYLE=OFF
4545
-DUMF_DEVELOPER_MODE=OFF
4646
-DUMF_TESTS_FAIL_ON_SKIP=ON
47-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
4847
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
4948
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
5049

.github/workflows/gpu.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
-DUMF_FORMAT_CODE_STYLE=OFF
5555
-DUMF_DEVELOPER_MODE=ON
5656
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
57-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
5857
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
5958
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
6059
-DUMF_TESTS_FAIL_ON_SKIP=ON
@@ -75,7 +74,6 @@ jobs:
7574
-DUMF_FORMAT_CODE_STYLE=OFF
7675
-DUMF_DEVELOPER_MODE=ON
7776
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
78-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
7977
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
8078
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
8179
-DUMF_TESTS_FAIL_ON_SKIP=ON

.github/workflows/multi_numa.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
-DUMF_DEVELOPER_MODE=ON
3838
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
3939
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
40-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
4140
-DUMF_TESTS_FAIL_ON_SKIP=ON
4241
4342
- name: Build UMF

.github/workflows/nightly.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
-DCMAKE_BUILD_TYPE=Debug
3636
-DUMF_FORMAT_CODE_STYLE=OFF
3737
-DUMF_DEVELOPER_MODE=ON
38-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
3938
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
4039
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
4140
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF

.github/workflows/pr_push.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ jobs:
8585
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
8686
-DUMF_FORMAT_CODE_STYLE=OFF
8787
-DUMF_DEVELOPER_MODE=ON
88-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
8988
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=${{matrix.disjoint}}
9089
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
9190
-DUMF_BUILD_TESTS=${{matrix.build_tests}}
@@ -136,7 +135,6 @@ jobs:
136135
-DUMF_FORMAT_CODE_STYLE=ON
137136
-DUMF_BUILD_TESTS=OFF
138137
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
139-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=OFF
140138
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
141139
142140
- name: Check C/C++ formatting

.github/workflows/proxy_lib.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ jobs:
4444
-DUMF_DEVELOPER_MODE=OFF
4545
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
4646
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
47-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
4847
-DUMF_TESTS_FAIL_ON_SKIP=ON
4948
-DUMF_PROXY_LIB_BASED_ON_POOL=${{matrix.proxy_lib_pool}}
5049

.github/workflows/sanitizers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ jobs:
5555
-DUMF_DEVELOPER_MODE=ON
5656
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
5757
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
58-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
5958
-DUSE_ASAN=${{matrix.sanitizers.asan}}
6059
-DUSE_UBSAN=${{matrix.sanitizers.ubsan}}
6160
-DUSE_TSAN=${{matrix.sanitizers.tsan}}

.github/workflows/valgrind.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
-DCMAKE_BUILD_TYPE=Debug
3131
-DUMF_FORMAT_CODE_STYLE=OFF
3232
-DUMF_DEVELOPER_MODE=ON
33-
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
3433
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
3534
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
3635
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF

CMakeLists.txt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ option(UMF_BUILD_LIBUMF_POOL_DISJOINT
3131
"Build the libumf_pool_disjoint static library" OFF)
3232
option(UMF_BUILD_LIBUMF_POOL_JEMALLOC
3333
"Build the libumf_pool_jemalloc static library" OFF)
34-
option(UMF_BUILD_LIBUMF_POOL_SCALABLE
35-
"Build the libumf_pool_scalable static library" OFF)
3634
option(UMF_BUILD_TESTS "Build UMF tests" ON)
3735
option(UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF)
3836
option(UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF)
@@ -199,14 +197,21 @@ endif()
199197
set(DLL_PATH_LIST
200198
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_LIBRARY_DIRS}/../bin")
201199

202-
if(UMF_BUILD_LIBUMF_POOL_SCALABLE)
203-
pkg_check_modules(TBB tbb)
204-
if(NOT TBB_FOUND)
205-
find_package(TBB REQUIRED tbb)
206-
endif()
200+
pkg_check_modules(TBB tbb)
201+
if(NOT TBB_FOUND)
202+
find_package(TBB OPTIONAL_COMPONENTS tbb)
203+
endif()
204+
if(TBB_FOUND OR TBB_LIBRARY_DIRS)
207205
# add PATH to DLL on Windows
208206
set(DLL_PATH_LIST
209207
"${DLL_PATH_LIST};PATH=path_list_append:${TBB_LIBRARY_DIRS}/../bin")
208+
set(UMF_POOL_SCALABLE_ENABLED TRUE)
209+
else()
210+
message(
211+
STATUS
212+
"Disabling tests and benchmarks that use the Scalable Pool because the TBB they require was not found."
213+
)
214+
set(UMF_POOL_SCALABLE_ENABLED FALSE)
210215
endif()
211216

212217
if(UMF_BUILD_LIBUMF_POOL_JEMALLOC)
@@ -233,14 +238,14 @@ if(WINDOWS)
233238
)
234239
endif()
235240
if(UMF_PROXY_LIB_BASED_ON_POOL STREQUAL SCALABLE)
236-
if(UMF_BUILD_LIBUMF_POOL_SCALABLE)
241+
if(UMF_POOL_SCALABLE_ENABLED)
237242
set(UMF_PROXY_LIB_ENABLED ON)
238243
set(PROXY_LIB_USES_SCALABLE_POOL ON)
239-
set(PROXY_LIBS scalable_pool umf)
244+
set(PROXY_LIBS umf)
240245
else()
241246
message(
242247
STATUS
243-
"Disabling the proxy library, because UMF_PROXY_LIB_BASED_ON_POOL==SCALABLE but UMF_BUILD_LIBUMF_POOL_SCALABLE is OFF"
248+
"Disabling the proxy library, because UMF_PROXY_LIB_BASED_ON_POOL==SCALABLE but TBB was not found"
244249
)
245250
endif()
246251
elseif(UMF_PROXY_LIB_BASED_ON_POOL STREQUAL JEMALLOC)

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ UMF also provides multithreaded benchmarks that can be enabled by setting both
8484
`UMF_BUILD_BENCHMARKS` and `UMF_BUILD_BENCHMARKS_MT` CMake
8585
configuration flags to `ON`. Multithreaded benchmarks require a C++ support.
8686

87+
The Scalable Pool requirements can be found in the relevant 'Memory Pool
88+
managers' section below.
89+
8790
### Sanitizers
8891

8992
List of sanitizers available on Linux:
@@ -109,7 +112,6 @@ List of options provided by CMake:
109112
| UMF_BUILD_LEVEL_ZERO_PROVIDER | Build Level Zero memory provider | ON/OFF | ON |
110113
| UMF_BUILD_LIBUMF_POOL_DISJOINT | Build the libumf_pool_disjoint static library | ON/OFF | OFF |
111114
| UMF_BUILD_LIBUMF_POOL_JEMALLOC | Build the libumf_pool_jemalloc static library | ON/OFF | OFF |
112-
| UMF_BUILD_LIBUMF_POOL_SCALABLE | Build the libumf_pool_scalable static library | ON/OFF | OFF |
113115
| UMF_BUILD_TESTS | Build UMF tests | ON/OFF | ON |
114116
| UMF_BUILD_GPU_TESTS | Build UMF GPU tests | ON/OFF | OFF |
115117
| UMF_BUILD_BENCHMARKS | Build UMF benchmarks | ON/OFF | OFF |
@@ -170,23 +172,25 @@ Additionally, required for tests:
170172

171173
### Memory pool managers
172174

173-
#### proxy_pool (part of libumf)
175+
#### Proxy pool (part of libumf)
174176

175177
This memory pool is distributed as part of libumf. It forwards all requests to the underlying
176178
memory provider. Currently umfPoolRealloc, umfPoolCalloc and umfPoolMallocUsableSize functions
177179
are not supported by the proxy pool.
178180

179-
#### libumf_pool_disjoint
181+
#### Disjoint pool
180182

181183
TODO: Add a description
182184

183185
##### Requirements
184186

185187
To enable this feature, the `UMF_BUILD_LIBUMF_POOL_DISJOINT` option needs to be turned `ON`.
186188

187-
#### libumf_pool_jemalloc
189+
#### Jemalloc pool
188190

189-
libumf_pool_jemalloc is a [jemalloc](https://github.com/jemalloc/jemalloc)-based memory pool manager built as a separate static library.
191+
Jemalloc pool is a [jemalloc](https://github.com/jemalloc/jemalloc)-based memory
192+
pool manager built as a separate static library: libjemalloc_pool.a on Linux and
193+
jemalloc_pool.lib on Windows.
190194
The `UMF_BUILD_LIBUMF_POOL_JEMALLOC` option has to be turned `ON` to build this library.
191195

192196
##### Requirements
@@ -195,15 +199,14 @@ The `UMF_BUILD_LIBUMF_POOL_JEMALLOC` option has to be turned `ON` to build this
195199
2) Required packages:
196200
- libjemalloc-dev (Linux) or jemalloc (Windows)
197201

198-
#### libumf_pool_scalable
202+
#### Scalable Pool (part of libumf)
199203

200-
libumf_pool_scalable is a [oneTBB](https://github.com/oneapi-src/oneTBB)-based memory pool manager built as a separate static library.
201-
The `UMF_BUILD_LIBUMF_POOL_SCALABLE` option has to be turned `ON` to build this library.
204+
Scalable Pool is a [oneTBB](https://github.com/oneapi-src/oneTBB)-based memory pool manager.
205+
It is distributed as part of libumf. To use this pool, TBB must be installed in the system.
202206

203207
##### Requirements
204208

205-
1) The `UMF_BUILD_LIBUMF_POOL_SCALABLE` option turned `ON`
206-
2) Required packages:
209+
Required packages:
207210
- libtbb-dev (libtbbmalloc.so.2) on Linux or tbb (tbbmalloc.dll) on Windows
208211

209212
### Memspaces (Linux-only)

benchmark/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ function(add_umf_benchmark)
7676
target_compile_definitions(${BENCH_NAME}
7777
PRIVATE UMF_BUILD_LIBUMF_POOL_JEMALLOC=1)
7878
endif()
79-
if(UMF_BUILD_LIBUMF_POOL_SCALABLE)
79+
if(UMF_POOL_SCALABLE_ENABLED)
8080
target_compile_definitions(${BENCH_NAME}
81-
PRIVATE UMF_BUILD_LIBUMF_POOL_SCALABLE=1)
81+
PRIVATE UMF_POOL_SCALABLE_ENABLED=1)
8282
endif()
8383
endfunction()
8484

@@ -92,9 +92,6 @@ if(UMF_BUILD_LIBUMF_POOL_JEMALLOC)
9292
set(LIBS_OPTIONAL ${LIBS_OPTIONAL} jemalloc_pool ${JEMALLOC_LIBRARIES})
9393
set(LIB_DIRS ${LIB_DIRS} ${JEMALLOC_LIBRARY_DIRS})
9494
endif()
95-
if(UMF_BUILD_LIBUMF_POOL_SCALABLE)
96-
set(LIBS_OPTIONAL ${LIBS_OPTIONAL} scalable_pool)
97-
endif()
9895
if(LINUX)
9996
set(LIBS_OPTIONAL ${LIBS_OPTIONAL} m)
10097
endif()

benchmark/multithread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static void mt_alloc_free(poolCreateExtParams params,
9393
int main() {
9494
auto osParams = umfOsMemoryProviderParamsDefault();
9595

96-
#if defined(UMF_BUILD_LIBUMF_POOL_SCALABLE)
96+
#if defined(UMF_POOL_SCALABLE_ENABLED)
9797

9898
// Increase iterations for scalable pool since it runs much faster than the remaining
9999
// ones.

0 commit comments

Comments
 (0)