/[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.11 - (hide annotations) (download)
Wed Feb 7 19:39:18 2018 UTC (7 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.10: +48 -36 lines
change to use new code repository on GitHub

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

  ViewVC Help
Powered by ViewVC 1.1.22