/[MITgcm]/MITgcm_contrib/test_scripts/sxace/mitgcmtestreport
ViewVC logotype

Annotation of /MITgcm_contrib/test_scripts/sxace/mitgcmtestreport

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


Revision 1.1 - (hide annotations) (download)
Wed Apr 8 14:28:53 2015 UTC (10 years, 3 months ago) by mlosch
Branch: MAIN
script for running testreport on sx-ace stan1.awi.de

1 mlosch 1.1 #!/bin/bash
2     # new script for running testreport on stan1.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 sx ace-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     # alternatively we can source this script that contains all relevant
25     # definitions
26     source /usr/share/Modules/init/bash
27     #module use --append /sx8/user2/awisoft/modulefiles
28     # load latest compilers:
29     #module load sxf90/460
30     #module load sxc++/094
31     module load sxf90
32     module load sxc++
33     module load sxmpi
34     module load sxnetcdf
35     #
36     # make sure that we have qsub and qstat
37     #export PATH=${PATH}:/usr/bin/nqsII
38     source /etc/profile.d/nec.sh
39     #
40     VENDOR=sxf90
41     RUNIT="runit_"$VENDOR
42     HERE=`pwd`
43     EXE='mpirun -np TR_NPROC ./mitgcmuv'
44     NPROCS=2
45     MPI="-MPI $NPROCS"
46     OUTFILE=$HOME/out_${VENDOR}
47     MYOUTPUT=$HOME/testreport_${VENDOR}
48     OUTFILE=out_${VENDOR}
49     JOBNAME=test_ace
50     JOBSCRIPT=job_${VENDOR}
51     selectexperiment='-t exp2'
52     selectexperiment=''
53     # download code into this directory
54     TDIR=/ace/scr/mlosch/tmp_$VENDOR
55    
56     OPTFILE=../tools/build_options/SUPER-UX_SX-ACE_sxf90_awi
57     OPTFILE=/home/ace/mlosch/MITgcm/tools/build_options/SUPER-UX_SX-ACE_sxf90_awi
58    
59     RUNTESTREPORT="./testreport $MPI -of=${OPTFILE} $selectexperiment -small_f"
60     #
61     # create batch script
62     #
63     cat << EOF > $HERE/$JOBSCRIPT
64     ###PBS -q ace-test # job queue not neccesary so far
65     #PBS -N $JOBNAME # give the job a name
66     #PBS -l cpunum_job=$NPROCS # cpus per node
67     #PBS -l cputim_job=2:00:00 # time limit
68     #PBS -l memsz_job=32gb # max accumulated memory, we need this much because of many netcdf files
69     #PBS -j o # join i/o
70     #PBS -S /bin/sh
71     #PBS -o $OUTFILE # o Where to write output
72     #
73    
74     cd \${PBS_O_WORKDIR}
75     $RUNTESTREPORT -runonly -command "$EXE" >> $MYOUTPUT 2>&1
76    
77     EOF
78    
79     # clean up old testreport output
80     if [ -e $MYOUTPUT ]; then
81     rm -rf $MYOUTPUT
82     fi
83     if [ -e $OUTFILE ]; then
84     rm -r $OUTFILE
85     fi
86     if [ -e $TDIR/MITgcm ]; then
87     # if availabe just update
88     cd $TDIR/MITgcm
89     cvs -q update -d -P >> cvs_co.log 2>&1
90     if [ "$?" != "0" ]; then
91     cat cvs_co.log
92     fi
93     else
94     # create directory and download code
95     if [ -e $TDIR ]; then
96     rm -rf $TDIR
97     fi
98     mkdir $TDIR
99     cd $TDIR
100     cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm > cvs_co.log 2>&1
101     if [ "$?" != "0" ]; then
102     cat cvs_co.log
103     fi
104     fi
105    
106     cd $TDIR/MITgcm/verification
107    
108     # make sure that we do not use the cross compiler for testreport
109     unset CC
110     # make sure that do use the cross compiler for testreport
111     #export CC=sxcc
112    
113     $RUNTESTREPORT -j 8 -norun > $MYOUTPUT 2>&1
114    
115     if [ "$?" != "0" ]
116     then
117     echo "something wrong with testreport"
118     echo "keeping the working directory"
119     #else
120     # echo "check restarts"
121     # echo ../tools/do_tst_2+2 -mpi -exe \"$HERE/$RUNIT\" -a NONE
122     # ../tools/do_tst_2+2 -mpi -exe $HERE/$RUNIT -a NONE
123     # everything OK: delete working directory
124     # rm -rf $TDIR
125     fi
126    
127     if [ ! -e $MYOUTPUT ]
128     then
129     touch $MYOUTPUT
130     fi
131    
132     echo " " >> $MYOUTPUT
133     echo "***********************************************************" >> $MYOUTPUT
134     echo "Submitting this job script:" >> $MYOUTPUT
135     echo "***********************************************************" >> $MYOUTPUT
136     cat $HERE/$JOBSCRIPT >> $MYOUTPUT
137     echo "***********************************************************" >> $MYOUTPUT
138     echo "end of job script" >> $MYOUTPUT
139     echo "***********************************************************" >> $MYOUTPUT
140     echo " " >> $MYOUTPUT
141    
142     # now submit the job that actually runs all the experiments in one go
143     qsub $HERE/$JOBSCRIPT
144     # keep looking for the job in the job queues and wait until has disappeared
145     jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`
146     while [ "${jobruns}"x != x ]
147     do
148     sleep 200
149     jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`
150     echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete"
151     currentexp=`grep Experiment $MYOUTPUT | tail -1`
152     echo "currently running $currentexp"
153     done
154    
155     # after running the experiments on the compute node run testreport
156     # for a third time to evaluate results on the head node again
157     echo " " >> $MYOUTPUT
158     echo "now run testreport for a final time to evaluate results:" >> $MYOUTPUT
159     echo "$RUNTESTREPORT -match 10 -runonly" >> $MYOUTPUT
160     #$RUNTESTREPORT -match 10 -runonly >> $MYOUTPUT 2>&1
161     $RUNTESTREPORT -match 10 -runonly \
162     -a "jmc@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1
163    
164     echo "end of mitgcmtestreport"

  ViewVC Help
Powered by ViewVC 1.1.22