1 |
mlosch |
1.1 |
#!/bin/bash -x |
2 |
mlosch |
1.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 |
mlosch |
1.1 |
|
19 |
|
|
# load latest compiler: |
20 |
|
|
module load sxf90/460 |
21 |
|
|
|
22 |
|
|
VENDOR=sxf90 |
23 |
|
|
RUNIT="runit_"$VENDOR |
24 |
|
|
HERE=`pwd` |
25 |
|
|
EXE='mpirun -np TR_NPROC ./mitgcmuv' |
26 |
|
|
NPROCS=2 |
27 |
|
|
MPI="-MPI $NPROCS" |
28 |
|
|
OUTFILE=/home/sx8/mlosch/out_${VENDOR} |
29 |
|
|
MYOUTPUT=/home/sx8/mlosch/testreport_${VENDOR} |
30 |
|
|
OUTFILE=out_${VENDOR} |
31 |
|
|
JOBNAME=testsx8 |
32 |
|
|
JOBSCRIPT=job_${VENDOR} |
33 |
|
|
#selectexperiment='-t exp2' |
34 |
|
|
selectexperiment='' |
35 |
|
|
# download code into this directory |
36 |
|
|
TDIR=/sx8/scr/mlosch/tmp_$VENDOR |
37 |
|
|
|
38 |
|
|
OPTFILE=../tools/build_options/SUPER-UX_SX-8_sxf90_awi |
39 |
|
|
|
40 |
|
|
RUNTESTREPORT="./testreport $MPI -of=${OPTFILE} $selectexperiment" |
41 |
|
|
# |
42 |
|
|
# create batch script |
43 |
|
|
# |
44 |
|
|
cat << EOF > $HERE/$JOBSCRIPT |
45 |
|
|
#PBS -q sx8-r # job queue not neccesary so far |
46 |
|
|
#PBS -N $JOBNAME # give the job a name |
47 |
|
|
#PBS -l cpunum_job=$NPROCS # cpus per node |
48 |
|
|
#PBS -l cputim_job=2:00:00 # time limit |
49 |
|
|
#PBS -l memsz_job=32gb # max accumulated memory, we need this much because of many netcdf files |
50 |
|
|
#PBS -j o # join i/o |
51 |
|
|
#PBS -S /bin/sh |
52 |
|
|
#PBS -o $OUTFILE # o Where to write output |
53 |
|
|
# |
54 |
|
|
|
55 |
|
|
cd \${PBS_O_WORKDIR} |
56 |
|
|
$RUNTESTREPORT -runonly -command "$EXE" >> $MYOUTPUT 2>&1 |
57 |
|
|
|
58 |
|
|
EOF |
59 |
|
|
|
60 |
|
|
# clean up old testreport output |
61 |
|
|
if [ -e $MYOUTPUT ]; then |
62 |
|
|
rm -rf $MYOUTPUT |
63 |
|
|
fi |
64 |
|
|
if [ -e $OUTFILE ]; then |
65 |
|
|
rm -r $OUTFILE |
66 |
|
|
fi |
67 |
|
|
if [ 0 = 0 ]; then |
68 |
|
|
# create directory and download code |
69 |
|
|
if [ -e $TDIR ]; then |
70 |
|
|
rm -rf $TDIR |
71 |
|
|
fi |
72 |
|
|
mkdir $TDIR |
73 |
|
|
cd $TDIR |
74 |
|
|
# cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm_verif_basic >& cvs_co.log |
75 |
|
|
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm >& cvs_co.log |
76 |
|
|
if [ $status > 0 ]; then |
77 |
|
|
cat cvs_co.log |
78 |
|
|
fi |
79 |
|
|
fi |
80 |
|
|
|
81 |
|
|
cd $TDIR/MITgcm/verification |
82 |
|
|
|
83 |
|
|
# make sure that we do not use the cross compiler for testreport |
84 |
|
|
unset CC |
85 |
|
|
# make sure that do use the cross compiler for testreport |
86 |
|
|
#export CC=sxcc |
87 |
|
|
|
88 |
|
|
$RUNTESTREPORT -j 8 -norun >> $MYOUTPUT 2>&1 |
89 |
|
|
|
90 |
|
|
if [ $status > 0 ]; then |
91 |
|
|
echo "something wrong with testreport" |
92 |
|
|
echo "keeping the working directory" |
93 |
|
|
#else |
94 |
|
|
# echo "check restarts" |
95 |
|
|
# echo ../tools/do_tst_2+2 -mpi -exe \"$HERE/$RUNIT\" -a NONE |
96 |
|
|
# ../tools/do_tst_2+2 -mpi -exe $HERE/$RUNIT -a NONE |
97 |
|
|
# everything OK: delete working directory |
98 |
|
|
# rm -rf $TDIR |
99 |
|
|
fi |
100 |
|
|
|
101 |
|
|
echo "job script looks like this:" > $MYOUTPUT |
102 |
|
|
cat $HERE/$JOBSCRIPT >> $MYOUTPUT |
103 |
|
|
echo "end of job script" >> $MYOUTPUT |
104 |
|
|
echo " " >> $MYOUTPUT |
105 |
|
|
|
106 |
|
|
# now submit the job that actually runs all the experiments in one go |
107 |
|
|
qsub $HERE/$JOBSCRIPT |
108 |
|
|
# keep looking for the job in the job queues and wait until has disappeared |
109 |
|
|
jobruns=`qstat -n -u mlosch | grep "$JOBNAME"` |
110 |
|
|
while [ "${jobruns}"x != x ] |
111 |
|
|
do |
112 |
|
|
sleep 20 |
113 |
|
|
jobruns=`qstat -n -u mlosch | grep "$JOBNAME"` |
114 |
|
|
done |
115 |
|
|
|
116 |
|
|
# after running the experiments on the compute node run testreport |
117 |
|
|
# for a third time to evaluate results on the head node again |
118 |
|
|
#$RUNTESTREPORT -match 10 -runonly |
119 |
|
|
$RUNTESTREPORT -match 10 -runonly \ |
120 |
|
|
-a "jmc@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1 |
121 |
|
|
|
122 |
|
|
echo "end of mitgcmtestreport_split" |