Skip to content

Commit aee7ee1

Browse files
committed
This PR uses pre-built dependencies for asics runner
The current CI workflow is very expensive because it rebuilds lots of dependencies from scratch. To help alleviate this process, this PR makes use of pre-built dependencies (see #290). The risk of this change is if the dependencies do not get maintained on the SCOREC system, or if they become out of date with the rest of the CI infrastructure. However, since multiple folks use these dependencies on SCOREC, they will hopefully be maintained.
1 parent 0894bff commit aee7ee1

1 file changed

Lines changed: 36 additions & 155 deletions

File tree

.github/workflows/self-hosted.yml

Lines changed: 36 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
submodules: recursive
2424
path: 'pcms_${{ github.event.id }}' #under $GITHUB_WORKSPACE
2525

26+
# note: modules match to https://github.com/LACES-LAB/software-dependencies/blob/main/loads-rhel9.sh
27+
# However, due to risk of running user modifiable code, we repeat modules here.
2628
- name: setup
2729
id: setup
2830
shell: bash
@@ -36,13 +38,16 @@ jobs:
3638
cat << 'EOF' > $workDir/envGcc13.sh #quotes prevent variable expansion in doc contents
3739
set +e #avoid exiting when lua modules return non-zero on 'warning' messages
3840
source /etc/profile #provides module command
39-
module use /opt/scorec/spack/rhel9/v0222_2/lmod/linux-rhel9-x86_64/Core/
40-
module load gcc/13.2.0-4eahhas
41-
module load mpich/4.2.3-62uy3hd
42-
module load cmake/3.30.5-5e54py4
43-
module load cuda/12.6.2-gqq65nw
44-
module load openblas/0.3.28-eubd5ed
45-
export LD_LIBRARY_PATH=/opt/scorec/spack/rhel9/v0222_2/install/linux-rhel9-x86_64_v3/gcc-13.2.0/mpich-4.2.3-62uy3hdwqe75fjfskrrysco5i6gqjblv/lib:$LD_LIBRARY_PATH
41+
module purge
42+
module use /opt/scorec/spack/rhel9/v0201_4/lmod/linux-rhel9-x86_64/Core/
43+
module load gcc/12.3.0-iil3lno mpich/4.1.1-xpoyz4t cuda/12.1.1-zxa4msk
44+
module load fftw/3.3.10-qqvl57a
45+
module load cmake/3.26.3-xxgzxlv
46+
#module load openblas/0.3.23-wqm7iud
47+
module load netlib-lapack/3.11.0-b22mgwg #netlib-lapack includes blas
48+
module load netlib-scalapack/2.2.0-fzd4jvl
49+
echo "NVCC_WRAPPER_DEFAULT_COMPILER=`which mpicxx`" >> $GITHUB_ENV
50+
echo "PETSC_OPTIONS='-use_gpu_aware_mpi 0'" >> $GITHUB_ENV
4651
set -e
4752
EOF
4853
@@ -52,167 +57,43 @@ jobs:
5257
run: |
5358
workDir=$PCMS_WORK_DIR
5459
source $workDir/envGcc13.sh
55-
56-
# kokkos
57-
git clone --branch 4.6.01 --depth 1 https://github.com/kokkos/kokkos.git ${workDir}/kokkos
58-
kkbdir=${workDir}/build-kokkos
59-
cmake -S ${workDir}/kokkos -B $kkbdir \
60-
-DCMAKE_BUILD_TYPE=Release \
61-
-DCMAKE_INSTALL_PREFIX=$kkbdir/install \
62-
-DCMAKE_CXX_COMPILER=${workDir}/kokkos/bin/nvcc_wrapper \
63-
-DKokkos_ARCH_AMPERE80=ON \
64-
-DKokkos_ENABLE_SERIAL=ON \
65-
-DKokkos_ENABLE_OPENMP=off \
66-
-DKokkos_ENABLE_CUDA=on \
67-
-DKokkos_ENABLE_CUDA_LAMBDA=on \
68-
-DKokkos_ENABLE_CUDA_CONSTEXPR=on \
69-
-DKokkos_ENABLE_DEBUG=off
70-
cmake --build $kkbdir --target install -j 4
71-
echo "KOKKOS_BUILD=$kkbdir" >> $GITHUB_ENV
72-
73-
# kokkos-kernels
74-
git clone --branch 4.6.01 --depth 1 https://github.com/kokkos/kokkos-kernels.git ${workDir}/kokkos-kernels
75-
kkkbdir=${workDir}/build-kokkos-kernels
76-
cmake -S ${workDir}/kokkos-kernels -B $kkkbdir \
77-
-DCMAKE_INSTALL_PREFIX=$kkkbdir/install \
78-
-DCMAKE_BUILD_TYPE=Release \
79-
-DKokkos_ROOT=${kkbdir}/install/ \
80-
-DBUILD_SHARED_LIBS=off
81-
cmake --build $kkkbdir --target install -j 4
82-
echo "KOKKOS_KERNELS_BUILD=$kkkbdir" >> $GITHUB_ENV
83-
84-
# adios2 with and without cuda
85-
git clone --branch v2.10.2 https://github.com/ornladios/ADIOS2.git ${workDir}/ADIOS2
86-
adiosbdir=${workDir}/build-ADIOS2
87-
cmake -S ${workDir}/ADIOS2 -B $adiosbdir \
88-
-DCMAKE_INSTALL_PREFIX=$adiosbdir/install \
89-
-DADIOS2_USE_CUDA=on \
90-
-DADIOS2_USE_ZFP=off
91-
cmake --build $adiosbdir --target install -j 4
92-
echo "ADIOS_BUILD=$adiosbdir" >> $GITHUB_ENV
93-
94-
# perfstubs
95-
git clone https://github.com/UO-OACISS/perfstubs.git ${workDir}/perfstubs
96-
cd ${workDir}/perfstubs
97-
git checkout a1fa3feb1d89214e28047f166500351074b5f0c2
98-
cd $workDir
99-
psbdir=${workDir}/build-perfstubs
100-
cmake -S ${workDir}/perfstubs -B $psbdir \
101-
-DCMAKE_INSTALL_PREFIX=$psbdir/install \
102-
-DCMAKE_CXX_COMPILER=mpicxx
103-
cmake --build $psbdir --target install -j 4
104-
echo "PERFSTUBS_BUILD=$psbdir" >> $GITHUB_ENV
105-
106-
# redev
107-
git clone https://github.com/SCOREC/redev.git ${workDir}/redev
108-
cd ${workDir}/redev
109-
git checkout ac09848a5f9b89493e8b679c9080b9efe5538376
110-
cd $workDir
111-
rdbdir=${workDir}/build-redev
112-
cmake -S ${workDir}/redev -B $rdbdir \
113-
-DCMAKE_INSTALL_PREFIX=$rdbdir/install \
114-
-DADIOS2_DIR=$adiosbdir/install/lib64/cmake/adios2 \
115-
-Dperfstubs_DIR=$psbdir/install/lib/cmake \
116-
-DCMAKE_CXX_COMPILER=mpicxx \
117-
-DBUILD_SHARED_LIBS=OFF
118-
cmake --build $rdbdir --target install -j 4
119-
echo "REDEV_BUILD=$rdbdir" >> $GITHUB_ENV
120-
121-
# omega_h
122-
git clone https://github.com/SCOREC/omega_h.git ${workDir}/omegah_h
123-
cd omegah_h
124-
git checkout 1765836a00b9a64b8b3791f1442ac52f147e43b2
125-
cd $workDir
126-
ohbdir=${workDir}/build-omega_h
127-
cmake -S ${workDir}/omegah_h -B $ohbdir \
128-
-DCMAKE_INSTALL_PREFIX=$ohbdir/install \
129-
-DKokkos_DIR=${kkbdir}/install/lib64/cmake/Kokkos \
130-
-DCMAKE_BUILD_TYPE=Release \
131-
-DBUILD_SHARED_LIBS=off \
132-
-DOmega_h_USE_Kokkos=ON \
133-
-DOmega_h_USE_CUDA=on \
134-
-DOmega_h_CUDA_ARCH=80 \
135-
-DOmega_h_USE_MPI=on \
136-
-DMPIEXEC_EXECUTABLE=mpirun \
137-
-DBUILD_TESTING=off \
138-
-DCMAKE_C_COMPILER=mpicc \
139-
-DCMAKE_CXX_COMPILER=mpicxx
140-
cmake --build $ohbdir --target install -j 4
141-
echo "OMEGA_H_BUILD=$ohbdir" >> $GITHUB_ENV
142-
143-
# meshfields
144-
git clone https://github.com/SCOREC/meshFields.git ${workDir}/meshfields
145-
cd ${workDir}/meshfields
146-
git checkout b1482bbba288df210784b2345eae08e34faabdc4
147-
cd $workDir
148-
mfbdir=${workDir}/build-meshfields
149-
cmake -S ${workDir}/meshfields -B $mfbdir \
150-
-DCMAKE_INSTALL_PREFIX=$mfbdir/install \
151-
-DOmega_h_DIR=$ohbdir/install/lib64/cmake/Omega_h \
152-
-DKokkos_DIR=${kkbdir}/install/lib64/cmake/Kokkos \
153-
-DCMAKE_CXX_COMPILER=mpicxx \
154-
-DCMAKE_C_COMPILER=mpicc \
155-
-DMPIEXEC_EXECUTABLE=mpirun
156-
cmake --build $mfbdir --target install -j 4
157-
echo "MESHFIELDS_BUILD=$mfbdir" >> $GITHUB_ENV
158-
159-
# catch2
160-
git clone --branch v3.11.0 https://github.com/catchorg/Catch2.git ${workDir}/Catch2
161-
c2bdir=${workDir}/build-Catch2
162-
cmake -S ${workDir}/Catch2 -B $c2bdir \
163-
-DCMAKE_INSTALL_PREFIX=$c2bdir/install
164-
cmake --build $c2bdir --target install -j 4
165-
echo "CATCH2_BUILD=$c2bdir" >> $GITHUB_ENV
166-
167-
# petsc
168-
git clone --branch v3.24.2 https://gitlab.com/petsc/petsc.git ${workDir}/petsc
169-
cd ${workDir}/petsc
170-
./configure \
171-
PETSC_ARCH=cuda-kokkos \
172-
--with-kokkos-dir=$kkbdir/install/ \
173-
--with-kokkos-kernels-dir=$kkkbdir/install/ \
174-
--with-cuda=1 \
175-
--with-shared-libraries=0 \
176-
--with-openblas-dir="${OPENBLAS_RHEL9_ROOT}"
177-
make all check
178-
cd $workDir
179-
echo "PETSC_BUILD=${workDir}/petsc/cuda-kokkos" >> $GITHUB_ENV
180-
181-
git clone https://github.com/jacobmerson/pcms_testcases.git ${workDir}/pcms_testcases
182-
183-
# pcms
184-
export PETSC_OPTIONS="-use_gpu_aware_mpi 0"
18560
bdir=${workDir}/build-pcms
61+
62+
# PCMS dependencies are built with https://github.com/LACES-LAB/software-dependencies/blob/main/build-deps-rhel9.sh
63+
# Built artifacts are located in the $DEPENDENCY_DIR
64+
DEPENDENCY_DIR=/users/mersoj2/laces-software/build/
65+
DEVICE_ARCH=AMPERE80
18666
cmake -S ${{github.workspace}}/pcms_${{ github.event.id }} -B $bdir \
187-
-DCMAKE_BUILD_TYPE=Debug \
188-
-DCMAKE_C_COMPILER=mpicc \
189-
-DCMAKE_CXX_COMPILER=mpicxx \
67+
-DCMAKE_CXX_COMPILER=`which mpicxx` \
68+
-DCMAKE_C_COMPILER=`which mpicc` \
69+
-DCMAKE_Fortran_COMPILER=`which mpifort`\
19070
-DPCMS_TIMEOUT=20 \
191-
-DPCMS_ENABLE_SPDLOG=OFF \
192-
-DPCMS_ENABLE_PETSC=ON \
193-
-DPETSC_LINK_STATIC=ON \
194-
-DPETSC_DIR=${workDir}/petsc \
195-
-DPETSC_ARCH=cuda-kokkos \
196-
-Dredev_DIR=$rdbdir/install/lib64/cmake/redev/ \
197-
-DOmega_h_DIR=$ohbdir/install/lib64/cmake/Omega_h/ \
198-
-Dperfstubs_DIR=$psbdir/install/lib/cmake/ \
199-
-DADIOS2_DIR=$adiosbdir/install/lib64/cmake/adios2/ \
200-
-DCatch2_DIR=$c2bdir/install/lib64/cmake/Catch2/ \
201-
-DKokkos_DIR=$kkbdir/install/lib64/cmake/Kokkos/ \
202-
-DKokkosKernels_DIR=$kkkbdir/install/lib64/cmake/KokkosKernels/ \
203-
-Dmeshfields_DIR=$mfbdir/install/lib64/cmake/meshfields/ \
71+
-DCMAKE_BUILD_TYPE=Release \
72+
-DCatch2_DIR=$DEPENDENCY_DIR/Catch2/install/lib64/cmake/Catch2/ \
73+
-Dmeshfields_DIR=$DEPENDENCY_DIR/${DEVICE_ARCH}/meshFields/install/lib64/cmake/meshfields \
74+
-DOmega_h_DIR=$DEPENDENCY_DIR/${DEVICE_ARCH}/omega_h/install/lib64/cmake/Omega_h/ \
75+
-Dredev_DIR=$DEPENDENCY_DIR/${DEVICE_ARCH}/redev/install/lib64/cmake/redev/ \
20476
-DPCMS_TEST_DATA_DIR=${workDir}/pcms_testcases/ \
205-
-DCMAKE_CXX_EXTENSIONS=Off
77+
-DMPIEXEC_EXECUTABLE=`which mpirun` \
78+
-DADIOS2_DIR=$DEPENDENCY_DIR/adios2/install/lib64/cmake/adios2/ \
79+
-Dperfstubs_DIR=$DEPENDENCY_DIR/perfstubs/install/lib/cmake/ \
80+
-DKokkos_DIR=$DEPENDENCY_DIR/${DEVICE_ARCH}/kokkos/install/lib64/cmake/Kokkos/ \
81+
-DKokkosKernels_DIR=$DEPENDENCY_DIR/${DEVICE_ARCH}/kokkos-kernels/install/lib64/cmake/KokkosKernels/ \
82+
-DBUILD_TESTING=ON \
83+
-DPETSC_ARCH="" \
84+
-DPETSC_DIR=$DEPENDENCY_DIR/${DEVICE_ARCH}/petsc/install \
85+
-DPCMS_ENABLE_SPDLOG=OFF
86+
20687
cmake --build $bdir
20788
ctest --test-dir $bdir --output-on-failure
20889
90+
20991
- name: Save Result Link
21092
if: ${{ !cancelled() }} #prepare report unless the job was cancelled
21193
run: |
21294
mkdir -p ./pr
21395
echo "${{ github.event.id }}" > ./pr/issueNumber
21496
echo "Test Results:" > ./pr/message
215-
echo "- Kokkos CUDA: ${{ steps.build_pcms_kokkos_cuda.outcome }}" >> ./pr/message
21697
echo "" >> ./pr/message
21798
echo "[(details)](https://github.com/${{github.repository}}/actions/runs/${{ github.run_id }})" >> ./pr/message
21899

0 commit comments

Comments
 (0)