Skip to content

Commit 939160c

Browse files
committed
Remove UMF_DISABLE_HWLOC option
1 parent 58ceb32 commit 939160c

16 files changed

+137
-333
lines changed

.github/workflows/reusable_basic.yml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
level_zero_provider: ['ON']
2525
cuda_provider: ['ON']
2626
install_tbb: ['ON']
27-
disable_hwloc: ['OFF']
2827
link_hwloc_statically: ['OFF']
2928
include:
3029
- os: 'ubuntu-22.04'
@@ -34,7 +33,6 @@ jobs:
3433
level_zero_provider: 'ON'
3534
cuda_provider: 'ON'
3635
install_tbb: 'ON'
37-
disable_hwloc: 'OFF'
3836
link_hwloc_statically: 'OFF'
3937
- os: 'ubuntu-22.04'
4038
build_type: Release
@@ -43,7 +41,6 @@ jobs:
4341
level_zero_provider: 'ON'
4442
cuda_provider: 'ON'
4543
install_tbb: 'ON'
46-
disable_hwloc: 'OFF'
4744
link_hwloc_statically: 'OFF'
4845
- os: 'ubuntu-24.04'
4946
build_type: Debug
@@ -52,7 +49,6 @@ jobs:
5249
level_zero_provider: 'ON'
5350
cuda_provider: 'ON'
5451
install_tbb: 'ON'
55-
disable_hwloc: 'OFF'
5652
link_hwloc_statically: 'OFF'
5753
# test level_zero_provider='OFF' and cuda_provider='OFF'
5854
- os: 'ubuntu-22.04'
@@ -62,7 +58,6 @@ jobs:
6258
level_zero_provider: 'OFF'
6359
cuda_provider: 'OFF'
6460
install_tbb: 'ON'
65-
disable_hwloc: 'OFF'
6661
link_hwloc_statically: 'OFF'
6762
# test icx compiler
6863
- os: 'ubuntu-22.04'
@@ -72,7 +67,6 @@ jobs:
7267
level_zero_provider: 'ON'
7368
cuda_provider: 'ON'
7469
install_tbb: 'ON'
75-
disable_hwloc: 'OFF'
7670
link_hwloc_statically: 'OFF'
7771
# test lld linker
7872
- os: 'ubuntu-24.04'
@@ -82,7 +76,6 @@ jobs:
8276
level_zero_provider: 'ON'
8377
cuda_provider: 'ON'
8478
install_tbb: 'ON'
85-
disable_hwloc: 'OFF'
8679
link_hwloc_statically: 'OFF'
8780
llvm_linker: '-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld"'
8881
# test without installing TBB
@@ -93,16 +86,6 @@ jobs:
9386
level_zero_provider: 'ON'
9487
cuda_provider: 'ON'
9588
install_tbb: 'OFF'
96-
disable_hwloc: 'OFF'
97-
link_hwloc_statically: 'OFF'
98-
- os: 'ubuntu-22.04'
99-
build_type: Debug
100-
compiler: {c: gcc, cxx: g++}
101-
shared_library: 'ON'
102-
level_zero_provider: 'ON'
103-
cuda_provider: 'ON'
104-
install_tbb: 'ON'
105-
disable_hwloc: 'ON'
10689
link_hwloc_statically: 'OFF'
10790
- os: 'ubuntu-22.04'
10891
build_type: Release
@@ -111,7 +94,6 @@ jobs:
11194
level_zero_provider: 'ON'
11295
cuda_provider: 'ON'
11396
install_tbb: 'ON'
114-
disable_hwloc: 'OFF'
11597
link_hwloc_statically: 'ON'
11698
runs-on: ${{matrix.os}}
11799

