forked from NERSC/SC21-NERSC-NRE-paper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kokkos_build_script.sh
executable file
·65 lines (59 loc) · 1.67 KB
/
Kokkos_build_script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
if [[ "${SLURM_CLUSTER_NAME}" == "escori" ]]; then
module purge
module load dgx
module load nvhpc/21.3
module load cuda/11.0.2
module load cmake/3.18.2
module load gcc/8.3.0
module list
cpus=${SLURM_CPUS_PER_TASK:-32}
RUN="srun -n 1 -c ${cpus} --cpu-bind=cores"
fi
set -x
set -e
export OMP_NUM_THREADS=1
export OMP_PLACES=threads
export OMP_PROC_BIND=spread
KOKKOS_PATH=$(pwd)/kokkos
# NOTE - The clone is not needed since the repo is added as a submodule.
# if [ ! -d kokkos ]; then
# git clone --single-branch --branch develop https://github.com/kokkos/kokkos.git
# fi
cd kokkos
git checkout 0b61c81a6756610a3e8edb2061dbe7b882a054e8
if [ -d build_cuda_nvhpc ]; then
rm -rf build_cuda_nvhpc
fi
mkdir build_cuda_nvhpc && cd build_cuda_nvhpc
cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=${KOKKOS_PATH}/install_cuda_nvhpc \
-D CMAKE_CXX_COMPILER=${KOKKOS_PATH}/bin/nvcc_wrapper \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_STANDARD=17 \
-D Kokkos_ARCH_AMPERE80=ON \
-D Kokkos_ENABLE_CUDA=ON \
-D Kokkos_ENABLE_CUDA_LAMBDA=ON \
..
make -j8
make install
cd ..
if [ -d build_ompt_nvhpc ]; then
rm -rf build_ompt_nvhpc
fi
mkdir build_ompt_nvhpc && cd build_ompt_nvhpc
cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=${KOKKOS_PATH}/install_ompt_nvhpc \
-D CMAKE_CXX_COMPILER=nvc++ \
-D CMAKE_CXX_STANDARD=17 \
-D Kokkos_ARCH_AMPERE80=ON \
-D Kokkos_ENABLE_OPENMPTARGET=ON \
-D Kokkos_ENABLE_TESTS=ON \
-D Kokkos_ENABLE_IMPL_DESUL_ATOMICS=OFF \
-D CMAKE_CXX_FLAGS="-mp=gpu -gpu=cc80" \
..
make -j8
make install
${RUN} ./core/unit_test/KokkosCore_IncrementalTest_OPENMPTARGET
cd ..
cd ..