-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathJenkinsfile-mpi
216 lines (178 loc) · 5.53 KB
/
Jenkinsfile-mpi
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
pipeline {
agent none
options {
// Required to clean before build
skipDefaultCheckout( true )
}
// cron syntax: minute hour day-of-month month day-of-week
// run hourly
triggers { pollSCM 'H * * * *' }
stages {
//======================================================================
stage('Parallel Build') {
matrix {
axes {
axis {
name 'maker'
values 'make'
}
axis {
name 'host'
values 'gpu_nvidia'
}
} // axes
stages {
stage('Build') {
agent { label "${host}" }
//----------------------------------------------------------
steps {
cleanWs()
checkout scm
sh '''
#!/bin/sh
set +e # errors are not fatal (e.g., Spack sometimes has spurious failures)
set -x # echo commands
date
hostname && pwd
export top=`pwd`
date
git submodule update --init
# Suppress echo (-x) output of commands executed with `run`. Useful for Spack.
# set +x, set -x are not echo'd.
run() {
{ set +x; } 2> /dev/null;
$@;
set -x
}
# Suppress echo (-x) output of `print` commands. https://superuser.com/a/1141026
# aliasing `echo` causes issues with spack_setup, so use `print` instead.
echo_and_restore() {
builtin echo "$*"
case "$save_flags" in
(*x*) set -x
esac
}
alias print='{ save_flags="$-"; set +x; } 2> /dev/null; echo_and_restore'
date
module load python/3.9
module load gcc/7.3.0
module load intel-oneapi-mkl/2022
# hipcc needs /usr/sbin/lsmod
export PATH=${PATH}:/usr/sbin
print "========================================"
date
print "maker ${maker}"
# For simplicity, create make.inc regardless of ${maker}
export color=no
cat > make.inc << END
CXX = mpicxx
FC = mpif90
blas = mkl
prefix = ${top}/install
END
print "========================================"
# Run CUDA, OpenMPI tests.
if [ "${host}" = "gpu_nvidia" ]; then
module load openmpi/4
export OMPI_CXX=${CXX}
echo "CXXFLAGS = -Werror" >> make.inc
echo "CXXFLAGS += -Dslate_omp_default_none='default(none)'" >> make.inc
echo "mkl_blacs = openmpi" >> make.inc
echo "cuda_arch = sm_35" >> make.inc # kepler sm_35 works in CUDA 11
echo "gpu_backend = cuda" >> make.inc
# Load CUDA. LD_LIBRARY_PATH set by Spack.
module load cuda/11
export CPATH=${CPATH}:${CUDA_HOME}/include
export LIBRARY_PATH=${LIBRARY_PATH}:${CUDA_HOME}/lib64
fi
# Run HIP, Intel MPI tests.
if [ "${host}" = "dopamine" ]; then
module load intel-mpi
export FI_PROVIDER=tcp
#echo "CXXFLAGS = -Werror" >> make.inc # HIP headers have many errors; ignore.
echo "mkl_blacs = intelmpi" >> make.inc
echo "gpu_backend = hip" >> make.inc
# Load ROCm/HIP.
export PATH=${PATH}:/opt/rocm/bin
export CPATH=${CPATH}:/opt/rocm/include
export LIBRARY_PATH=${LIBRARY_PATH}:/opt/rocm/lib:/opt/rocm/lib64
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/rocm/lib:/opt/rocm/lib64
export ROCBLAS_TENSILE_LIBPATH=/opt/rocm/lib/rocblas/library/
# HIP headers have many errors; reduce noise.
perl -pi -e 's/-pedantic//' GNUmakefile
# See the files that are opened by the executable.
# Used for debugging the ROCm library.
# extra_test_args=( -t \\\" strace -e trace=open ./tester \\\" )
fi
if [ "${maker}" = "make" ]; then
print "========================================"
make echo
fi
if [ "${maker}" = "cmake" ]; then
print "========================================"
module load cmake/3.18
rm -rf build && mkdir build && cd build
cmake -Dcolor=no -DCMAKE_CXX_FLAGS="-Werror" \
-DCMAKE_INSTALL_PREFIX=${top}/install \
..
fi
print "========================================"
# Check what is loaded.
module list
which mpicxx
which mpif90
mpicxx --version
mpif90 --version
which nvcc
nvcc --version
which hipcc
hipcc --version
echo "MKLROOT ${MKLROOT}"
print "========================================"
env
print "========================================"
date
make -j8
print "========================================"
date
make -j8 install
ls -R ${top}/install
print "========================================"
ldd test/tester
print "========================================"
date
cd test
if [ "${maker}" = "cmake" ]; then
# only sanity check with cmake build
export tests=potrf
fi
export OMP_NUM_THREADS=4
ex="gbmm, gemmA, trsmA, gels, cholqr, gelqf, unmtr_he2hb, unmtr_he2hb, he2hb, hegv, gbnorm"
ex2=${ex//,};
eval ./run_tests.py --np 4 --origin s --target t,d --quick --ref n \
"${extra_test_args[@]}" \
--timeout 1200 \
--xml ${top}/report-${maker}.xml ${tests} \
`echo $ex2|xargs printf -- ' -x %s'` \
2> ${top}/report-${maker}.txt
cd ..
date
'''
} // steps
//----------------------------------------------------------
post {
failure {
mail to: '[email protected]',
subject: "${currentBuild.fullDisplayName} >> ${STAGE_NAME} >> ${host} failed",
body: "See more at ${env.BUILD_URL}"
}
always {
junit '*.xml'
}
} // post
} // stage(Build)
} // stages
} // matrix
} // stage(Parallel Build)
} // stages
} // pipeline