@@ -127,7 +109,6 @@ jobs:
127109
sudo apt-get install -y clang cmake libnuma-dev lcov
128110
129111
- name: Install hwloc
130-
if: matrix.disable_hwloc == 'OFF'
131112
run: |
132113
sudo apt-get install -y libhwloc-dev
133114
@@ -170,7 +151,6 @@ jobs:
170151
-DUMF_DEVELOPER_MODE=ON
171152
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
172153
-DUMF_TESTS_FAIL_ON_SKIP=ON
173-
-DUMF_DISABLE_HWLOC=${{matrix.disable_hwloc}}
174154
-DUMF_LINK_HWLOC_STATICALLY=${{matrix.link_hwloc_statically}}
175155
${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' && '-DUMF_USE_COVERAGE=ON' || '' }}
176156
${{ matrix.llvm_linker || '' }}
@@ -190,7 +170,7 @@ jobs:
190170
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
191171
working-directory: ${{env.BUILD_DIR}}
192172
run: |
193-
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}}
173+
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
194174
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
195175
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
196176
mkdir -p ${{env.COVERAGE_DIR}}
@@ -199,7 +179,7 @@ jobs:
199179
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
200180
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
201181
with:
202-
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}}
182+
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
203183
path: ${{env.COVERAGE_DIR}}
204184

205185
- name: Remove the installation directory
@@ -212,7 +192,7 @@ jobs:
212192
--build-dir ${{env.BUILD_DIR}}
213193
--install-dir ${{env.INSTL_DIR}}
214194
--build-type ${{matrix.build_type}}
215-
${{ matrix.install_tbb == 'ON' && matrix.disable_hwloc != 'ON' && matrix.shared_library == 'ON' && '--proxy' || '' }}
195+
${{ matrix.install_tbb == 'ON' && matrix.shared_library == 'ON' && '--proxy' || '' }}
216196
--umf-version ${{env.UMF_VERSION}}
217197
${{ matrix.shared_library == 'ON' && '--shared-library' || '' }}
218198

.github/workflows/reusable_docs_build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ jobs:
4141
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF \
4242
-DUMF_BUILD_CUDA_PROVIDER=OFF \
4343
-DUMF_BUILD_TESTS=OFF \
44-
-DUMF_BUILD_EXAMPLES=OFF \
45-
-DUMF_DISABLE_HWLOC=ON
44+
-DUMF_BUILD_EXAMPLES=OFF
4645
cmake --build build --target docs
4746
4847
#

CMakeLists.txt

Lines changed: 84 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ umf_option(UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF)
7272
umf_option(UMF_BUILD_EXAMPLES "Build UMF examples" ON)
7373
umf_option(UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF)
7474
umf_option(UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF)
75-
umf_option(
76-
UMF_DISABLE_HWLOC
77-
"Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)"
78-
OFF)
7975
umf_option(
8076
UMF_LINK_HWLOC_STATICALLY
8177
"Link UMF with HWLOC library statically (proxy library will be disabled on Windows+Debug build)"
@@ -249,7 +245,7 @@ else()
249245
)
250246
endif()
251247

252-
if(NOT UMF_DISABLE_HWLOC AND (NOT UMF_LINK_HWLOC_STATICALLY))
248+
if(NOT UMF_LINK_HWLOC_STATICALLY)
253249
pkg_check_modules(LIBHWLOC hwloc>=2.3.0)
254250
if(NOT LIBHWLOC_FOUND)
255251
find_package(LIBHWLOC 2.3.0 COMPONENTS hwloc)
@@ -267,108 +263,93 @@ if(NOT UMF_DISABLE_HWLOC AND (NOT UMF_LINK_HWLOC_STATICALLY))
267263
endif()
268264
endif()
269265

270-
if(UMF_LINK_HWLOC_STATICALLY AND LINUX)
271-
find_program(AUTORECONF_EXECUTABLE autoreconf)
272-
if(NOT AUTORECONF_EXECUTABLE)
273-
message(WARNING "autoreconf is not installed. Disabling hwloc.")
274-
set(UMF_DISABLE_HWLOC ON)
275-
set(UMF_LINK_HWLOC_STATICALLY OFF)
266+
if(UMF_LINK_HWLOC_STATICALLY)
267+
if(NOT DEFINED UMF_HWLOC_REPO)
268+
set(UMF_HWLOC_REPO "https://github.com/open-mpi/hwloc.git")
269+
endif()
270+
if(NOT DEFINED UMF_HWLOC_TAG)
271+
set(UMF_HWLOC_TAG hwloc-2.10.0)
276272
endif()
277-
endif()
278273

