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

Build scripts for ADIOS2 with CUDA and Kokkos backend #3579

Merged
merged 3 commits into from
Apr 8, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions scripts/build_scripts/build-adios2-cuda-perlmutter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
# shellcheck disable=SC2191

module load cudatoolkit/11.7
module load gcc/11.2.0
module load cmake/3.24.3
module refresh

######## User Configurations ########
ADIOS2_HOME=$(pwd)
BUILD_DIR=${ADIOS2_HOME}/build-cuda-perlmutter
INSTALL_DIR=${ADIOS2_HOME}/install-cuda-perlmutter

num_build_procs=4

######## ADIOS2 ########
mkdir -p "${BUILD_DIR}"
rm -f "${BUILD_DIR}/CMakeCache.txt"
rm -rf "${BUILD_DIR}/CMakeFiles"

ARGS_ADIOS=(
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-D BUILD_TESTING=OFF
-D ADIOS2_BUILD_EXAMPLES=OFF
-D CMAKE_CXX_COMPILER=g++
-D CMAKE_C_COMPILER=gcc

-D ADIOS2_USE_CUDA=ON

-D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
-D BUILD_SHARED_LIBS=ON
-D ADIOS2_USE_Fortran=OFF
)
cmake "${ARGS_ADIOS[@]}" -S "${ADIOS2_HOME}" -B "${BUILD_DIR}"
cmake --build "${BUILD_DIR}" -j${num_build_procs}
cmake --install "${BUILD_DIR}"
35 changes: 35 additions & 0 deletions scripts/build_scripts/build-adios2-cuda-summit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# shellcheck disable=SC2191

module load gcc/10.2
module load cuda/11.5
module load cmake/3.23
module refresh

######## User Configurations ########
ADIOS2_HOME=$(pwd)
BUILD_DIR=${ADIOS2_HOME}/build-cuda-summit
INSTALL_DIR=${ADIOS2_HOME}/install-cuda-summit

num_build_procs=4

######## ADIOS2 ########
mkdir -p "${BUILD_DIR}"
rm -f "${BUILD_DIR}/CMakeCache.txt"
rm -rf "${BUILD_DIR}/CMakeFiles"

ARGS_ADIOS=(
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-D BUILD_TESTING=OFF
-D ADIOS2_BUILD_EXAMPLES=OFF
-D CMAKE_CXX_COMPILER=g++
-D CMAKE_C_COMPILER=gcc

-D ADIOS2_USE_CUDA=ON

-D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
-D BUILD_SHARED_LIBS=ON
)
cmake "${ARGS_ADIOS[@]}" -S "${ADIOS2_HOME}" -B "${BUILD_DIR}"
cmake --build "${BUILD_DIR}" -j${num_build_procs}
cmake --install "${BUILD_DIR}"
61 changes: 61 additions & 0 deletions scripts/build_scripts/build-adios2-kokkos-crusher.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
# shellcheck disable=SC2191

module load rocm/5.4.0
module load gcc/11.2.0
module load cmake/3.23.2
module load craype-accel-amd-gfx90a

######## User Configurations ########
Kokkos_HOME=$HOME/kokkos/kokkos
ADIOS2_HOME=$(pwd)
BUILD_DIR=${ADIOS2_HOME}/build-kokkos-crusher
INSTALL_DIR=${ADIOS2_HOME}/install-kokkos-crusher

num_build_procs=4

######## Kokkos ########
mkdir -p "${BUILD_DIR}/kokkos"
rm -f "${BUILD_DIR}/kokkos/CMakeCache.txt"
rm -rf "${BUILD_DIR}/kokkos/CMakeFiles"

ARGS=(
-D CMAKE_BUILD_TYPE=RelWithDebInfo
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-D CMAKE_CXX_COMPILER=hipcc

-D Kokkos_ENABLE_SERIAL=ON
-D Kokkos_ARCH_ZEN3=ON
-D Kokkos_ENABLE_HIP=ON
-D Kokkos_ARCH_VEGA90A=ON

-D CMAKE_CXX_STANDARD=17
-D CMAKE_CXX_EXTENSIONS=OFF
-D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
-D BUILD_SHARED_LIBS=ON
)
cmake "${ARGS[@]}" -S "${Kokkos_HOME}" -B "${BUILD_DIR}/kokkos"
cmake --build "${BUILD_DIR}/kokkos" -j${num_build_procs}
cmake --install "${BUILD_DIR}/kokkos"

######## ADIOS2 ########
mkdir -p "${BUILD_DIR}/adios2"
rm -f "${BUILD_DIR}/adios2/CMakeCache.txt"
rm -rf "${BUILD_DIR}/adios2/CMakeFiles"

ARGS_ADIOS=(
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-D BUILD_TESTING=OFF
-D ADIOS2_BUILD_EXAMPLES=OFF
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_C_COMPILER=gcc

-D ADIOS2_USE_Kokkos=ON
-D Kokkos_ROOT="${INSTALL_DIR}"

-D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
-D BUILD_SHARED_LIBS=ON
)
cmake "${ARGS_ADIOS[@]}" -S "${ADIOS2_HOME}" -B "${BUILD_DIR}"/adios2
cmake --build "${BUILD_DIR}/adios2" -j${num_build_procs}
cmake --install "${BUILD_DIR}/adios2"
63 changes: 63 additions & 0 deletions scripts/build_scripts/build-adios2-kokkos-perlmutter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash
# shellcheck disable=SC2191

