/[MITgcm]/MITgcm_contrib/test_scripts/sx8/mitgcmtestreport_split
ViewVC logotype

Contents of /MITgcm_contrib/test_scripts/sx8/mitgcmtestreport_split

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu Feb 26 17:50:43 2015 UTC (11 years, 6 months ago) by mlosch
Branch: MAIN
add new script for running testreport on sx8.awi.de
- split the testreport into 3 steps:
1/ compiling on head node (tx7.awi.de), with -norun option
2/ running on compute node (using PBS qsub), with -runonly option
3/ evaluating result on head node with -runonly option

Notes:
- step 2 leads to many error messages, because the OS on the compute
  nodes does not have the appropriate shell tools, modifying the
  -runonly option to skip the evalution step would be nice but not
  necessary; you'll just have to live with the error messages
- step 3 assumes that all experiments have been run successfully, i.e.
  that the output files are up-to-date.
  if not, testreport will try to run the sx8-code on the tx7 frontend
  which will fail inevitably and produce more errors, maybe we can
  have a flag that skips everything but the evaluation step to avoid this

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"

  ViewVC Help
Powered by ViewVC 1.1.22