Skip to content

Commit

Permalink
Merge Pull Request #12517 from trilinos/Trilinos/tpetra-gpu-aware-def…
Browse files Browse the repository at this point in the history
…ault

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: b'Tpetra: assume gpu-aware mpi'
PR Author: jhux2
  • Loading branch information
trilinos-autotester authored Nov 11, 2023
2 parents 2a6e344 + 9a4e0ac commit eff92e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/tpetra/CMakeCuda.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ ENDIF ()

# Checks that only matter if building with CUDA enabled.
IF (Tpetra_ENABLE_CUDA)
message("CUDA_VERSION=${CUDA_VERSION}")
IF (DEFINED CUDA_VERSION)
message(STATUS "CUDA_VERSION=${CUDA_VERSION}")
ENDIF ()
IF (NOT DEFINED Kokkos_ENABLE_CUDA_LAMBDA OR NOT Kokkos_ENABLE_CUDA_LAMBDA)
MESSAGE (FATAL_ERROR "If building with CUDA, Tpetra and downstream packages require that you set the CMake option Kokkos_ENABLE_CUDA_LAMBDA:BOOL=ON (this is the default behavior).")
ENDIF ()
Expand Down
7 changes: 5 additions & 2 deletions packages/tpetra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ ENDIF () # Tpetra_INST_SYCL
# safe, but possibly less performant assumption that MPI is not CUDA
# aware.

SET (Tpetra_ASSUME_GPU_AWARE_MPI_DEFAULT OFF)
SET (Tpetra_ASSUME_GPU_AWARE_MPI_DEFAULT ON)

ASSERT_DEFINED (TPL_ENABLE_MPI)
MESSAGE (STATUS "Determine whether Tpetra will assume that MPI is GPU aware:")
Expand Down Expand Up @@ -511,7 +511,8 @@ ELSE ()
MESSAGE (STATUS " - While I found the \"ompi_info\" executable, it would not run. Thus, I will make the sane assumption that your MPI implementation is NOT GPU aware. You can change this at configure time with the option Tpetra_ASSUME_GPU_AWARE_MPI=ON, and override the configure-time setting at runtime with the environment variable TPETRA_ASSUME_GPU_AWARE_MPI=ON or OFF.")
ENDIF ()
ELSE ()
MESSAGE (STATUS " - Tpetra did not find the \"ompi_info\" executable. This may not be bad; for example, if your MPI implementation is not OpenMPI, then you won't have this executable. Tpetra will conservatively assume that your MPI implementation is NOT GPU aware. If you would like to change this, please set the CMake variable Tpetra_ASSUME_GPU_AWARE_MPI:BOOL=ON explicitly at configure time. You can also override this at runtime with the environment variable TPETRA_ASSUME_GPU_AWARE_MPI=ON or OFF.")
MESSAGE (STATUS " - Search for \"ompi_info\" failed, unable to automatically detect whether MPI is GPU-aware.")
MESSAGE (STATUS " - Whether MPI is GPU-aware may be specified at runtime with the environment variable TPETRA_ASSUME_GPU_AWARE_MPI=ON or OFF.")
ENDIF () # Tpetra_FOUND_OMPI_INFO_EXECUTABLE
ENDIF () # Whether we are cross compiling
ENDIF () # Whether we have CUDA and MPI
Expand Down Expand Up @@ -542,6 +543,7 @@ TRIBITS_ADD_OPTION_AND_DEFINE(
${Tpetra_ASSUME_CUDA_AWARE_MPI})


MESSAGE(STATUS "Tpetra: defaulting to Tpetra_ASSUME_GPU_AWARE_MPI: ${Tpetra_ASSUME_GPU_AWARE_MPI}")

#
# Check that users did not attempt to enable both the OpenMP and
Expand Down Expand Up @@ -587,6 +589,7 @@ MESSAGE(STATUS " - Cuda: ${HAVE_TPETRA_CUDA}")
MESSAGE(STATUS " - HIP: ${HAVE_TPETRA_HIP}")
MESSAGE(STATUS " - SYCL: ${HAVE_TPETRA_SYCL}")


# Fix Github Issue #190 by making sure that users enabled at least one
# Node type.
IF(NOT Tpetra_INST_SERIAL AND NOT Tpetra_INST_PTHREAD AND NOT Tpetra_INST_OPENMP AND NOT Tpetra_INST_CUDA AND NOT Tpetra_INST_HIP AND NOT Tpetra_INST_SYCL)
Expand Down

0 comments on commit eff92e9

Please sign in to comment.