279-
if(UMF_DISABLE_HWLOC)
280-
message(STATUS "hwloc is disabled, hence OS provider, memtargets, "
281-
"topology discovery, examples won't be available!")
282-
else()
283-
if(UMF_LINK_HWLOC_STATICALLY)
284-
if(NOT DEFINED UMF_HWLOC_REPO)
285-
set(UMF_HWLOC_REPO "https://github.com/open-mpi/hwloc.git")
286-
endif()
274+
message(
275+
STATUS "Will fetch hwloc from ${UMF_HWLOC_REPO} (tag: ${UMF_HWLOC_TAG})"
276+
)
287277

288-
if(NOT DEFINED UMF_HWLOC_TAG)
289-
set(UMF_HWLOC_TAG hwloc-2.10.0)
278+
if(WINDOWS)
279+
set(HWLOC_ENABLE_TESTING OFF)
280+
set(HWLOC_SKIP_LSTOPO ON)
281+
set(HWLOC_SKIP_TOOLS ON)
282+
set(HWLOC_SKIP_INCLUDES ON)
283+
284+
FetchContent_Declare(
285+
hwloc_targ
286+
GIT_REPOSITORY ${UMF_HWLOC_REPO}
287+
GIT_TAG ${UMF_HWLOC_TAG}
288+
SOURCE_SUBDIR contrib/windows-cmake/)
289+
FetchContent_MakeAvailable(hwloc_targ)
290+
291+
set(HWLOC_LIB_PATH "")
292+
if(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
293+
set(HWLOC_LIB_PATH "${hwloc_targ_BINARY_DIR}/hwloc.lib")
294+
else()
295+
set(HWLOC_LIB_PATH "${hwloc_targ_BINARY_DIR}/lib/hwloc.lib")
290296
endif()
291-
message(
292-
STATUS
293-
"Will fetch hwloc from ${UMF_HWLOC_REPO} (tag: ${UMF_HWLOC_TAG})"
294-
)
295297

296-
if(WINDOWS)
297-
set(HWLOC_ENABLE_TESTING OFF)
298-
set(HWLOC_SKIP_LSTOPO ON)
299-
set(HWLOC_SKIP_TOOLS ON)
300-
set(HWLOC_SKIP_INCLUDES ON)
301-
302-
FetchContent_Declare(
303-
hwloc_targ
304-
GIT_REPOSITORY ${UMF_HWLOC_REPO}
305-
GIT_TAG ${UMF_HWLOC_TAG}
306-
SOURCE_SUBDIR contrib/windows-cmake/)
307-
FetchContent_MakeAvailable(hwloc_targ)
308-
309-
set(HWLOC_LIB_PATH "")
310-
if(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
311-
set(HWLOC_LIB_PATH "${hwloc_targ_BINARY_DIR}/hwloc.lib")
312-
else()
313-
set(HWLOC_LIB_PATH "${hwloc_targ_BINARY_DIR}/lib/hwloc.lib")
314-
endif()
315-
316-
get_filename_component(LIBHWLOC_LIBRARY_DIRS ${HWLOC_LIB_PATH}
317-
DIRECTORY)
318-
set(LIBHWLOC_LIBRARIES ${HWLOC_LIB_PATH})
319-
set(LIBHWLOC_INCLUDE_DIRS ${hwloc_targ_BINARY_DIR}/include)
320-
else() # not Windows
321-
FetchContent_Declare(
322-
hwloc_targ
323-
GIT_REPOSITORY ${UMF_HWLOC_REPO}
324-
GIT_TAG ${UMF_HWLOC_TAG})
325-
FetchContent_MakeAvailable(hwloc_targ)
326-
327-
add_custom_command(
328-
COMMAND ./autogen.sh
329-
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
330-
OUTPUT ${hwloc_targ_SOURCE_DIR}/configure)
331-
add_custom_command(
332-
COMMAND
333-
./configure --prefix=${hwloc_targ_BINARY_DIR}
334-
--enable-static=yes --enable-shared=no --disable-libxml2
335-
--disable-pci --disable-levelzero --disable-opencl
336-
--disable-cuda --disable-nvml --disable-libudev
337-
--disable-rsmi CFLAGS=-fPIC CXXFLAGS=-fPIC
338-
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
339-
OUTPUT ${hwloc_targ_SOURCE_DIR}/Makefile
340-
DEPENDS ${hwloc_targ_SOURCE_DIR}/configure)
341-
add_custom_command(
342-
COMMAND make
343-
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
344-
OUTPUT ${hwloc_targ_SOURCE_DIR}/lib/libhwloc.la
345-
DEPENDS ${hwloc_targ_SOURCE_DIR}/Makefile)
346-
add_custom_command(
347-
COMMAND make install
348-
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
349-
OUTPUT ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a
350-
DEPENDS ${hwloc_targ_SOURCE_DIR}/lib/libhwloc.la)
351-
352-
add_custom_target(hwloc_prod
353-
DEPENDS ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
354-
add_library(hwloc INTERFACE)
355-
target_link_libraries(
356-
hwloc INTERFACE ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
357-
add_dependencies(hwloc hwloc_prod)
358-
359-
set(LIBHWLOC_LIBRARY_DIRS ${hwloc_targ_BINARY_DIR}/lib)
360-
set(LIBHWLOC_INCLUDE_DIRS ${hwloc_targ_BINARY_DIR}/include)
361-
set(LIBHWLOC_LIBRARIES ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
362-
endif()
363-
endif() # UMF_LINK_HWLOC_STATICALLY
298+
get_filename_component(LIBHWLOC_LIBRARY_DIRS ${HWLOC_LIB_PATH}
299+
DIRECTORY)
300+
set(LIBHWLOC_LIBRARIES ${HWLOC_LIB_PATH})
301+
set(LIBHWLOC_INCLUDE_DIRS ${hwloc_targ_BINARY_DIR}/include)
302+
else() # not Windows
303+
FetchContent_Declare(
304+
hwloc_targ
305+
GIT_REPOSITORY ${UMF_HWLOC_REPO}
306+
GIT_TAG ${UMF_HWLOC_TAG})
307+
FetchContent_MakeAvailable(hwloc_targ)
364308

365-
message(STATUS " LIBHWLOC_LIBRARIES = ${LIBHWLOC_LIBRARIES}")
366-
message(STATUS " LIBHWLOC_INCLUDE_DIRS = ${LIBHWLOC_INCLUDE_DIRS}")
367-
message(STATUS " LIBHWLOC_LIBRARY_DIRS = ${LIBHWLOC_LIBRARY_DIRS}")
368-
message(STATUS " LIBHWLOC_API_VERSION = ${LIBHWLOC_API_VERSION}")
369-
if(WINDOWS)
370-
message(STATUS " LIBHWLOC_DLL_DIRS = ${LIBHWLOC_DLL_DIRS}")
309+
add_custom_command(
310+
COMMAND ./autogen.sh
311+
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
312+
OUTPUT ${hwloc_targ_SOURCE_DIR}/configure)
313+
add_custom_command(
314+
COMMAND
315+
./configure --prefix=${hwloc_targ_BINARY_DIR}
316+
--enable-static=yes --enable-shared=no --disable-libxml2
317+
--disable-pci --disable-levelzero --disable-opencl
318+
--disable-cuda --disable-nvml --disable-libudev --disable-rsmi
319+
CFLAGS=-fPIC CXXFLAGS=-fPIC
320+
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
321+
OUTPUT ${hwloc_targ_SOURCE_DIR}/Makefile
322+
DEPENDS ${hwloc_targ_SOURCE_DIR}/configure)
323+
add_custom_command(
324+
COMMAND make
325+
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
326+
OUTPUT ${hwloc_targ_SOURCE_DIR}/lib/libhwloc.la
327+
DEPENDS ${hwloc_targ_SOURCE_DIR}/Makefile)
328+
add_custom_command(
329+
COMMAND make install
330+
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
331+
OUTPUT ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a
332+
DEPENDS ${hwloc_targ_SOURCE_DIR}/lib/libhwloc.la)
333+
334+
add_custom_target(hwloc_prod
335+
DEPENDS ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
336+
add_library(hwloc INTERFACE)
337+
target_link_libraries(hwloc
338+
INTERFACE ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
339+
add_dependencies(hwloc hwloc_prod)
340+
341+
set(LIBHWLOC_LIBRARY_DIRS ${hwloc_targ_BINARY_DIR}/lib)
342+
set(LIBHWLOC_INCLUDE_DIRS ${hwloc_targ_BINARY_DIR}/include)
343+
set(LIBHWLOC_LIBRARIES ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
371344
endif()
345+
endif() # UMF_LINK_HWLOC_STATICALLY
346+
347+
message(STATUS " LIBHWLOC_LIBRARIES = ${LIBHWLOC_LIBRARIES}")
348+
message(STATUS " LIBHWLOC_INCLUDE_DIRS = ${LIBHWLOC_INCLUDE_DIRS}")
349+
message(STATUS " LIBHWLOC_LIBRARY_DIRS = ${LIBHWLOC_LIBRARY_DIRS}")
350+
message(STATUS " LIBHWLOC_API_VERSION = ${LIBHWLOC_API_VERSION}")
351+
if(WINDOWS)
352+
message(STATUS " LIBHWLOC_DLL_DIRS = ${LIBHWLOC_DLL_DIRS}")
372353
endif()
373354

374355
if(hwloc_targ_SOURCE_DIR)
@@ -463,7 +444,7 @@ if(WINDOWS AND UMF_USE_DEBUG_POSTFIX)
463444
-DUMF_BUILD_TESTS=OFF -DUMF_BUILD_GPU_TESTS=OFF
464445
-DUMF_BUILD_BENCHMARKS=OFF -DUMF_BUILD_BENCHMARKS_MT=OFF
465446
-DUMF_BUILD_EXAMPLES=OFF -DUMF_BUILD_GPU_EXAMPLES=OFF
466-
-DUMF_BUILD_FUZZTESTS=OFF -DUMF_DISABLE_HWLOC=${UMF_DISABLE_HWLOC}
447+
-DUMF_BUILD_FUZZTESTS=OFF
467448
-DUMF_LINK_HWLOC_STATICALLY=${UMF_LINK_HWLOC_STATICALLY}
468449
-DUMF_HWLOC_NAME=${UMF_HWLOC_NAME}
469450
-DUMF_INSTALL_RPATH=${UMF_INSTALL_RPATH} -DUMF_DEVELOPER_MODE=OFF
@@ -648,9 +629,7 @@ if(WINDOWS)
648629
endif()
649630

650631
# set UMF_PROXY_LIB_ENABLED
651-
if(UMF_DISABLE_HWLOC)
652-
message(STATUS "Disabling the proxy library, because HWLOC is disabled")
653-
elseif(NOT UMF_BUILD_SHARED_LIBRARY)
632+
if(NOT UMF_BUILD_SHARED_LIBRARY)
654633
# TODO enable this scenario
655634
message(
656635
STATUS
@@ -707,7 +686,7 @@ if(UMF_BUILD_BENCHMARKS)
707686
add_subdirectory(benchmark)
708687
endif()
709688

710-
if(UMF_BUILD_EXAMPLES AND NOT UMF_DISABLE_HWLOC)
689+
if(UMF_BUILD_EXAMPLES)
711690
add_subdirectory(examples)
712691
endif()
713692

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ List of options provided by CMake:
123123
| UMF_USE_VALGRIND | Enable Valgrind instrumentation | ON/OFF | OFF |
124124
| UMF_USE_COVERAGE | Build with coverage enabled (Linux only) | ON/OFF | OFF |
125125
| UMF_LINK_HWLOC_STATICALLY | Link UMF with HWLOC library statically (proxy library will be disabled on Windows+Debug build) | ON/OFF | OFF |
126-
| UMF_DISABLE_HWLOC | Disable features that requires hwloc (OS provider, memory targets, topology discovery) | ON/OFF | OFF |
127126

128127
## Architecture: memory pools and providers
129128

0 commit comments

Comments
 (0)