]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Configure: support KOKKOS when found with PETSc 14677/head
authorStefano Zampini <stefano.zampini@gmail.com>
Fri, 25 Nov 2022 18:49:11 +0000 (21:49 +0300)
committerStefano Zampini <stefano.zampini@gmail.com>
Fri, 13 Jan 2023 09:26:58 +0000 (12:26 +0300)
This still require grabbing the compile flags and some special CUDA handling?

cmake/configure/configure_20_petsc.cmake [moved from cmake/configure/configure_30_petsc.cmake with 93% similarity]
cmake/modules/FindDEAL_II_KOKKOS.cmake
cmake/modules/FindDEAL_II_PETSC.cmake
include/deal.II/base/config.h.in

similarity index 93%
rename from cmake/configure/configure_30_petsc.cmake
rename to cmake/configure/configure_20_petsc.cmake
index 2411f5d11ffaf788d9382d742eeb248dd289071b..562a3917cadc7389aa70775205e47fb0497839c6 100644 (file)
@@ -112,6 +112,17 @@ macro(feature_petsc_find_external var)
       set(${var} FALSE)
     endif()
 
+    if(DEAL_II_PETSC_WITH_KOKKOS)
+      if(DEAL_II_FORCE_BUNDLED_KOKKOS)
+        set(PETSC_ADDITIONAL_ERROR_STRING
+          ${PETSC_ADDITIONAL_ERROR_STRING}
+          "The PETSc installation (found at \"${PETSC_DIR}\")"
+          "includes Kokkos, but DEAL_II_FORCE_BUNDLED_KOKKOS=ON!\n")
+        set(${var} FALSE)
+      endif()
+    endif()
+
+
     check_mpi_interface(PETSC ${var})
   endif()
 endmacro()
@@ -160,3 +171,4 @@ configure_feature(PETSC)
 set(DEAL_II_PETSC_WITH_COMPLEX ${PETSC_WITH_COMPLEX})
 set(DEAL_II_PETSC_WITH_HYPRE ${PETSC_WITH_HYPRE})
 set(DEAL_II_PETSC_WITH_MUMPS ${PETSC_WITH_MUMPS})
+set(DEAL_II_PETSC_WITH_KOKKOS ${PETSC_WITH_KOKKOS})
index 2c4ba337213596e371b2adb9f052e57efda08a52..1021e96cedc7c5a57e89ff04c29bd293dc545690 100644 (file)
@@ -26,7 +26,7 @@ set(KOKKOS_DIR "" CACHE PATH "An optional hint to a Kokkos installation")
 set_if_empty(KOKKOS_DIR "$ENV{KOKKOS_DIR}")
 
 
-if(DEAL_II_TRILINOS_WITH_KOKKOS)
+if(DEAL_II_TRILINOS_WITH_KOKKOS OR DEAL_II_PETSC_WITH_KOKKOS)
   # Let ArborX know that we have found Kokkos
   set(Kokkos_FOUND ON)
   # Let deal.II know that we have found Kokkos
index 5510095c292b5a1112488f844337243f5f53852c..678752a84ea28a3aa4600a2e702985fac8a5c3fe 100644 (file)
@@ -29,6 +29,7 @@
 #     PETSC_WITH_64BIT_INDICES
 #     PETSC_WITH_COMPLEX
 #     PETSC_WITH_HYPRE
+#     PETSC_WITH_KOKKOS
 #     PETSC_WITH_MPIUNI
 #     PETSC_WITH_MUMPS
 #
@@ -69,6 +70,7 @@ if(EXISTS ${PETSC_PETSCCONF_H})
   _petsc_feature_check(64BIT_INDICES "#define.*PETSC_USE_64BIT_INDICES 1")
   _petsc_feature_check(COMPLEX "#define.*PETSC_USE_COMPLEX 1")
   _petsc_feature_check(HYPRE "#define.*PETSC_HAVE_HYPRE 1")
+  _petsc_feature_check(KOKKOS "#define.*PETSC_HAVE_KOKKOS 1")
   _petsc_feature_check(MPIUNI "#define.*PETSC_HAVE_MPIUNI 1")
   _petsc_feature_check(MUMPS "#define.*PETSC_HAVE_MUMPS 1")
 endif()
index 2bb11c61ff7f2fdaa61195fd65ceceb400959902..4866e7d1bd6c6967e98c50b5bd8eeb8f619e8173 100644 (file)
 #cmakedefine DEAL_II_PETSC_WITH_COMPLEX
 #cmakedefine DEAL_II_PETSC_WITH_HYPRE
 #cmakedefine DEAL_II_PETSC_WITH_MUMPS
+#cmakedefine DEAL_II_PETSC_WITH_KOKKOS
 
 /* cmake/modules/FindSUNDIALS.cmake */
 #cmakedefine DEAL_II_SUNDIALS_WITH_IDAS

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.