| 1 |
#!/bin/bash -x |
#!/bin/bash |
| 2 |
|
# new script for running testreport on sx8.awi.de |
| 3 |
|
# - split the testreport into 3 steps: |
| 4 |
|
# 1/ compiling on head node (tx7.awi.de), with -norun option |
| 5 |
|
# 2/ running on compute node (using PBS qsub), with -runonly option |
| 6 |
|
# 3/ evaluating result on head node with -runonly option |
| 7 |
|
# |
| 8 |
|
# Notes: |
| 9 |
|
# - step 2 leads to many error messages, because the OS on the compute |
| 10 |
|
# nodes does not have the appropriate shell tools, modifying the |
| 11 |
|
# - runonly option to skip the evalution step would be nice but not |
| 12 |
|
# necessary; you'll just have to live with the error messages |
| 13 |
|
# - step 3 assumes that all experiments have been run successfully, i.e. |
| 14 |
|
# that the output files are up-to-date. |
| 15 |
|
# 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 |
| 17 |
|
# 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 |
# load latest compiler: |
# load latest compiler: |
| 25 |
module load sxf90/460 |
module load sxf90/460 |
| 26 |
|
|
| 76 |
fi |
fi |
| 77 |
mkdir $TDIR |
mkdir $TDIR |
| 78 |
cd $TDIR |
cd $TDIR |
| 79 |
# 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 |
| 80 |
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 |
| 81 |
|
if [ $status > 0 ]; then |
| 82 |
|
cat cvs_co.log |
| 83 |
|
fi |
| 84 |
|
else |
| 85 |
|
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q update >> cvs_co.log 2>&1 |
| 86 |
if [ $status > 0 ]; then |
if [ $status > 0 ]; then |
| 87 |
cat cvs_co.log |
cat cvs_co.log |
| 88 |
fi |
fi |
| 95 |
# make sure that do use the cross compiler for testreport |
# make sure that do use the cross compiler for testreport |
| 96 |
#export CC=sxcc |
#export CC=sxcc |
| 97 |
|
|
| 98 |
$RUNTESTREPORT -j 8 -norun >> $MYOUTPUT 2>&1 |
$RUNTESTREPORT -j 8 -norun > $MYOUTPUT 2>&1 |
| 99 |
|
|
| 100 |
if [ $status > 0 ]; then |
if [ $status > 0 ] |
| 101 |
echo "something wrong with testreport" |
then |
| 102 |
echo "keeping the working directory" |
echo "something wrong with testreport" |
| 103 |
|
echo "keeping the working directory" |
| 104 |
#else |
#else |
| 105 |
# echo "check restarts" |
# echo "check restarts" |
| 106 |
# echo ../tools/do_tst_2+2 -mpi -exe \"$HERE/$RUNIT\" -a NONE |
# echo ../tools/do_tst_2+2 -mpi -exe \"$HERE/$RUNIT\" -a NONE |
| 109 |
# rm -rf $TDIR |
# rm -rf $TDIR |
| 110 |
fi |
fi |
| 111 |
|
|
| 112 |
echo "job script looks like this:" > $MYOUTPUT |
if [ ! -e $MYOUTPUT ] |
| 113 |
|
then |
| 114 |
|
touch $MYOUTPUT |
| 115 |
|
fi |
| 116 |
|
|
| 117 |
|
echo " " >> $MYOUTPUT |
| 118 |
|
echo "***********************************************************" >> $MYOUTPUT |
| 119 |
|
echo "Submitting this job script:" >> $MYOUTPUT |
| 120 |
|
echo "***********************************************************" >> $MYOUTPUT |
| 121 |
cat $HERE/$JOBSCRIPT >> $MYOUTPUT |
cat $HERE/$JOBSCRIPT >> $MYOUTPUT |
| 122 |
|
echo "***********************************************************" >> $MYOUTPUT |
| 123 |
echo "end of job script" >> $MYOUTPUT |
echo "end of job script" >> $MYOUTPUT |
| 124 |
|
echo "***********************************************************" >> $MYOUTPUT |
| 125 |
echo " " >> $MYOUTPUT |
echo " " >> $MYOUTPUT |
| 126 |
|
|
| 127 |
# 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 |
do |
do |
| 133 |
sleep 20 |
sleep 20 |
| 134 |
jobruns=`qstat -n -u mlosch | grep "$JOBNAME"` |
jobruns=`qstat -n -u mlosch | grep "$JOBNAME"` |
| 135 |
|
echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete" |
| 136 |
|
currentexp=`grep Experiment $MYOUTPUT | tail -1` |
| 137 |
|
echo "currently running $currentexp" |
| 138 |
done |
done |
| 139 |
|
|
| 140 |
# after running the experiments on the compute node run testreport |
# after running the experiments on the compute node run testreport |
| 141 |
# for a third time to evaluate results on the head node again |
# for a third time to evaluate results on the head node again |
| 142 |
#$RUNTESTREPORT -match 10 -runonly |
echo " " >> $MYOUTPUT |
| 143 |
|
echo "now run testreport for a final time to evaluate results:" >> $MYOUTPUT |
| 144 |
|
echo "$RUNTESTREPORT -match 10 -runonly" >> $MYOUTPUT |
| 145 |
|
#$RUNTESTREPORT -match 10 -runonly >> $MYOUTPUT 2>&1 |
| 146 |
$RUNTESTREPORT -match 10 -runonly \ |
$RUNTESTREPORT -match 10 -runonly \ |
| 147 |
-a "jmc@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1 |
-a "jmc@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1 |
| 148 |
|
|