From 61678fc37f32df1387d9077141b0da61ae6b0756 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 18 Oct 2018 22:07:17 +0200 Subject: [PATCH] Introduce a configuration variable DEAL_II_WITH_CUDA_AWARE_MPI --- .../configure_2_cuda_aware_mpi.cmake | 31 +++++++++++++++++++ cmake/setup_cached_variables.cmake | 7 +++++ include/deal.II/base/config.h.in | 1 + 3 files changed, 39 insertions(+) create mode 100644 cmake/configure/configure_2_cuda_aware_mpi.cmake diff --git a/cmake/configure/configure_2_cuda_aware_mpi.cmake b/cmake/configure/configure_2_cuda_aware_mpi.cmake new file mode 100644 index 0000000000..6022ea69eb --- /dev/null +++ b/cmake/configure/configure_2_cuda_aware_mpi.cmake @@ -0,0 +1,31 @@ +## --------------------------------------------------------------------- +## +## Copyright (C) 2018 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE.md at +## the top level directory of deal.II. +## +## --------------------------------------------------------------------- + +FOREACH(_dependency MPI CUDA) + IF(NOT DEAL_II_WITH_${_dependency}) + IF(DEAL_II_WITH_CUDA_AWARE_MPI) + MESSAGE(FATAL_ERROR "\n" + "DEAL_II_WITH_CUDA_AWARE_MPI has unmet configuration requirements: " + "DEAL_II_WITH_${_dependency} has to be set to \"ON\".\n\n" + ) + ELSE() + MESSAGE(STATUS + "DEAL_II_WITH_CUDA_AWARE_MPI has unmet configuration requirements: " + "DEAL_II_WITH_${_dependency} has to be set to \"ON\"." + ) + SET(DEAL_II_WITH_CUDA_AWARE_MPI OFF) + ENDIF() + ENDIF() +ENDFOREACH() diff --git a/cmake/setup_cached_variables.cmake b/cmake/setup_cached_variables.cmake index 1859c72a79..a769604252 100644 --- a/cmake/setup_cached_variables.cmake +++ b/cmake/setup_cached_variables.cmake @@ -365,6 +365,13 @@ UNSET(ENV{NVCCFLAGS}) # # ######################################################################## + OPTION(DEAL_II_WITH_CUDA_AWARE_MPI + "If set to ON, then we assume that the MPI implementation used is CUDA-aware." + OFF + ) + LIST(APPEND DEAL_II_FEATURES CUDA_AWARE_MPI) + + OPTION(DEAL_II_WITH_64BIT_INDICES "If set to ON, then use 64-bit data types to represent global degree of freedom indices. The default is to OFF. You only want to set this to ON if you will solve problems with more than 2^31 (approximately 2 billion) unknowns. If set to ON, you also need to ensure that both Trilinos and/or PETSc support 64-bit indices." OFF diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index 325f61fedb..7801a2397f 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -40,6 +40,7 @@ #cmakedefine DEAL_II_WITH_ASSIMP #cmakedefine DEAL_II_WITH_COMPLEX_VALUES #cmakedefine DEAL_II_WITH_CUDA +#cmakedefine DEAL_II_WITH_CUDA_AWARE_MPI #cmakedefine DEAL_II_WITH_CXX14 #cmakedefine DEAL_II_WITH_CXX17 #cmakedefine DEAL_II_WITH_GSL -- 2.39.5