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

# This is a shell script to be run from a login node of the Bebop system at
# the LCRC, 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

13 14 15 16
get_psm2_lib_path() {
    module show `spack module tcl find opa-psm2` |&grep LD_LIBRARY_PATH | cut -d \" -f 4
}

Philip Carns's avatar
Philip Carns committed
17 18 19
# load newer gcc up front
module load gcc_new/7.3.0

20 21 22
# location of this script
ORIGIN=$PWD
# scratch area for builds
23
SANDBOX=$PWD/mochi-regression-sandbox-$$
24
# install destination
25
PREFIX=$PWD/mochi-regression-install-$$
26
# job submission dir
27
JOBDIR=$PWD/mochi-regression-job-$$
28 29 30 31 32 33 34 35 36 37 38 39 40
# modify HOME env variable so that we don't perturb ~/.spack/ files for the 
# users calling this script
export HOME=$SANDBOX

mkdir $SANDBOX
mkdir $PREFIX
mkdir $JOBDIR
cp $ORIGIN/margo-regression.sbatch $JOBDIR
cp $ORIGIN/bake-regression.sbatch $JOBDIR
cp $ORIGIN/pmdk-regression.sbatch $JOBDIR
cp $ORIGIN/mobject-regression.sbatch $JOBDIR

# set up build environment
41
cd $SANDBOX
42 43
# as of 2019-05-17, clone fork with correction to PSM2 package
git clone -b carns/dev-opa-psm2-path https://github.com/carns/spack.git
44
git clone https://xgitlab.cels.anl.gov/sds/sds-repo.git
45
git clone https://xgitlab.cels.anl.gov/sds/sds-tests.git
46 47 48

echo "=== BUILD SPACK PACKAGES AND LOAD ==="
. $SANDBOX/spack/share/spack/setup-env.sh
49 50
spack compiler find
spack compilers
51

52 53 54 55 56 57 58 59
# use our own packages.yaml for bebop-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
# clean out any stray packages from previous runs, just in case
60
spack uninstall -R -y argobots mercury opa-psm2 bake || true
61

62
# nightly tests should test nightly software!
63
# spack install ior@develop+mobject ^margo@develop ^mercury@develop ^mobject@develop ^bake@develop ^remi@develop ^thallium@develop ^sdskeyval@develop ^ssg@develop
64

65 66
# ior acts as our "apex" package here, causing several other packages to build
spack install ior@develop +mobject 
67 68 69
# 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
70 71
# load ssg and bake because they are needed by things compiled outside of
# spack later in this script
72
spack load -r ssg
73
spack load -r bake
74

75 76
# sds-tests
echo "=== BUILDING SDS TEST PROGRAMS ==="
77 78 79
# TODO: why is this needed?  For some reason when we link software
#       outside of spack we are not picking up the path from the psm2 package
LIB_PATH_HACK=$(get_psm2_lib_path)
80
cd $SANDBOX/sds-tests
81 82 83
./prepare.sh
mkdir build
cd build
84 85
echo ../configure --prefix=$PREFIX CC=mpicc LDFLAGS="-L$LIB_PATH_HACK"
../configure --prefix=$PREFIX CC=mpicc LDFLAGS="-L$LIB_PATH_HACK"
86
make -j 3
87
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
Philip Carns's avatar
Philip Carns committed
93
cp $PREFIX/bin/bake-p2p-bw $JOBDIR
94
cp $PREFIX/bin/pmdk-bw $JOBDIR
95
cd $JOBDIR
96

97
export SANDBOX
98 99 100 101
sbatch --wait --export=ALL ./margo-regression.sbatch || true
sbatch --wait --export=ALL ./bake-regression.sbatch || true
sbatch --wait --export=ALL ./pmdk-regression.sbatch || true
sbatch --wait --export=ALL ./mobject-regression.sbatch || true
102 103 104 105

echo "=== JOB DONE, COLLECTING AND SENDING RESULTS ==="
# gather output, strip out funny characters, mail
cat *.out > combined.$JOBID.txt
Philip Carns's avatar
Philip Carns committed
106
# dos2unix combined.$JOBID.txt
107
mailx -s "mochi-regression (bebop)" sds-commits@lists.mcs.anl.gov < combined.$JOBID.txt
108 109 110 111

cd /tmp
rm -rf $SANDBOX
rm -rf $PREFIX