/[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.7 - (show annotations) (download)
Thu Jun 2 12:51:57 2016 UTC (9 years, 1 month ago) by mlosch
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
- add scripts to run testreport on ollie
- remove directories that belong to machines that are long gone

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

  ViewVC Help
Powered by ViewVC 1.1.22