Skip to content

Commit 5229bc6

Browse files
committed
Remove UMF_DISABLE_HWLOC option
1 parent 8247987 commit 5229bc6

16 files changed

+133
-318
lines changed

Diff for: .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

@@ -168,7 +150,6 @@ jobs:
168150
-DUMF_DEVELOPER_MODE=ON
169151
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
170152
-DUMF_TESTS_FAIL_ON_SKIP=ON
171-
-DUMF_DISABLE_HWLOC=${{matrix.disable_hwloc}}
172153
-DUMF_LINK_HWLOC_STATICALLY=${{matrix.link_hwloc_statically}}
173154
${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' && '-DUMF_USE_COVERAGE=ON' || '' }}
174155
${{ matrix.llvm_linker || '' }}
@@ -188,7 +169,7 @@ jobs:
188169
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
189170
working-directory: ${{env.BUILD_DIR}}
190171
run: |
191-
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}}
172+
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
192173
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
193174
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
194175
mkdir -p ${{env.COVERAGE_DIR}}
@@ -197,7 +178,7 @@ jobs:
197178
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
198179
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
199180
with:
200-
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}}
181+
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
201182
path: ${{env.COVERAGE_DIR}}
202183

203184
- name: Remove the installation directory
@@ -210,7 +191,7 @@ jobs:
210191
--build-dir ${{env.BUILD_DIR}}
211192
--install-dir ${{env.INSTL_DIR}}
212193
--build-type ${{matrix.build_type}}
213-
${{ matrix.install_tbb == 'ON' && matrix.disable_hwloc != 'ON' && matrix.shared_library == 'ON' && '--proxy' || '' }}
194+
${{ matrix.install_tbb == 'ON' && matrix.shared_library == 'ON' && '--proxy' || '' }}
214195
--umf-version ${{env.UMF_VERSION}}
215196
${{ matrix.shared_library == 'ON' && '--shared-library' || '' }}
216197

Diff for: .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
#

Diff for: CMakeLists.txt

+84-96
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ umf_option(UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF)
7070
umf_option(UMF_BUILD_EXAMPLES "Build UMF examples" ON)
7171
umf_option(UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF)
7272
umf_option(UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF)
73-
umf_option(
74-
UMF_DISABLE_HWLOC
75-
"Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)"
76-
OFF)
7773
umf_option(
7874
UMF_LINK_HWLOC_STATICALLY
7975
"Link UMF with HWLOC library statically (proxy library will be disabled on Windows+Debug build)"
@@ -245,7 +241,7 @@ else()
245241
)
246242
endif()
247243

248-
if(NOT UMF_DISABLE_HWLOC AND (NOT UMF_LINK_HWLOC_STATICALLY))
244+
if(NOT UMF_LINK_HWLOC_STATICALLY)
249245
pkg_check_modules(LIBHWLOC hwloc>=2.3.0)
250246
if(NOT LIBHWLOC_FOUND)
251247
find_package(LIBHWLOC 2.3.0 COMPONENTS hwloc)
@@ -272,98 +268,92 @@ if(UMF_LINK_HWLOC_STATICALLY AND LINUX)
272268
endif()
273269
endif()
274270

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

284-
if(NOT DEFINED UMF_HWLOC_TAG)
285-
set(UMF_HWLOC_TAG hwloc-2.10.0)
286-
endif()
287-
message(
288-
STATUS
289-
"Will fetch hwloc from ${UMF_HWLOC_REPO} (tag: ${UMF_HWLOC_TAG})"
290-
)
279+
if(NOT DEFINED UMF_HWLOC_TAG)
280+
set(UMF_HWLOC_TAG hwloc-2.10.0)
281+
endif()
291282

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

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

369359
if(hwloc_targ_SOURCE_DIR)
@@ -596,9 +586,7 @@ if(WINDOWS)
596586
endif()
597587

598588
# set UMF_PROXY_LIB_ENABLED
599-
if(UMF_DISABLE_HWLOC)
600-
message(STATUS "Disabling the proxy library, because HWLOC is disabled")
601-
elseif(NOT UMF_BUILD_SHARED_LIBRARY)
589+
if(NOT UMF_BUILD_SHARED_LIBRARY)
602590
# TODO enable this scenario
603591
message(
604592
STATUS
@@ -655,7 +643,7 @@ if(UMF_BUILD_BENCHMARKS)
655643
add_subdirectory(benchmark)
656644
endif()
657645

658-
if(UMF_BUILD_EXAMPLES AND NOT UMF_DISABLE_HWLOC)
646+
if(UMF_BUILD_EXAMPLES)
659647
add_subdirectory(examples)
660648
endif()
661649

Diff for: 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

Diff for: src/CMakeLists.txt

+5-16
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,11 @@ if(UMF_POOL_JEMALLOC_ENABLED)
100100
"UMF_POOL_JEMALLOC_ENABLED=1")
101101
endif()
102102

103-
if(NOT UMF_DISABLE_HWLOC)
104-
set(UMF_SOURCES ${UMF_SOURCES} ${HWLOC_DEPENDENT_SOURCES}
105-
memtargets/memtarget_numa.c)
106-
set(UMF_LIBS ${UMF_LIBS} $<BUILD_INTERFACE:${UMF_HWLOC_NAME}>)
107-
set(UMF_PRIVATE_LIBRARY_DIRS ${UMF_PRIVATE_LIBRARY_DIRS}
108-
${LIBHWLOC_LIBRARY_DIRS})
109-
else()
110-
set(UMF_COMMON_COMPILE_DEFINITIONS ${UMF_COMMON_COMPILE_DEFINITIONS}
111-
"UMF_NO_HWLOC=1")
112-
endif()
103+
set(UMF_SOURCES ${UMF_SOURCES} ${HWLOC_DEPENDENT_SOURCES}
104+
memtargets/memtarget_numa.c)
105+
set(UMF_LIBS ${UMF_LIBS} $<BUILD_INTERFACE:${UMF_HWLOC_NAME}>)
106+
set(UMF_PRIVATE_LIBRARY_DIRS ${UMF_PRIVATE_LIBRARY_DIRS}
107+
${LIBHWLOC_LIBRARY_DIRS})
113108

114109
set(UMF_SOURCES_LINUX libumf_linux.c)
115110
set(UMF_SOURCES_MACOSX libumf_linux.c)
@@ -124,12 +119,6 @@ if(NOT UMF_BUILD_LEVEL_ZERO_PROVIDER)
124119
set(UMF_COMMON_COMPILE_DEFINITIONS ${UMF_COMMON_COMPILE_DEFINITIONS}
125120
"UMF_NO_LEVEL_ZERO_PROVIDER=1")
126121
endif()
127-
if(UMF_DISABLE_HWLOC OR WINDOWS)
128-
set(UMF_COMMON_COMPILE_DEFINITIONS ${UMF_COMMON_COMPILE_DEFINITIONS}
129-
"UMF_NO_DEVDAX_PROVIDER=1")
130-
set(UMF_COMMON_COMPILE_DEFINITIONS ${UMF_COMMON_COMPILE_DEFINITIONS}
131-
"UMF_NO_FILE_PROVIDER=1")
132-
endif()
133122

134123
if(LINUX)
135124
set(UMF_SOURCES ${UMF_SOURCES} ${UMF_SOURCES_LINUX})

0 commit comments

Comments
 (0)