Skip to content

Commit cf5ba95

Browse files
committed
Remove UMF_DISABLE_HWLOC option
1 parent 58ceb32 commit cf5ba95

16 files changed

+138
-324
lines changed

.github/workflows/reusable_basic.yml

+3-22
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

@@ -170,7 +152,6 @@ jobs:
170152
-DUMF_DEVELOPER_MODE=ON
171153
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
172154
-DUMF_TESTS_FAIL_ON_SKIP=ON
173-
-DUMF_DISABLE_HWLOC=${{matrix.disable_hwloc}}
174155
-DUMF_LINK_HWLOC_STATICALLY=${{matrix.link_hwloc_statically}}
175156
${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' && '-DUMF_USE_COVERAGE=ON' || '' }}
176157
${{ matrix.llvm_linker || '' }}
@@ -190,7 +171,7 @@ jobs:
190171
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
191172
working-directory: ${{env.BUILD_DIR}}
192173
run: |
193-
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}}
174+
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
194175
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
195176
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
196177
mkdir -p ${{env.COVERAGE_DIR}}
@@ -199,7 +180,7 @@ jobs:
199180
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
200181
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
201182
with:
202-
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}}
183+
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
203184
path: ${{env.COVERAGE_DIR}}
204185

205186
- name: Remove the installation directory
@@ -212,7 +193,7 @@ jobs:
212193
--build-dir ${{env.BUILD_DIR}}
213194
--install-dir ${{env.INSTL_DIR}}
214195
--build-type ${{matrix.build_type}}
215-
${{ matrix.install_tbb == 'ON' && matrix.disable_hwloc != 'ON' && matrix.shared_library == 'ON' && '--proxy' || '' }}
196+
${{ matrix.install_tbb == 'ON' && matrix.shared_library == 'ON' && '--proxy' || '' }}
216197
--umf-version ${{env.UMF_VERSION}}
217198
${{ matrix.shared_library == 'ON' && '--shared-library' || '' }}
218199

.github/workflows/reusable_docs_build.yml

+1-2
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

+85-97
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)
@@ -276,99 +272,93 @@ if(UMF_LINK_HWLOC_STATICALLY AND LINUX)
276272
endif()
277273
endif()
278274

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()
275+
if(UMF_LINK_HWLOC_STATICALLY)
276+
message(
277+
STATUS "Will fetch hwloc from ${UMF_HWLOC_REPO} (tag: ${UMF_HWLOC_TAG})"
278+
)
279+
if(NOT DEFINED UMF_HWLOC_REPO)
280+
set(UMF_HWLOC_REPO "https://github.com/open-mpi/hwloc.git")
281+
endif()
287282

