run-regression.sh 3.74 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash

# This is a shell script to be run from a login node of the Cooley system at
# the ALCF, that will download, compile, and execute the ssg performance 
# regression tests, including any dependencies

# SEE README.spack.md for environment setup information!  This script will not
#     work properly without properly configured spack environment, in
#     particular with a fix for the SPACK_SHELL environment variable detection

# exit on any error
set -e

14 15 16
# make sure we have a new-ish gcc
soft add +gcc-8.2.0

Philip Carns's avatar
Philip Carns committed
17 18 19
SANDBOX=$PWD/mochi-regression-sandbox-$$
PREFIX=$PWD/mochi-regression-install-$$
JOBDIR=$PWD/mochi-regression-job-$$
20 21 22

# scratch area to clone and build things
mkdir $SANDBOX
Philip Carns's avatar
Philip Carns committed
23
cp packages.yaml $SANDBOX/
24 25 26

# scratch area for job submission
mkdir $JOBDIR
27
cp margo-regression.qsub $JOBDIR
28
cp bake-regression.qsub $JOBDIR
29
cp pmdk-regression.qsub $JOBDIR
30 31

cd $SANDBOX
32
git clone https://github.com/spack/spack.git
33
git clone https://xgitlab.cels.anl.gov/sds/sds-repo.git
34
git clone https://xgitlab.cels.anl.gov/sds/sds-tests.git
35 36 37 38 39 40 41 42
wget http://mvapich.cse.ohio-state.edu/download/mvapich/osu-micro-benchmarks-5.3.2.tar.gz
tar -xvzf osu-micro-benchmarks-5.3.2.tar.gz
git clone https://github.com/pdlfs/mercury-runner.git

# set up most of the libraries in spack
echo "=== BUILD SPACK PACKAGES AND LOAD ==="
cd $SANDBOX/spack
. $SANDBOX/spack/share/spack/setup-env.sh
43 44
spack compiler find
spack compilers
Philip Carns's avatar
Philip Carns committed
45 46 47 48 49 50 51 52
# put packages file in place in SPACK_ROOT to set our preferences for building
# Mochi stack
cp $SANDBOX/packages.yaml $SPACK_ROOT/etc/spack
# set up repos file to point to sds-repo; we do this manually because 
#    "spack repo add" will create files in ~/.spack, which is a bad idea in 
#    CI environments
echo "repos:" > $SPACK_ROOT/etc/spack/repos.yaml
echo "- ${SANDBOX}/sds-repo" >> $SPACK_ROOT/etc/spack/repos.yaml
53 54
spack bootstrap
spack uninstall -R -y argobots mercury rdma-core libfabric || true
55 56
spack install ssg
spack install bake
57 58 59 60
# 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
spack load -r ssg
61
spack load -r bake
62 63 64 65 66 67 68 69 70 71 72 73 74

# less ancient gcc
export CFLAGS="-O3"

# OSU MPI benchmarks
echo "=== BUILDING OSU MICRO BENCHMARKS ==="
cd $SANDBOX/osu-micro-benchmarks-5.3.2
mkdir build
cd build
../configure --prefix=$PREFIX CC=mpicc CXX=mpicxx
make -j 3
make install

75 76 77
# sds-tests
echo "=== BUILDING SDS TEST PROGRAMS ==="
cd $SANDBOX/sds-tests
78 79 80 81 82 83
libtoolize
./prepare.sh
mkdir build
cd build
../configure --prefix=$PREFIX CC=mpicc
make -j 3
84
make install
85 86 87 88 89 90 91 92 93 94 95 96

# mercury-runner benchmark
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

# set up job to run
echo "=== SUBMITTING AND WAITING FOR JOB ==="
97 98
cp $PREFIX/bin/margo-p2p-latency $JOBDIR
cp $PREFIX/bin/margo-p2p-bw $JOBDIR
99
cp $PREFIX/bin/bake-p2p-bw $JOBDIR
100
cp $PREFIX/bin/pmdk-bw $JOBDIR
101 102 103
cp $PREFIX/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_latency $JOBDIR
cp $PREFIX/bin/mercury-runner $JOBDIR
cd $JOBDIR
104
JOBID=`qsub --env LD_LIBRARY_PATH=$PREFIX/lib --env SANDBOX=$SANDBOX ./margo-regression.qsub`
105
cqwait $JOBID
106 107
JOBID2=`qsub --env LD_LIBRARY_PATH=$PREFIX/lib --env SANDBOX=$SANDBOX ./bake-regression.qsub`
cqwait $JOBID2
108 109
JOBID3=`qsub --env LD_LIBRARY_PATH=$PREFIX/lib --env SANDBOX=$SANDBOX ./pmdk-regression.qsub`
cqwait $JOBID3
110 111 112

echo "=== JOB DONE, COLLECTING AND SENDING RESULTS ==="
# gather output, strip out funny characters, mail
113
cat $JOBID.* $JOBID2.* $JOBID3.* > combined.$JOBID.txt
114
#dos2unix combined.$JOBID.txt
115
mailx -s "mochi-regression (cooley)" sds-commits@lists.mcs.anl.gov < combined.$JOBID.txt
116 117

cd /tmp
Philip Carns's avatar
Philip Carns committed
118 119
rm -rf $SANDBOX
rm -rf $PREFIX