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

Diff of /MITgcm_contrib/test_scripts/sx8/mitgcmtestreport_split

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

revision 1.1 by mlosch, Thu Feb 26 17:50:43 2015 UTC revision 1.6 by mlosch, Mon Mar 2 14:21:31 2015 UTC
# Line 1  Line 1 
1  #!/bin/bash -x  #!/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$
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:  # load latest compiler:
26  module load sxf90/460  module load sxf90/460
27    module load netcdf
28    #
29  VENDOR=sxf90  VENDOR=sxf90
30  RUNIT="runit_"$VENDOR  RUNIT="runit_"$VENDOR
31  HERE=`pwd`  HERE=`pwd`
# Line 55  if [ 0 = 0 ]; then Line 78  if [ 0 = 0 ]; then
78      fi      fi
79      mkdir $TDIR      mkdir $TDIR
80      cd $TDIR      cd $TDIR
81  #   cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm_verif_basic >& cvs_co.log  #   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      cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm > cvs_co.log 2>&1
83      if [ $status > 0 ]; then      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          cat cvs_co.log
90      fi      fi
91  fi  fi
# Line 69  unset CC Line 97  unset CC
97  # make sure that do use the cross compiler for testreport  # make sure that do use the cross compiler for testreport
98  #export CC=sxcc  #export CC=sxcc
99    
100  $RUNTESTREPORT  -j 8 -norun >> $MYOUTPUT 2>&1  $RUNTESTREPORT  -j 8 -norun > $MYOUTPUT 2>&1
101    
102  if [ $status > 0 ]; then  if [ "$?" != "0" ]
103    echo "something wrong with testreport"      then
104    echo "keeping the working directory"      echo "something wrong with testreport"
105        echo "keeping the working directory"
106  #else  #else
107  #  echo "check restarts"  #  echo "check restarts"
108  #  echo ../tools/do_tst_2+2 -mpi -exe \"$HERE/$RUNIT\" -a NONE  #  echo ../tools/do_tst_2+2 -mpi -exe \"$HERE/$RUNIT\" -a NONE
# Line 82  if [ $status > 0 ]; then Line 111  if [ $status > 0 ]; then
111  #  rm -rf $TDIR  #  rm -rf $TDIR
112  fi  fi
113    
114  echo "job script looks like this:" > $MYOUTPUT  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  cat $HERE/$JOBSCRIPT >> $MYOUTPUT
124    echo "***********************************************************" >> $MYOUTPUT
125  echo "end of job script" >> $MYOUTPUT  echo "end of job script" >> $MYOUTPUT
126    echo "***********************************************************" >> $MYOUTPUT
127  echo " " >> $MYOUTPUT  echo " " >> $MYOUTPUT
128    
129  # now submit the job that actually runs all the experiments in one go  # now submit the job that actually runs all the experiments in one go
# Line 93  qsub $HERE/$JOBSCRIPT Line 132  qsub $HERE/$JOBSCRIPT
132  jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`  jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`
133  while [ "${jobruns}"x != x ]  while [ "${jobruns}"x != x ]
134  do  do
135    sleep 20    sleep 200
136    jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`    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  done
141    
142  # after running the experiments on the compute node run testreport  # after running the experiments on the compute node run testreport
143  # for a third time to evaluate results on the head node again  # for a third time to evaluate results on the head node again
144  #$RUNTESTREPORT -match 10 -runonly  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 \  $RUNTESTREPORT -match 10 -runonly \
149      -a "jmc@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1      -a "jmc@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1
150    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22