/[MITgcm]/MITgcm_contrib/test_scripts/engaging/test_engag_gfo_tlm
ViewVC logotype

Annotation of /MITgcm_contrib/test_scripts/engaging/test_engag_gfo_tlm

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


Revision 1.4 - (hide annotations) (download)
Wed Mar 9 15:26:50 2016 UTC (9 years, 4 months ago) by jmc
Branch: MAIN
Changes since 1.3: +2 -1 lines
print OS in job std output file

1 jmc 1.1 #!/bin/bash
2     #SBATCH -J tst_gfoTlm
3     #SBATCH -p sched_mit_hill
4     #SBATCH --mem-per-cpu 4000
5     #SBATCH -n 6
6     #SBATCH -N 2
7     #SBATCH -e /home/jm_c/test_engaging/output/tst_gfoTlm.stderr
8     #SBATCH -o /home/jm_c/test_engaging/output/tst_gfoTlm.stdout
9    
10 jmc 1.4 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_gfo_tlm,v 1.3 2015/11/07 18:35:41 jmc Exp $
11 jmc 1.1 # $Name: $
12    
13     if test -f /etc/profile.d/modules.sh ; then
14     . /etc/profile.d/modules.sh
15     fi
16 jmc 1.3 # Note: added "ulimit -s unlimited" in file "~/.bashrc"
17 jmc 1.1 # to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI
18    
19     umask 0022
20     #- to get case insensitive "ls" (and order of tested experiments)
21     export LC_ALL="en_US.UTF-8"
22     echo " running on: "`hostname`
23    
24     dNam='engaging'
25     HERE="$HOME/test_$dNam"
26     OUTP="$HERE/output"; SavD="$HERE/send"
27     SEND="ssh eofe4 $SavD/mpack"
28     TST_DIR="/pool001/jm_c/test_$dNam"
29    
30     if test -d $TST_DIR ; then
31     echo "start from TST_DIR='$TST_DIR' at: "`date`
32     else
33     #if test ! -d /scratch/jm_c ; then mkdir /scratch/jm_c ; fi
34     #if test ! -d $TST_DIR ; then mkdir $TST_DIR ; fi
35     #if test ! -d $TST_DIR ; then
36     # echo "ERROR: Can't create directory \"$TST_DIR\""
37     # exit 1
38     #fi
39     #echo "start in new dir TST_DIR='$TST_DIR' at: "`date`
40     echo "ERROR: missing directory \"$TST_DIR\""
41     exit 1
42     fi
43    
44     sfx='gfoTlm'; typ='-tlm'
45     addExp=''
46     module add gcc
47     #module add mvapich2/gcc/64/2.0b
48     module add openmpi/gcc
49     export MPI_INC_DIR="$MPI_HOME/include"
50 jmc 1.2 #- for NetCDF:
51     module add harvard/centos6/hdf5-1.8.11_gcc-4.4.7
52     module add harvard/centos6/netcdf-4.3.0_gcc-4.4.7
53 jmc 1.1 OPTFILE="../tools/build_options/linux_amd64_gfortran"
54     options="$typ -MPI 6"
55     ulimit -s unlimited
56     #- need this to get "staf":
57     export PATH="$PATH:$HOME/bin"
58    
59     dAlt=`date +%d` ; dAlt=`expr $dAlt % 3`
60     if [ $dAlt -eq 1 ] ; then options="$options -fast"
61     else options="$options -devel" ; fi
62    
63 jmc 1.3 checkOut=1 ; #options="$options -do"
64 jmc 1.1 #options="$options -nc" ; checkOut=1
65     #options="$options -q" ; checkOut=0
66    
67     NSLOTS=$SLURM_NTASKS
68 jmc 1.2 THEDATE=`date`
69 jmc 1.1 echo '********************************************************************************'
70     echo 'Start job '$THEDATE
71     echo 'NSLOTS = '$NSLOTS
72     echo '======= NODELIST ==============================================================='
73     echo $SLURM_NODELIST
74 jmc 1.4 cat /etc/redhat-release
75 jmc 1.1 echo '======= env ===================================================================='
76 jmc 1.2 env | grep SLURM
77     echo '======= modules ================================================================'
78     module list 2>&1
79 jmc 1.1 echo '================================================================================'
80    
81     #- keep a copy of MPI_MFILE:
82     #cp -p $PBS_NODEFILE $OUTP"/mf_"$sfx
83    
84 jmc 1.3 cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
85 jmc 1.1 gcmDIR="MITgcm_$sfx"
86     cd $TST_DIR
87     #- check for disk space: relative space (99%) or absolute (10.G):
88     dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
89     if [ $dsp -gt 99 ] ; then
90     #dsp=`df -P . | tail -1 | awk '{print $4}'`
91     #if [ $dsp -le 100000000 ] ; then
92     echo 'Not enough space on this disk => do not run testreport.'
93     df .
94     exit
95     fi
96     if [ $checkOut -eq 1 ] ; then
97     if test -d $gcmDIR/CVS ; then
98     echo "cleaning output from $gcmDIR/verification :"
99     #- remove previous output tar files and tar & remove previous output-dir
100     /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
101     ( cd $gcmDIR/verification
102     listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
103     for dd in $listD
104     do
105     if test -d $dd ; then
106     tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
107     RETVAL=$?
108     if test "x$RETVAL" != x0 ; then
109     echo "ERROR in tar+gzip prev outp-dir: $dd"
110     echo " on '"`hostname`"' (return val=$RETVAL) but continue"
111     fi
112     fi
113     done )
114     # ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
115     ( cd $gcmDIR/verification ; ./testreport $typ -clean )
116     echo "cvs update of dir $gcmDIR :"
117 jmc 1.3 ( cd $gcmDIR ; $cmdCVS update -P -d ) 2>&1
118 jmc 1.1 RETVAL=$?
119     if test "x$RETVAL" != x0 ; then
120     echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit"
121     exit
122     fi
123     else
124     echo "no dir: $gcmDIR/CVS => try a fresh check-out"
125     checkOut=2
126     fi
127     fi
128     if [ $checkOut -eq 2 ] ; then
129     if test -e $gcmDIR ; then
130 jmc 1.3 echo -n "Removing working copy: $gcmDIR ..."
131     rm -rf $gcmDIR
132     echo " done"
133 jmc 1.1 fi
134     # cvs co MITgcm
135 jmc 1.3 echo "Downloading using '$cmdCVS co -P -d $gcmDIR MITgcm' ..."
136     $cmdCVS co -P -d $gcmDIR MITgcm > /dev/null
137 jmc 1.1 RETVAL=$?
138     if test "x$RETVAL" != x0 ; then
139     echo "cvs co on '"`hostname`"' fail (return val=$RETVAL) => exit"
140     exit
141 jmc 1.3 else echo " done" ; fi
142 jmc 1.1 if test -d $gcmDIR/verification ; then
143     for exp2add in $addExp ; do
144     echo " add dir: $exp2add (from Contrib:verification_other)"
145 jmc 1.3 ( cd $gcmDIR/verification ; $cmdCVS co -P -d $exp2add \
146 jmc 1.1 MITgcm_contrib/verification_other/$exp2add > /dev/null )
147     done
148     /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
149     /usr/bin/find $gcmDIR -type f | xargs chmod g+r
150     fi
151     fi
152    
153     #- change dir to $gcmDIR/verification dir:
154     if test -e $gcmDIR/verification ; then
155     if [ $checkOut -lt 2 ] ; then
156     echo " dir $gcmDIR/verification exist" ; fi
157     cd $gcmDIR/verification
158     else
159     echo "no dir: $gcmDIR/verification => exit"
160     exit
161     fi
162    
163 jmc 1.2 echo ''
164 jmc 1.1 echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \
165     -send \"$SEND\" -sd $SavD -a jmc@mitgcm.org
166     ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \
167     -send "$SEND" -sd $SavD -a jmc@mitgcm.org
168    
169     #echo ''
170 jmc 1.3 #echo ../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \
171     # -send \"$SEND\" -sd $SavD -a jmc@mitgcm.org
172     #../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \
173     # -send "$SEND" -sd $SavD -a jmc@mitgcm.org
174 jmc 1.1

  ViewVC Help
Powered by ViewVC 1.1.22