Skip to content

Commit

Permalink
hypre, kokkos, and petsc
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhei committed Sep 4, 2024
1 parent 6c1f051 commit e90fe24
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 5 deletions.
3 changes: 3 additions & 0 deletions candi.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ BUILD_EXAMPLES=ON

# Option {ON|OFF}: Enable using CUDA/nvidia support using Kokkos?
USE_KOKKOS_WITH_CUDA=OFF
SET_CUDA_ARCH=89

# Option {ON|OFF}: Unset CXX and set the compiler as MPI_CXX_COMPILER when configuring deal.II
#
Expand Down Expand Up @@ -88,7 +89,9 @@ PACKAGES="${PACKAGES} once:sundials"
PACKAGES="${PACKAGES} once:hdf5"
#PACKAGES="${PACKAGES} once:netcdf"
PACKAGES="${PACKAGES} once:p4est"
#PACKAGES="${PACKAGES} once:kokkos once:kokkoskernels"
PACKAGES="${PACKAGES} once:trilinos"
#PACKAGES="${PACKAGES} once:hypre"
PACKAGES="${PACKAGES} once:petsc"
PACKAGES="${PACKAGES} once:slepc"
PACKAGES="${PACKAGES} once:symengine"
Expand Down
28 changes: 28 additions & 0 deletions deal.II-toolchain/packages/hypre.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
VERSION=2.31.0;CHECKSUM=3e6a9cea4e87d5d87301c95200d28242

NAME=v${VERSION}
SOURCE=https://github.com/hypre-space/hypre/archive/refs/tags/
EXTRACTSTO=hypre-${VERSION}/src
PACKING=.tar.gz
BUILDDIR=${UNPACK_PATH}/${EXTRACTSTO}
BUILDCHAIN=autotools
INSTALL_PATH=${INSTALL_PATH}/hypre-${NAME}

CONFOPTS="--enable-shared"
if [ ${USE_KOKKOS_WITH_CUDA} = ON ]; then
CONFOPTS="${CONFOPTS} --with-gpu-arch=${USE_CUDA_ARCH} --with-cuda --enable-unified-memory"
fi


package_specific_register () {
export HYPRE_DIR=${INSTALL_PATH}
}

package_specific_conf () {
# Generate configuration file
CONFIG_FILE=${CONFIGURATION_PATH}/hypre-${NAME}
rm -f ${CONFIG_FILE}
echo "
export HYPRE_DIR=${INSTALL_PATH}
" >> $CONFIG_FILE
}
32 changes: 32 additions & 0 deletions deal.II-toolchain/packages/kokkos.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
VERSION=4.4.00;CHECKSUM=95af2e2d4b10a67a63cce09715fba127

NAME=${VERSION}
PACKING=.tar.gz
SOURCE=https://github.com/kokkos/kokkos/archive/refs/tags/
EXTRACTSTO=kokkos-${VERSION}
INSTALL_PATH=${INSTALL_PATH}/kokkos-${NAME}
BUILDDIR=${BUILD_PATH}/kokkos-${VERSION}

BUILDCHAIN=cmake

CONFOPTS="-D BUILD_SHARED_LIBS=ON"

if [ ${USE_KOKKOS_WITH_CUDA} = ON ]; then
CONFOPTS="${CONFOPTS} \
-D Kokkos_ENABLE_CUDA=ON \
-D Kokkos_ENABLE_CUDA_LAMBDA=ON \
-D Kokkos_ENABLE_CUDA_CONSTEXPR=ON"
fi

package_specific_register () {
export KOKKOS_DIR=${INSTALL_PATH}
}

package_specific_conf () {
# Generate configuration file
CONFIG_FILE=${CONFIGURATION_PATH}/kokkos-${NAME}
rm -f $CONFIG_FILE
echo "
export KOKKOS_DIR=${INSTALL_PATH}
" >> $CONFIG_FILE
}
28 changes: 28 additions & 0 deletions deal.II-toolchain/packages/kokkoskernels.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
VERSION=4.4.00;CHECKSUM=a1e596b2153ff260448984c43dacb814

NAME=${VERSION}
PACKING=.tar.gz
SOURCE=https://github.com/kokkos/kokkos-kernels/archive/refs/tags/
EXTRACTSTO=kokkos-kernels-${VERSION}
BUILDDIR=${BUILD_PATH}/kokkos-kernels-${VERSION}

# we just install into the Kokkos directory:
INSTALL_PATH=${INSTALL_PATH}/kokkos-${VERSION}

BUILDCHAIN=cmake

CONFOPTS="-D BUILD_SHARED_LIBS=ON"

if [ ${USE_KOKKOS_WITH_CUDA} = ON ]; then
CONFOPTS="${CONFOPTS}"
fi


package_specific_conf () {
# Generate configuration file
CONFIG_FILE=${CONFIGURATION_PATH}/kokkos-kernels-${NAME}
rm -f $CONFIG_FILE
echo "
#export KOKKOS_DIR=${INSTALL_PATH}
" >> $CONFIG_FILE
}
25 changes: 20 additions & 5 deletions deal.II-toolchain/packages/petsc.package
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
## PETSc ##
################################################################################

VERSION=3.21.4
CHECKSUM=e8d76467696fcff970bd56c93dd83476

#VERSION=3.19.4
#CHECKSUM=477c30e120498dba4fad01020d4b0ffc

VERSION=3.18.6
CHECKSUM=8eb924facc586b3368536ad2b9df1d35
#VERSION=3.18.6
#CHECKSUM=8eb924facc586b3368536ad2b9df1d35

#VERSION=3.16.4
#CHECKSUM=7de82ee5543cba9a7c12ca00c81f0b87
Expand Down Expand Up @@ -49,6 +52,16 @@ CONFOPTS="\
--with-x=0 \
--with-64-bit-indices=${with64bit}"


if [ ${USE_KOKKOS_WITH_CUDA} = ON ]; then
CONFOPTS="\
${CONFOPTS} \
--with-kokkos=1 \
--with-kokkos-kernels=1 \
--with-cuda=1 \
--with-kokkos-dir=${KOKKOS_DIR}"
fi

# It would seem simpler to put the {C|CXX|F}OPTFLAGS directly into the
# CONFOPTS variable, but there is no easy way to quote the
# multiarguments and retain the quotes correctly when passing to
Expand All @@ -61,9 +74,11 @@ else
OPTFLAGS="-g -O"
fi

for external_pkg in hypre; do
CONFOPTS="${CONFOPTS} --download-${external_pkg}=1"
done
if [ ! -z "${HYPRE_DIR}" ]; then
CONFOPTS="${CONFOPTS} --with-hypre=1 --with-hypre-dir=${HYPRE_DIR}"
else
CONFOPTS="${CONFOPTS} --download-hypre=1"
fi

if [ ! -z "${CC}" ]; then
CONFOPTS="${CONFOPTS} CC=${CC}"
Expand Down

0 comments on commit e90fe24

Please sign in to comment.