run-regression.sh 3.57 KB
Newer Older
1 2 3
#!/bin/bash

# This is a shell script to be run from a login node of the Cooley system at
4
# the ALCF, that will download, compile, and execute Mochi performance 
5 6 7 8 9
# regression tests, including any dependencies

# exit on any error
set -e

10 11 12 13 14 15 16 17 18 19
# grab helpful things (especially newer compiler) from softenv
source /etc/profile.d/00softenv.sh
soft add +gcc-8.2.0
soft add +autotools-feb2016
soft add +cmake-3.9.1
soft add +mvapich2

# location of this script
ORIGIN=$PWD
# scratch area for builds
Philip Carns's avatar
Philip Carns committed
20
SANDBOX=$PWD/mochi-regression-sandbox-$$
21
# install destination
Philip Carns's avatar
Philip Carns committed
22
PREFIX=$PWD/mochi-regression-install-$$
23
# job submission dir
Philip Carns's avatar
Philip Carns committed
24
JOBDIR=$PWD/mochi-regression-job-$$
25 26 27
# modify HOME env variable so that we don't perturb ~/.spack/ files for the 
# users calling this script
export HOME=$SANDBOX
28 29

mkdir $SANDBOX
30
mkdir $PREFIX
31
mkdir $JOBDIR
32 33 34 35
cp $ORIGIN/margo-regression.qsub $JOBDIR
cp $ORIGIN/bake-regression.qsub $JOBDIR
cp $ORIGIN/pmdk-regression.qsub $JOBDIR
cp $ORIGIN/mobject-regression.qsub $JOBDIR
36

37
# set up build environment
38
cd $SANDBOX
39
git clone https://github.com/spack/spack.git
40
git clone https://xgitlab.cels.anl.gov/sds/sds-repo.git
41
git clone https://xgitlab.cels.anl.gov/sds/sds-tests.git
42 43

echo "=== BUILD SPACK PACKAGES AND LOAD ==="
44
. $SANDBOX/spack/share/spack/setup-env.sh
45 46
spack compiler find
spack compilers
47 48 49 50 51 52 53 54 55

# use our own packages.yaml for cooley-specific preferences
cp $ORIGIN/packages.yaml $SPACK_ROOT/etc/spack
# add external repo for mochi.  Note that this will not modify the 
# user's ~/.spack/ files because we modified $HOME above
spack repo add ${SANDBOX}/sds-repo
# sanity check
spack repo list
# underlying tools needed by spack
56
spack bootstrap
57
# clean out any stray packages from previous runs, just in case
58
spack uninstall -R -y argobots mercury rdma-core libfabric || true
59
# ior acts as our "apex" package here, causing several other packages to build
60
spack install ior@develop +mobject
61 62 63
# deliberately repeat setup-env step after building modules to ensure
#   that we pick up the right module paths
. $SANDBOX/spack/share/spack/setup-env.sh
64 65
# load ssg and bake because they are needed by things compiled outside of
# spack later in this script
66
spack load -r ssg
67
spack load -r bake
68

69 70 71
# sds-tests
echo "=== BUILDING SDS TEST PROGRAMS ==="
cd $SANDBOX/sds-tests
72 73 74 75 76 77
libtoolize
./prepare.sh
mkdir build
cd build
../configure --prefix=$PREFIX CC=mpicc
make -j 3
78
make install
79 80

# mercury-runner benchmark
81 82 83 84 85 86 87
# echo "=== BUILDING MERCURY-RUNNER BENCHMARK ==="
# cd $SANDBOX/mercury-runner
# mkdir build
# cd build
# CC=mpicc CXX=mpicxx CXXFLAGS='-D__STDC_FORMAT_MACROS' cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX -DMPI=ON ..
# make -j 3
# make install
88 89 90

# set up job to run
echo "=== SUBMITTING AND WAITING FOR JOB ==="
91 92
cp $PREFIX/bin/margo-p2p-latency $JOBDIR
cp $PREFIX/bin/margo-p2p-bw $JOBDIR
93
cp $PREFIX/bin/bake-p2p-bw $JOBDIR
94
cp $PREFIX/bin/pmdk-bw $JOBDIR
95
# cp $PREFIX/bin/mercury-runner $JOBDIR
96
cd $JOBDIR
97 98 99

# note: previously we also set --env LD_LIBRARY_PATH=$PREFIX/lib, hopefully no longer needed
JOBID=`qsub --env SANDBOX=$SANDBOX ./margo-regression.qsub`
100
cqwait $JOBID
101
JOBID2=`qsub --env SANDBOX=$SANDBOX ./bake-regression.qsub`
102
cqwait $JOBID2
103
JOBID3=`qsub --env SANDBOX=$SANDBOX ./pmdk-regression.qsub`
104
cqwait $JOBID3
105
JOBID4=`qsub --env SANDBOX=$SANDBOX ./mobject-regression.qsub`
Rob Latham's avatar
Rob Latham committed
106
cqwait $JOBID4
107 108 109

echo "=== JOB DONE, COLLECTING AND SENDING RESULTS ==="
# gather output, strip out funny characters, mail
Rob Latham's avatar
Rob Latham committed
110
cat $JOBID.* $JOBID2.* $JOBID3.* $JOBID4.*> combined.$JOBID.txt
111
dos2unix combined.$JOBID.txt
112
mailx -s "mochi-regression (cooley)" sds-commits@lists.mcs.anl.gov < combined.$JOBID.txt
113 114

cd /tmp
Philip Carns's avatar
Philip Carns committed
115 116
rm -rf $SANDBOX
rm -rf $PREFIX