run-regression.sh 2.98 KB
Newer Older
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
#!/bin/bash

# This is a shell script to be run from a login node of the Theta 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

# exit on any error
set -e

module swap PrgEnv-intel PrgEnv-gnu
module load cce

export CFLAGS="-O3"
export CRAYPE_LINK_TYPE=dynamic

SANDBOX=~/tmp/mochi-regression-sandbox-$$
PREFIX=~/tmp/mochi-regression-install-$$
JOBDIR=~/tmp/mochi-regression-job-$$

# scratch area to clone and build things
mkdir -p $SANDBOX
cp spack-shell.patch  $SANDBOX/

# scratch area for job submission
mkdir -p $JOBDIR
Philip Carns's avatar
Philip Carns committed
29
cp margo-regression.qsub $JOBDIR
30 31 32 33

cd $SANDBOX
git clone https://github.com/spack/spack.git
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
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
patch -p1 < ../spack-shell.patch
export SPACK_SHELL=bash
. $SANDBOX/spack/share/spack/setup-env.sh
spack repo add $SANDBOX/sds-repo
spack uninstall -R -y argobots mercury libfabric  | true
spack install ssg
# 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

# 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

62 63 64
# sds-tests
echo "=== BUILDING SDS TEST PROGRAMS ==="
cd $SANDBOX/sds-tests
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
libtoolize
./prepare.sh
mkdir build
cd build
../configure --prefix=$PREFIX CC=cc
make -j 3
make install

# 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 ==="
84 85
cp $PREFIX/bin/margo-p2p-latency $JOBDIR
cp $PREFIX/bin/margo-p2p-bw $JOBDIR
86 87 88
# cp $PREFIX/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_latency $JOBDIR
# cp $PREFIX/bin/mercury-runner $JOBDIR
cd $JOBDIR
Philip Carns's avatar
Philip Carns committed
89
JOBID=`qsub --env SANDBOX=$SANDBOX ./margo-regression.qsub`
90 91 92 93 94 95
cqwait $JOBID

echo "=== JOB DONE, COLLECTING AND SENDING RESULTS ==="
# gather output, strip out funny characters, mail
cat $JOBID.* > combined.$JOBID.txt
#dos2unix combined.$JOBID.txt
96
mailx -r carns@mcs.anl.gov -s "margo-regression (theta dynamic link)" sds-commits@lists.mcs.anl.gov < combined.$JOBID.txt
97 98 99 100 101 102
cat combined.$JOBID.txt

cd /tmp
spack repo rm $SANDBOX/sds-repo
rm -rf $SANDBOX
rm -rf $PREFIX