288-
if(NOT DEFINED UMF_HWLOC_TAG)
289-
set(UMF_HWLOC_TAG hwloc-2.10.0)
290-
endif()
291-
message(
292-
STATUS
293-
"Will fetch hwloc from ${UMF_HWLOC_REPO} (tag: ${UMF_HWLOC_TAG})"
294-
)
283+
if(NOT DEFINED UMF_HWLOC_TAG)
284+
set(UMF_HWLOC_TAG hwloc-2.10.0)
285+
endif()
295286

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)
287+
if(WINDOWS)
288+
set(HWLOC_ENABLE_TESTING OFF)
289+
set(HWLOC_SKIP_LSTOPO ON)
290+
set(HWLOC_SKIP_TOOLS ON)
291+
set(HWLOC_SKIP_INCLUDES ON)
292+
293+
FetchContent_Declare(
294+
hwloc_targ
295+
GIT_REPOSITORY ${UMF_HWLOC_REPO}
296+
GIT_TAG ${UMF_HWLOC_TAG}
297+
SOURCE_SUBDIR contrib/windows-cmake/)
298+
FetchContent_MakeAvailable(hwloc_targ)
299+
300+
set(HWLOC_LIB_PATH "")
301+
if(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
302+
set(HWLOC_LIB_PATH "${hwloc_targ_BINARY_DIR}/hwloc.lib")
303+
else()
304+
set(HWLOC_LIB_PATH "${hwloc_targ_BINARY_DIR}/lib/hwloc.lib")
362305
endif()
363-
endif() # UMF_LINK_HWLOC_STATICALLY
364306

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}")
307+
get_filename_component(LIBHWLOC_LIBRARY_DIRS ${HWLOC_LIB_PATH}
308+
DIRECTORY)
309+
set(LIBHWLOC_LIBRARIES ${HWLOC_LIB_PATH})
310+
set(LIBHWLOC_INCLUDE_DIRS ${hwloc_targ_BINARY_DIR}/include)
311+
else() # not Windows
312+
FetchContent_Declare(
313+
hwloc_targ
314+
GIT_REPOSITORY ${UMF_HWLOC_REPO}
315+
GIT_TAG ${UMF_HWLOC_TAG})
316+
FetchContent_MakeAvailable(hwloc_targ)
317+
318+
add_custom_command(
319+
COMMAND ./autogen.sh
320+
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
321+
OUTPUT ${hwloc_targ_SOURCE_DIR}/configure)
322+
add_custom_command(
323+
COMMAND
324+
./configure --prefix=${hwloc_targ_BINARY_DIR}
325+
--enable-static=yes --enable-shared=no --disable-libxml2
326+
--disable-pci --disable-levelzero --disable-opencl
327+
--disable-cuda --disable-nvml --disable-libudev --disable-rsmi
328+
CFLAGS=-fPIC CXXFLAGS=-fPIC
329+
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
330+
OUTPUT ${hwloc_targ_SOURCE_DIR}/Makefile
331+
DEPENDS ${hwloc_targ_SOURCE_DIR}/configure)
332+
add_custom_command(
333+
COMMAND make
334+
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
335+
OUTPUT ${hwloc_targ_SOURCE_DIR}/lib/libhwloc.la
336+
DEPENDS ${hwloc_targ_SOURCE_DIR}/Makefile)
337+
add_custom_command(
338+
COMMAND make install
339+
WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
340+
OUTPUT ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a
341+
DEPENDS ${hwloc_targ_SOURCE_DIR}/lib/libhwloc.la)
342+
343+
add_custom_target(hwloc_prod
344+
DEPENDS ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
345+
add_library(hwloc INTERFACE)
346+
target_link_libraries(hwloc
347+
INTERFACE ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
348+
add_dependencies(hwloc hwloc_prod)
349+
350+
set(LIBHWLOC_LIBRARY_DIRS ${hwloc_targ_BINARY_DIR}/lib)
351+
set(LIBHWLOC_INCLUDE_DIRS ${hwloc_targ_BINARY_DIR}/include)
352+
set(LIBHWLOC_LIBRARIES ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
371353
endif()
354+
endif() # UMF_LINK_HWLOC_STATICALLY
355+
356+
message(STATUS " LIBHWLOC_LIBRARIES = ${LIBHWLOC_LIBRARIES}")
357+
message(STATUS " LIBHWLOC_INCLUDE_DIRS = ${LIBHWLOC_INCLUDE_DIRS}")
358+
message(STATUS " LIBHWLOC_LIBRARY_DIRS = ${LIBHWLOC_LIBRARY_DIRS}")
359+
message(STATUS " LIBHWLOC_API_VERSION = ${LIBHWLOC_API_VERSION}")
360+
if(WINDOWS)
361+
message(STATUS " LIBHWLOC_DLL_DIRS = ${LIBHWLOC_DLL_DIRS}")
372362
endif()
373363

374364
if(hwloc_targ_SOURCE_DIR)
@@ -648,9 +638,7 @@ if(WINDOWS)
648638
endif()
649639

650640
# 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)
641+
if(NOT UMF_BUILD_SHARED_LIBRARY)
654642
# TODO enable this scenario
655643
message(
656644
STATUS
@@ -707,7 +695,7 @@ if(UMF_BUILD_BENCHMARKS)
707695
add_subdirectory(benchmark)
708696
endif()
709697

710-
if(UMF_BUILD_EXAMPLES AND NOT UMF_DISABLE_HWLOC)
698+
if(UMF_BUILD_EXAMPLES)
711699
add_subdirectory(examples)
712700
endif()
713701

README.md

-1
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)