Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor thread affinity #96

Merged
merged 30 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e3fa138
refactor cpubind string parsing
marenz2569 Dec 7, 2024
3689d90
Merge remote-tracking branch 'origin/master' into marenz.hwloc-thread…
marenz2569 Dec 7, 2024
77b1a8a
remove unneeded header
marenz2569 Dec 7, 2024
0f93416
add comment
marenz2569 Dec 7, 2024
2ebc1e7
get the allowed os indices from hwloc
marenz2569 Dec 7, 2024
05cf934
use hwloc to get the allowed cpus
marenz2569 Dec 7, 2024
cd5393b
rename CPUTopology -> ProcessorInformation
marenz2569 Dec 8, 2024
2986940
rename CPUTopology -> ProcessorInformation
marenz2569 Dec 8, 2024
cd6b719
rename X86CPUTopology -> X86ProcessorInformation
marenz2569 Dec 8, 2024
d4f86c8
split up cpu topology class
marenz2569 Dec 9, 2024
b0c9468
refactor cpu binding
marenz2569 Dec 9, 2024
97e617d
move CPUTopology and ThreadAffinity to toplevel
marenz2569 Dec 9, 2024
4f9373f
add header
marenz2569 Dec 9, 2024
932ed01
add header
marenz2569 Dec 9, 2024
912b7e7
add ref test for CPUTopology class
marenz2569 Dec 9, 2024
c5edb46
xnu thread affinity
marenz2569 Dec 9, 2024
58bf083
fix xnu thread affinity
marenz2569 Dec 9, 2024
ddd78ba
Merge branch 'master' into marenz.hwloc-thread-affinity
marenz2569 Dec 9, 2024
be7dab9
remove FIRESTARTER_THREAD_AFFINITY flag from cmake. update CHANGELOG …
marenz2569 Dec 9, 2024
279d1cb
remove comment
marenz2569 Dec 9, 2024
3a8af14
CPUTopology: add array
marenz2569 Dec 9, 2024
19cefae
fix system summary output. include it in a ref test.
marenz2569 Dec 10, 2024
cc26e24
add missing include
marenz2569 Dec 10, 2024
6b02ba1
add google test to cmake
marenz2569 Dec 11, 2024
b1d9e29
unit test CpuBind config parsing. use std::set for parsed CpuBind out…
marenz2569 Dec 11, 2024
9851c21
LoadWorker: iterate over thread affinity cpuset instead accessing per…
marenz2569 Dec 17, 2024
250f9dc
remove unused header
marenz2569 Dec 17, 2024
eff49fa
fix google test discovery
marenz2569 Dec 18, 2024
32f0fa5
add guard to disable the tests
marenz2569 Dec 18, 2024
4ca8199
readme: update compile flags section
marenz2569 Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add google test to cmake
marenz2569 committed Dec 11, 2024
commit 6b02ba11692bb7ce16447329411f5f3a9553cc0b
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -80,6 +80,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

include(cmake/InstallHwloc.cmake)
include(cmake/InstallGoogleTest.cmake)

add_subdirectory(src)

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -150,6 +150,7 @@ CMake option | Description
`FIRESTARTER_BUILD_TYPE` | Can be any of `FIRESTARTER`, `FIRESTARTER_CUDA`, `FIRESTARTER_ONEAPI`, or `FIRESTARTER_HIP`. Default `FIRESTARTER`
`FIRESTARTER_LINK_STATIC` | Link FIRESTARTER as a static binary. Note, dlopen is not supported in static binaries. This option is not available on macOS or with CUDA or OneAPI enabled. Default `ON`
`FIRESTARTER_BUILD_HWLOC` | Build hwloc dependency. Default `ON`
`FIRESTARTER_FETCH_GOOGLETEST`| Fetch the GoogleTest dependency. Default: `ON`
marenz2569 marked this conversation as resolved.
Show resolved Hide resolved

When building `FIRESTARTER_ONEAPI` make sure that the Intel Math Kernel
Library (MKL) and the compiler `icx` and `icpx` can be found. Please provide
4 changes: 4 additions & 0 deletions cmake/BuildOptions.cmake
Original file line number Diff line number Diff line change
@@ -14,6 +14,10 @@ endif()
option(FIRESTARTER_BUILD_HWLOC "Build hwloc dependency." ON)


# We fetch google test per default
option(FIRESTARTER_FETCH_GOOGLETEST "Fetch the Google Test dependency." ON)


# Debug feature are enabled on linux per default.
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(FIRESTARTER_DEBUG_FEATURES "Enable debug features" ON)
21 changes: 21 additions & 0 deletions cmake/InstallGoogleTest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This will install the Google Test dependency for FIRESTARTER

# configure build of googletest
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)

if (FIRESTARTER_FETCH_GOOGLETEST)
include(FetchContent)

# GoogleTest should use the latest commit available
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/d122c0d435a6d305cdd50526127c84a98b77d87b.zip
)

FetchContent_MakeAvailable(googletest)
else()
find_package(GTest REQUIRED)
message(STATUS "GTEST_INCLUDE_DIR: ${GTEST_INCLUDE_DIR}")
message(STATUS "GTEST_LIBRARIES: ${GTEST_LIBRARIES}")
endif()
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -23,4 +23,5 @@ endfunction()

add_subdirectory(DumpCPUTopology)
add_subdirectory(DumpPayloads)
add_subdirectory(UnitTests)
add_subdirectory(X86Functions)
11 changes: 11 additions & 0 deletions test/UnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
add_executable(UnitTests
CpuBindTest.cpp
)

target_link_libraries(UnitTests
firestartercore
GTest::gtest_main
)

include(GoogleTest)
gtest_discover_tests(UnitTests)