| 1 |
#!/bin/bash -x |
#!/bin/bash |
| 2 |
# new script for running testreport on sx8.awi.de |
# new script for running testreport on sx8.awi.de |
| 3 |
# - split the testreport into 3 steps: |
# - split the testreport into 3 steps: |
| 4 |
# 1/ compiling on head node (tx7.awi.de), with -norun option |
# 1/ compiling on head node (tx7.awi.de), with -norun option |
| 15 |
# if not, testreport will try to run the sx8-code on the tx7 frontend |
# if not, testreport will try to run the sx8-code on the tx7 frontend |
| 16 |
# which will fail inevitably and produce more errors, maybe we can |
# which will fail inevitably and produce more errors, maybe we can |
| 17 |
# have a flag that skips everything but the evaluation step to avoid this |
# have a flag that skips everything but the evaluation step to avoid this |
| 18 |
|
# $Header$ |
| 19 |
|
# $Name$ |
| 20 |
|
|
| 21 |
|
# for some reason the module command is not available in a bash script on |
| 22 |
|
# this computer so we have to create it here |
| 23 |
|
module () { eval `/usr/bin/modulecmd bash $*` ; } |
| 24 |
|
module use --append /sx8/user2/awisoft/modulefiles |
| 25 |
# load latest compiler: |
# load latest compiler: |
| 26 |
module load sxf90/460 |
module load sxf90/460 |
| 27 |
|
module load netcdf |
| 28 |
|
# |
| 29 |
VENDOR=sxf90 |
VENDOR=sxf90 |
| 30 |
RUNIT="runit_"$VENDOR |
RUNIT="runit_"$VENDOR |
| 31 |
HERE=`pwd` |
HERE=`pwd` |
| 78 |
fi |
fi |
| 79 |
mkdir $TDIR |
mkdir $TDIR |
| 80 |
cd $TDIR |
cd $TDIR |
| 81 |
# cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm_verif_basic >& cvs_co.log |
# cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm_verif_basic > cvs_co.log 2>&1 |
| 82 |
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm >& cvs_co.log |
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm > cvs_co.log 2>&1 |
| 83 |
if [ $status > 0 ]; then |
if [ "$?" != "0" ]; then |
| 84 |
|
cat cvs_co.log |
| 85 |
|
fi |
| 86 |
|
else |
| 87 |
|
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q update >> cvs_co.log 2>&1 |
| 88 |
|
if [ "$?" != "0" ]; then |
| 89 |
cat cvs_co.log |
cat cvs_co.log |
| 90 |
fi |
fi |
| 91 |
fi |
fi |
| 97 |
# make sure that do use the cross compiler for testreport |
# make sure that do use the cross compiler for testreport |
| 98 |
#export CC=sxcc |
#export CC=sxcc |
| 99 |
|
|
| 100 |
$RUNTESTREPORT -j 8 -norun >> $MYOUTPUT 2>&1 |
$RUNTESTREPORT -j 8 -norun > $MYOUTPUT 2>&1 |
| 101 |
|
|
| 102 |
if [ $status > 0 ]; then |
if [ "$?" != "0" ] |
| 103 |
echo "something wrong with testreport" |
then |
| 104 |
echo "keeping the working directory" |
echo "something wrong with testreport" |
| 105 |
|
echo "keeping the working directory" |
| 106 |
#else |
#else |
| 107 |
# echo "check restarts" |
# echo "check restarts" |
| 108 |
# echo ../tools/do_tst_2+2 -mpi -exe \"$HERE/$RUNIT\" -a NONE |
# echo ../tools/do_tst_2+2 -mpi -exe \"$HERE/$RUNIT\" -a NONE |
| 111 |
# rm -rf $TDIR |
# rm -rf $TDIR |
| 112 |
fi |
fi |
| 113 |
|
|
| 114 |
echo "job script looks like this:" > $MYOUTPUT |
if [ ! -e $MYOUTPUT ] |
| 115 |
|
then |
| 116 |
|
touch $MYOUTPUT |
| 117 |
|
fi |
| 118 |
|
|
| 119 |
|
echo " " >> $MYOUTPUT |
| 120 |
|
echo "***********************************************************" >> $MYOUTPUT |
| 121 |
|
echo "Submitting this job script:" >> $MYOUTPUT |
| 122 |
|
echo "***********************************************************" >> $MYOUTPUT |
| 123 |
cat $HERE/$JOBSCRIPT >> $MYOUTPUT |
cat $HERE/$JOBSCRIPT >> $MYOUTPUT |
| 124 |
|
echo "***********************************************************" >> $MYOUTPUT |
| 125 |
echo "end of job script" >> $MYOUTPUT |
echo "end of job script" >> $MYOUTPUT |
| 126 |
|
echo "***********************************************************" >> $MYOUTPUT |
| 127 |
echo " " >> $MYOUTPUT |
echo " " >> $MYOUTPUT |
| 128 |
|
|
| 129 |
# now submit the job that actually runs all the experiments in one go |
# now submit the job that actually runs all the experiments in one go |
| 132 |
jobruns=`qstat -n -u mlosch | grep "$JOBNAME"` |
jobruns=`qstat -n -u mlosch | grep "$JOBNAME"` |
| 133 |
while [ "${jobruns}"x != x ] |
while [ "${jobruns}"x != x ] |
| 134 |
do |
do |
| 135 |
sleep 20 |
sleep 200 |
| 136 |
jobruns=`qstat -n -u mlosch | grep "$JOBNAME"` |
jobruns=`qstat -n -u mlosch | grep "$JOBNAME"` |
| 137 |
|
echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete" |
| 138 |
|
currentexp=`grep Experiment $MYOUTPUT | tail -1` |
| 139 |
|
echo "currently running $currentexp" |
| 140 |
done |
done |
| 141 |
|
|
| 142 |
# after running the experiments on the compute node run testreport |
# after running the experiments on the compute node run testreport |
| 143 |
# for a third time to evaluate results on the head node again |
# for a third time to evaluate results on the head node again |
| 144 |
#$RUNTESTREPORT -match 10 -runonly |
echo " " >> $MYOUTPUT |
| 145 |
|
echo "now run testreport for a final time to evaluate results:" >> $MYOUTPUT |
| 146 |
|
echo "$RUNTESTREPORT -match 10 -runonly" >> $MYOUTPUT |
| 147 |
|
#$RUNTESTREPORT -match 10 -runonly >> $MYOUTPUT 2>&1 |
| 148 |
$RUNTESTREPORT -match 10 -runonly \ |
$RUNTESTREPORT -match 10 -runonly \ |
| 149 |
-a "jmc@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1 |
-a "jmc@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1 |
| 150 |
|
|