-
Notifications
You must be signed in to change notification settings - Fork 2
/
node_bench_flops
executable file
·59 lines (50 loc) · 1.55 KB
/
node_bench_flops
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
#!/bin/bash
set -e # any error will stop everyting
usage() {
echo "usage: `basename $0` <blas_type> <num_cores> <hpl_extract_directory> [precompiled packages to install before]"
}
myecho() {
echo "### "$(date "+%Y-%m-%d %H:%M:%S")" ### ${@}"
}
myecho "`basename $0` start. args = $@"
myecho "on `uname -a`"
WORKDIR=$(cd `dirname $0`; pwd)
if [ "$#" -lt "3" ] ; then
usage
exit 1
fi
MODE=$1
case "$MODE" in
"atlas") ;;
*) usage ; exit 1 ;;
esac
NUM_CORES=$2
HPL_EXTRACTDIR=$3
shift 3
PACKAGES="$@"
# ensure no cpu throttling
myecho "ensure no cpu throttling"
for cpu in /sys/devices/system/cpu/cpu* ; do
if [ -f "$cpu/cpufreq/scaling_governor" ] ; then
myecho " cpu: $cpu"
if [ `cat "$cpu/cpufreq/scaling_governor"` != "performance" ] ; then
echo "$cpu/cpufreq/scaling_governor = "`cat $cpu/cpufreq/scaling_governor` >&2
exit 1
fi
fi
done
cd $WORKDIR
myecho "extract packages"
for PACKAGE in $PACKAGES ; do
myecho " $PACKAGE"
tar xzf $PACKAGE
done
# prepare hpl bench configuration
myecho "prepare hpl configuration"
mv "$WORKDIR/$HPL_EXTRACTDIR/bin/Linux_PII_CBLAS/HPL.dat" "$WORKDIR/$HPL_EXTRACTDIR/bin/Linux_PII_CBLAS/HPL.dat.bak"
cp "$WORKDIR/HPL.dat" "$WORKDIR/$HPL_EXTRACTDIR/bin/Linux_PII_CBLAS/HPL.dat"
# run hpl bench (results go in HPL.out)
myecho "run hpl"
cd "$WORKDIR/$HPL_EXTRACTDIR/bin/Linux_PII_CBLAS/"
$WORKDIR/openmpi-install/bin/mpirun --mca plm_rsh_agent "oarsh" --mca btl self,sm,tcp --mca btl_tcp_if_exclude ib0,lo,myri0 -np "$NUM_CORES" xhpl
myecho "hpl bench finished"