module load cudatoolkit/11.7
module load gcc/11.2.0
module load cmake/3.24.3
module refresh

######## User Configurations ########
Kokkos_HOME=$HOME/kokkos/kokkos
ADIOS2_HOME=$(pwd)
BUILD_DIR=${ADIOS2_HOME}/build-kokkos-perlmutter
INSTALL_DIR=${ADIOS2_HOME}/install-kokkos-perlmutter

num_build_procs=4

######## Kokkos ########
mkdir -p "${BUILD_DIR}/kokkos"
rm -f "${BUILD_DIR}/kokkos/CMakeCache.txt"
rm -rf "${BUILD_DIR}/kokkos/CMakeFiles"

ARGS=(
-D CMAKE_BUILD_TYPE=RelWithDebInfo
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-D CMAKE_CXX_COMPILER="${Kokkos_HOME}/bin/nvcc_wrapper"

-D Kokkos_ENABLE_SERIAL=ON
-D Kokkos_ARCH_ZEN3=ON
-D Kokkos_ENABLE_CUDA=ON
-D Kokkos_ENABLE_CUDA_LAMBDA=ON # from Kokkos 4.0 this is not needed
-D Kokkos_ARCH_AMPERE80=ON

-D CMAKE_CXX_STANDARD=17
-D CMAKE_CXX_EXTENSIONS=OFF
-D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
-D BUILD_SHARED_LIBS=ON
)
cmake "${ARGS[@]}" -S "${Kokkos_HOME}" -B "${BUILD_DIR}/kokkos"
cmake --build "${BUILD_DIR}/kokkos" -j${num_build_procs}
cmake --install "${BUILD_DIR}/kokkos"

######## ADIOS2 ########
mkdir -p "${BUILD_DIR}/adios2"
rm -f "${BUILD_DIR}/adios2/CMakeCache.txt"
rm -rf "${BUILD_DIR}/adios2/CMakeFiles"

ARGS_ADIOS=(
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-D BUILD_TESTING=OFF
-D ADIOS2_BUILD_EXAMPLES=OFF
-D CMAKE_CXX_COMPILER=g++
-D CMAKE_C_COMPILER=gcc

-D ADIOS2_USE_Kokkos=ON
-D Kokkos_ROOT="${INSTALL_DIR}"

-D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
-D BUILD_SHARED_LIBS=ON
-D ADIOS2_USE_Fortran=OFF
)
cmake "${ARGS_ADIOS[@]}" -S "${ADIOS2_HOME}" -B "${BUILD_DIR}"/adios2
cmake --build "${BUILD_DIR}/adios2" -j${num_build_procs}
cmake --install "${BUILD_DIR}/adios2"
62 changes: 62 additions & 0 deletions scripts/build_scripts/build-adios2-kokkos-summit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
# shellcheck disable=SC2191

module load gcc/10.2
module load cuda/11.5
module load cmake/3.23
module refresh

######## User Configurations ########
Kokkos_HOME=$HOME/kokkos/kokkos
ADIOS2_HOME=$(pwd)
BUILD_DIR=${ADIOS2_HOME}/build-kokkos-summit
INSTALL_DIR=${ADIOS2_HOME}/install-kokkos-summit

num_build_procs=4

######## Kokkos ########
mkdir -p "${BUILD_DIR}/kokkos"
rm -f "${BUILD_DIR}/kokkos/CMakeCache.txt"
rm -rf "${BUILD_DIR}/kokkos/CMakeFiles"

ARGS=(
-D CMAKE_BUILD_TYPE=RelWithDebInfo
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-D CMAKE_CXX_COMPILER="${Kokkos_HOME}/bin/nvcc_wrapper"

-D Kokkos_ENABLE_SERIAL=ON
-D Kokkos_ARCH_POWER9=ON
-D Kokkos_ENABLE_CUDA=ON
-D Kokkos_ENABLE_CUDA_LAMBDA=ON # from Kokkos 4.0 this is not needed
-D Kokkos_ARCH_VOLTA70=ON

-D CMAKE_CXX_STANDARD=17
-D CMAKE_CXX_EXTENSIONS=OFF
-D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
-D BUILD_SHARED_LIBS=ON
)
cmake "${ARGS[@]}" -S "${Kokkos_HOME}" -B "${BUILD_DIR}/kokkos"
cmake --build "${BUILD_DIR}/kokkos" -j${num_build_procs}
cmake --install "${BUILD_DIR}/kokkos"

######## ADIOS2 ########
mkdir -p "${BUILD_DIR}/adios2"
rm -f "${BUILD_DIR}/adios2/CMakeCache.txt"
rm -rf "${BUILD_DIR}/adios2/CMakeFiles"

ARGS_ADIOS=(
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-D BUILD_TESTING=OFF
-D ADIOS2_BUILD_EXAMPLES=OFF
-D CMAKE_CXX_COMPILER=g++
-D CMAKE_C_COMPILER=gcc

-D ADIOS2_USE_Kokkos=ON
-D Kokkos_ROOT="${INSTALL_DIR}"

-D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
-D BUILD_SHARED_LIBS=ON
)
cmake "${ARGS_ADIOS[@]}" -S "${ADIOS2_HOME}" -B "${BUILD_DIR}"/adios2
cmake --build "${BUILD_DIR}/adios2" -j${num_build_procs}
cmake --install "${BUILD_DIR}/adios2"