Skip to content

Commit

Permalink
Configure: support KOKKOS when found with PETSc
Browse files Browse the repository at this point in the history
This still require grabbing the compile flags and some special CUDA handling?
  • Loading branch information
stefanozampini committed Jan 13, 2023
1 parent f24ba87 commit a35e462
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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})
2 changes: 1 addition & 1 deletion cmake/modules/FindDEAL_II_KOKKOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cmake/modules/FindDEAL_II_PETSC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# PETSC_WITH_64BIT_INDICES
# PETSC_WITH_COMPLEX
# PETSC_WITH_HYPRE
# PETSC_WITH_KOKKOS
# PETSC_WITH_MPIUNI
# PETSC_WITH_MUMPS
#
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions include/deal.II/base/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
#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
Expand Down

0 comments on commit a35e462

Please sign in to comment.