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