Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions CMakeLists.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this fix?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think with the quotes it should work ok: see 1952708

Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,31 @@ elseif("${Kokkos_DEVICES}" MATCHES "SYCL")
add_compile_options("-D SYCL_ENABLED")
endif()

if(("${Kokkos_DEVICES}" MATCHES "CUDA")
OR ("${Kokkos_DEVICES}" MATCHES "HIP")
OR ("${Kokkos_DEVICES}" MATCHES "SYCL"))
set(DEVICE_ENABLED ON)
else()
set(DEVICE_ENABLED OFF)
endif()

# MPI
if(${mpi})
find_or_fetch_dependency(MPI FALSE REQUIRED)
include_directories(${MPI_CXX_INCLUDE_PATH})
add_compile_options("-D MPI_ENABLED")
set(DEPENDENCIES ${DEPENDENCIES} MPI::MPI_CXX)

if(${DEVICE_ENABLED})
set(mpi_device_copy
${default_mpi_device_copy}
CACHE BOOL "Use explicit copy when using MPI + GPU")
add_compile_options("-D MPI_DEVICE_COPY")
else()
set(mpi_device_copy
OFF
CACHE BOOL "Use explicit copy when using MPI + GPU")
endif()
endif()

# Output
Expand Down
10 changes: 10 additions & 0 deletions cmake/defaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,14 @@ else()
CACHE INTERNAL "Default flag for MPI")
endif()

if(DEFINED ENV{Entity_MPI_DEVICE_COPY})
set(default_mpi_device_copy
$ENV{Entity_MPI_DEVICE_COPY}
CACHE INTERNAL "Default flag for copying from device to host for MPI")
else()
set(default_mpi_device_copy
OFF
CACHE INTERNAL "Default flag for copying from device to host for MPI")
endif()

set_property(CACHE default_mpi PROPERTY TYPE BOOL)
36 changes: 29 additions & 7 deletions cmake/report.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ printchoices(
${default_precision}
"${Blue}"
PRECISION_REPORT
36)
46)
printchoices(
"Output"
"output"
Expand All @@ -45,7 +45,7 @@ printchoices(
${default_output}
"${Green}"
OUTPUT_REPORT
36)
46)
printchoices(
"MPI"
"mpi"
Expand All @@ -54,7 +54,7 @@ printchoices(
OFF
"${Green}"
MPI_REPORT
36)
46)
printchoices(
"Debug mode"
"DEBUG"
Expand All @@ -63,7 +63,19 @@ printchoices(
OFF
"${Green}"
DEBUG_REPORT
36)
46)

if(${mpi} AND ${DEVICE_ENABLED})
printchoices(
"MPI explicit copy"
"mpi_device_copy"
"${ON_OFF_VALUES}"
${mpi_device_copy}
OFF
"${Green}"
MPI_DEVICE_COPY_REPORT
46)
endif()

if(NOT ${PROJECT_VERSION_TWEAK} EQUAL 0)
set(VERSION_SYMBOL "v${PROJECT_VERSION_MAJOR}." "${PROJECT_VERSION_MINOR}.")
Expand Down Expand Up @@ -111,13 +123,23 @@ string(REPLACE ";" "+" Kokkos_DEVICES "${Kokkos_DEVICES}")
string(
APPEND
REPORT_TEXT
" - ARCH [${Magenta}Kokkos_ARCH_***${ColorReset}]: ${Kokkos_ARCH}"
" - ARCH [${Magenta}Kokkos_ARCH_***${ColorReset}]: "
"${Kokkos_ARCH}"
"\n"
" - DEVICES [${Magenta}Kokkos_ENABLE_***${ColorReset}]: ${Kokkos_DEVICES}"
" - DEVICES [${Magenta}Kokkos_ENABLE_***${ColorReset}]: "
"${Kokkos_DEVICES}"
"\n"
" "
${MPI_REPORT}
"\n"
"\n")

if(${mpi} AND ${DEVICE_ENABLED})
string(APPEND REPORT_TEXT " " ${MPI_DEVICE_COPY_REPORT} "\n")
endif()

string(
APPEND
REPORT_TEXT
" "
${DEBUG_REPORT}
"\n"
Expand Down
Loading