Skip to content

Commit ff2a2b9

Browse files
authored
Create self hosted CI (#229)
create self hosted ci
1 parent d50b976 commit ff2a2b9

File tree

2 files changed

+222
-1
lines changed

2 files changed

+222
-1
lines changed

.github/workflows/self-hosted.yml

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
name: self-hosted.yml
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build_and_test:
10+
# The asics environment is only for launching on self-hosted runners.
11+
# Do not use or edit this environment for any other purpose.
12+
environment: asics
13+
permissions:
14+
contents: read
15+
# The type of runner that the job will run on
16+
runs-on: [self-hosted, linux, x64, gpu]
17+
18+
steps:
19+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
20+
- uses: actions/checkout@v4
21+
with:
22+
# ref: refs/pull/${{ github.event.issue.number }}/head
23+
submodules: recursive
24+
path: 'pcms_${{ github.event.id }}' #under $GITHUB_WORKSPACE
25+
26+
- name: setup
27+
id: setup
28+
shell: bash
29+
run: |
30+
echo "github.workspace ${{github.workspace}}"
31+
date=`date +%F-%H-%M`
32+
workDir=${{github.workspace}}/pcmsCI_${date}
33+
mkdir -p $workDir
34+
echo "PCMS_WORK_DIR=$workDir" >> $GITHUB_ENV
35+
echo "workDir $workDir"
36+
cat << 'EOF' > $workDir/envGcc13.sh #quotes prevent variable expansion in doc contents
37+
set +e #avoid exiting when lua modules return non-zero on 'warning' messages
38+
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
46+
set -e
47+
EOF
48+
49+
- name: build pcms
50+
id: build_pcms_kokkos_cuda
51+
shell: bash
52+
run: |
53+
workDir=$PCMS_WORK_DIR
54+
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 1452ec290dc6f8638019e342758325611e16ad77
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+
bdir=${workDir}/build-pcms
185+
cmake -S ${{github.workspace}}/pcms_${{ github.event.id }} -B $bdir \
186+
-DCMAKE_BUILD_TYPE=Debug \
187+
-DCMAKE_C_COMPILER=mpicc \
188+
-DCMAKE_CXX_COMPILER=mpicxx \
189+
-DPCMS_TIMEOUT=20 \
190+
-DPCMS_ENABLE_SPDLOG=OFF \
191+
-DPCMS_ENABLE_PETSC=ON \
192+
-DPETSC_DIR=${workDir}/petsc \
193+
-DPETSC_ARCH=cuda-kokkos \
194+
-Dredev_DIR=$rdbdir/install/lib64/cmake/redev/ \
195+
-DOmega_h_DIR=$ohbdir/install/lib64/cmake/Omega_h/ \
196+
-Dperfstubs_DIR=$psbdir/install/lib/cmake/ \
197+
-DADIOS2_DIR=$adiosbdir/install/lib64/cmake/adios2/ \
198+
-DCatch2_DIR=$c2bdir/install/lib64/cmake/Catch2/ \
199+
-DKokkos_DIR=$kkbdir/install/lib64/cmake/Kokkos/ \
200+
-DKokkosKernels_DIR=$kkkbdir/install/lib64/cmake/KokkosKernels/ \
201+
-Dmeshfields_DIR=$mfbdir/install/lib64/cmake/meshfields/ \
202+
-DPCMS_TEST_DATA_DIR=${workDir}/pcms_testcases/ \
203+
-DCMAKE_CXX_EXTENSIONS=Off
204+
cmake --build $bdir
205+
ctest --test-dir $bdir --output-on-failure
206+
207+
- name: Save Result Link
208+
if: ${{ !cancelled() }} #prepare report unless the job was cancelled
209+
run: |
210+
mkdir -p ./pr
211+
echo "${{ github.event.id }}" > ./pr/issueNumber
212+
echo "Test Results:" > ./pr/message
213+
echo "- Kokkos CUDA: ${{ steps.build_pcms_kokkos_cuda.outcome }}" >> ./pr/message
214+
echo "" >> ./pr/message
215+
echo "[(details)](https://github.com/${{github.repository}}/actions/runs/${{ github.run_id }})" >> ./pr/message
216+
217+
- name: Cleanup
218+
if: ${{ !cancelled() }}
219+
run: |
220+
echo "PCMS_WORK_DIR $PCMS_WORK_DIR"
221+
rm -rf $PCMS_WORK_DIR

test/test_interpolation.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ program test_interpolation
1010
type(PcmsInterpolatorHandle) :: interpolator, point_cloud_interpolator
1111
type(PcmsOmegaHMeshHandle) :: mesh
1212
type(PcmsOmegaHLibraryHandle) :: omega_h_lib
13-
character(len=100) :: filename, num_faces_str, num_vertices_str
13+
character(len=150) :: filename, num_faces_str, num_vertices_str
1414
real(8) :: radius
1515
integer :: num_faces, num_vertices
1616
integer :: i

0 commit comments

Comments
 (0)