Skip to content

Commit ce3d17c

Browse files
committed
Remove UMF_DISABLE_HWLOC option
1 parent 0c49a4e commit ce3d17c

16 files changed

+146
-329
lines changed

.github/workflows/reusable_basic.yml

Lines changed: 3 additions & 22 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

@@ -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

.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: 98 additions & 109 deletions
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)"
@@ -243,117 +239,112 @@ else()
243239
)
244240
endif()
245241

246-
if(UMF_DISABLE_HWLOC)
247-
message(STATUS "hwloc is disabled, hence OS provider, memtargets, "
248-
"topology discovery, examples won't be available!")
249-
else()
250-
if(NOT DEFINED UMF_HWLOC_REPO)
251-
set(UMF_HWLOC_REPO "https://github.com/open-mpi/hwloc.git")
252-
endif()
242+
if(NOT DEFINED UMF_HWLOC_REPO)
243+
set(UMF_HWLOC_REPO "https://github.com/open-mpi/hwloc.git")
244+
endif()
253245

254-
if(NOT DEFINED UMF_HWLOC_TAG)
255-
set(UMF_HWLOC_TAG hwloc-2.10.0)
256-
endif()
246+
if(NOT DEFINED UMF_HWLOC_TAG)
247+
set(UMF_HWLOC_TAG hwloc-2.10.0)
248+
endif()
257249

258-
if(NOT UMF_LINK_HWLOC_STATICALLY)
259-
pkg_check_modules(LIBHWLOC hwloc>=2.3.0)
260-
if(NOT LIBHWLOC_FOUND)
261-
find_package(LIBHWLOC 2.3.0 COMPONENTS hwloc)
262-
if(LIBHWLOC_LIBRARIES)
263-
set(LIBHWLOC_AVAILABLE TRUE)
264-
endif()
250+
if(NOT UMF_LINK_HWLOC_STATICALLY)
251+
pkg_check_modules(LIBHWLOC hwloc>=2.3.0)
252+
if(NOT LIBHWLOC_FOUND)
253+
find_package(LIBHWLOC 2.3.0 COMPONENTS hwloc)
254+
if(LIBHWLOC_LIBRARIES)
255+
set(LIBHWLOC_AVAILABLE TRUE)
265256
endif()
257+
endif()
266258

267-
if(LIBHWLOC_AVAILABLE OR LIBHWLOC_FOUND)
268-
# add PATH to DLL on Windows
269-
set(DLL_PATH_LIST
270-
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_DLL_DIRS}")
271-
else()
272-
set(UMF_LINK_HWLOC_STATICALLY ON)
273-
endif()
259+
if(LIBHWLOC_AVAILABLE OR LIBHWLOC_FOUND)
260+
# add PATH to DLL on Windows
261+
set(DLL_PATH_LIST
262+
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_DLL_DIRS}")
263+
else()
264+
set(UMF_LINK_HWLOC_STATICALLY ON)
274265
endif()
266+
endif()
275267

276-
if(UMF_LINK_HWLOC_STATICALLY)
277-
message(
278-
STATUS
279-
"Will fetch hwloc from ${UMF_HWLOC_REPO} (tag: ${UMF_HWLOC_TAG})"
280-
)
268+
if(UMF_LINK_HWLOC_STATICALLY)
269+
message(
270+
STATUS
271+
"Will fetch hwloc from ${UMF_HWLOC_REPO} (tag: ${UMF_HWLOC_TAG})"
272+
)
281273

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

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

359350
if(hwloc_targ_SOURCE_DIR)
@@ -565,9 +556,7 @@ if(WINDOWS)
565556
endif()
566557

567558
# set UMF_PROXY_LIB_ENABLED
568-
if(UMF_DISABLE_HWLOC)
569-
message(STATUS "Disabling the proxy library, because HWLOC is disabled")
570-
elseif(NOT UMF_BUILD_SHARED_LIBRARY)
559+
if(NOT UMF_BUILD_SHARED_LIBRARY)
571560
# TODO enable this scenario
572561
message(
573562
STATUS
@@ -624,7 +613,7 @@ if(UMF_BUILD_BENCHMARKS)
624613
add_subdirectory(benchmark)
625614
endif()
626615

627-
if(UMF_BUILD_EXAMPLES AND NOT UMF_DISABLE_HWLOC)
616+
if(UMF_BUILD_EXAMPLES)
628617
add_subdirectory(examples)
629618
endif()
630619

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)