Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure: support KOKKOS when found with PETSc #14677

Merged
merged 1 commit into from
Jan 17, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(DEAL_II_TRILINOS_WITH_KOKKOS OR DEAL_II_PETSC_WITH_KOKKOS)
if(DEAL_II_TRILINOS_WITH_KOKKOS)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm ok with this change. We probably need more automation and to provide hints to find_package to look into PETSc makefile variables KOKKOS_INCLUDE and KOKKOS_LIB

if(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND")

# 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