Skip to content

Commit

Permalink
removed strange comments + set again mpirun
Browse files Browse the repository at this point in the history
  • Loading branch information
cpt-harlock committed Jan 9, 2025
1 parent d707568 commit f9f0de9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 53 deletions.
66 changes: 14 additions & 52 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ project(
# Policy CMP0074: this policy is to use <PackageName>_ROOT variables if defined
cmake_policy(SET CMP0074 NEW)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # Build helpers # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # #
# Build helpers
set(PROJECT_CMAKE ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand All @@ -51,10 +48,7 @@ include(ExternalProject)

enable_testing()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # Options # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # #
# Options
option(CNTD_ENABLE_CUDA "Enable CUDA monitoring on NVIDIA GPUs" OFF)
option(CNTD_DISABLE_PROFILING_MPI "Disable MPI profiling" OFF)
option(CNTD_ENABLE_ACCESSORY_MPI
Expand All @@ -70,25 +64,16 @@ option(
option(CNTD_ENABLE_DEBUG_MPI "Enable the debug prints on MPI functions" OFF)
option(CNTD_ENABLE_TESTS "Enable the regression tests" ON)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # MOSQUITTO Options # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # #
# MOSQUITTO Options
option(CNTD_ENABLE_MOSQUITTO "Enable MQTT message passing" OFF)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # HWP/CPUFREQ Options # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # #
# HWP/CPUFREQ Options
option(CNTD_HWP_AUTO_DISCOVER "Find automagically if hwp-states are available"
ON)
option(CNTD_HWP_DISCOVERED "Manual set if hwp-states are available" OFF)
option(CNTD_USE_CPUFREQ "Manual set if use \"cpufreq\" interface" ON)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # Build Type # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# Build Type
set(default_build_type "RelWithDebInfo")

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
Expand All @@ -103,10 +88,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"MinSizeRel" "RelWithDebInfo")
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # DISCOVERING ARCHITECTURE # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # #
# DISCOVERING ARCHITECTURE
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(READ "/proc/cpuinfo" cpu_info)

Expand Down Expand Up @@ -149,49 +131,35 @@ else()
message(STATUS "HWP-States not available")
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # ####################### MPI # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # ####################### Find MPI and export variable to global
# MPI
# Find MPI and export variable to global
# scope find_package(MPI REQUIRED)
find_package(MPI REQUIRED C)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # ####################### HWLOC # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # #######################
# HWLOC
find_package(HWLOC REQUIRED)
add_library(cntd_hwloc INTERFACE)
set_target_properties(cntd_hwloc PROPERTIES INTERFACE_LINK_DIRECTORIES
"${HWLOC_LIBRARY_DIRS}")
target_link_libraries(cntd_hwloc INTERFACE ${HWLOC_LIBRARIES})
target_include_directories(cntd_hwloc INTERFACE ${HWLOC_INCLUDE_DIRS})

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # ####################### CUDA # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # #######################
# CUDA
if(CNTD_ENABLE_CUDA)
# CMake < 3.17 cannot use find_package(CUDAToolkit)
cmake_minimum_required(VERSION 3.17)
find_package(CUDAToolkit REQUIRED)
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # ####################### MOSQUITTO # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # #######################
# MOSQUITTO
if(CNTD_ENABLE_MOSQUITTO)
find_package(MOSQUITTO REQUIRED)
add_library(cntd_mosquitto INTERFACE)
target_link_libraries(cntd_mosquitto INTERFACE ${MOSQUITTO_LIBRARY})
target_include_directories(cntd_mosquitto INTERFACE ${MOSQUITTO_INCLUDE_DIR})
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # ####################### libfort # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # #######################
# libfort
find_package(libfort)
# if libfort is not found, use the
if(NOT libfort_FOUND)
Expand Down Expand Up @@ -222,10 +190,7 @@ if(NOT libfort_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/libfort/include)
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # ####################### Get compile
# definitions # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # #######################
# Get compile definitions
if(DEFINED ENV{CNTD_GET_COMPILE_DEFINITIONS})
get_directory_property(DirDefs DIRECTORY ${CMAKE_SOURCE_DIR}
COMPILE_DEFINITIONS)
Expand All @@ -235,10 +200,7 @@ if(DEFINED ENV{CNTD_GET_COMPILE_DEFINITIONS})
message(STATUS "All compile definitions: " ${DirDefs})
endif()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # ####################### Add directories # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # #######################
# Add directories
add_subdirectory(src)

# Add custom command in order to invoke clang-format on the source files
Expand Down
3 changes: 2 additions & 1 deletion regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ target_link_libraries(hello ${MPI_LIBRARIES})
target_include_directories(hello PRIVATE ${MPI_INCLUDE_PATH})
# find executable path
# add test to run the executable with mpirun
add_test(NAME Regression COMMAND "srun" "${CMAKE_BINARY_DIR}/regression/hello")
#add_test(NAME Regression COMMAND "srun" "${CMAKE_BINARY_DIR}/regression/hello")
add_test(NAME Regression COMMAND "mpirun" "${CMAKE_BINARY_DIR}/regression/hello")
set_property(TEST Regression PROPERTY ENVIRONMENT LD_PRELOAD=/leonardo/home/userinternal/amonteru/countdown/build/src/libcntd.so)

0 comments on commit f9f0de9

Please sign in to comment.