/[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.14 - (hide annotations) (download)
Wed Nov 7 23:14:37 2018 UTC (6 years, 8 months ago) by jmc
Branch: MAIN
Changes since 1.13: +4 -2 lines
safer way to checkout master branch

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

  ViewVC Help
Powered by ViewVC 1.1.22