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

Annotation of /MITgcm_contrib/test_scripts/engaging/test_engag_gfo_adm

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


Revision 1.3 - (hide annotations) (download)
Sat Dec 7 16:23:15 2019 UTC (5 years, 7 months ago) by jmc
Branch: MAIN
Changes since 1.2: +1 -2 lines
remove additional experiment "global_oce_biogeo_bling" (now part of the
 main set of experiment in verification)

1 jmc 1.1 #!/bin/bash
2     #SBATCH -J gfoAdm_tst
3     #SBATCH -p sched_mit_hill
4     #SBATCH --mem-per-cpu 4000
5 jmc 1.2 #SBATCH -N 2
6     # #SBATCH --exclusive
7 jmc 1.1 #SBATCH --tasks-per-node 16
8     #SBATCH -e /home/jm_c/test_engaging/output/gfoAdm_tst.stderr
9     #SBATCH -o /home/jm_c/test_engaging/output/gfoAdm_tst.stdout
10 jmc 1.2 #SBATCH --no-requeue --constraint=centos6
11 jmc 1.1
12 jmc 1.3 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_gfo_adm,v 1.2 2019/10/25 17:40:09 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     # Note: added "ulimit -s unlimited" in file "~/.bashrc"
19     # 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     tmpFil="/tmp/"`basename $0`".$$"
32     cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
33     #- which GitHub repository to use and how to access it:
34     git_repo='MITgcm'; git_code='MITgcm' ; git_other='verification_other'
35     #git_repo='altMITgcm'; #git_code='MITgcm66h'
36     #--
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    
41     typ='' ; addExp='' ; skipExp=''
42     sfx='gfoAdm'; typ='-adm'
43     addExp="$addExp global_oce_cs32 global_oce_llc90"
44     module add slurm
45     module add gcc
46     module add mvapich2/gcc/64/2.0b
47     #module add openmpi/gcc
48     export MPI_INC_DIR="$MPI_HOME/include"
49     #- for NetCDF:
50     module add harvard/centos6/hdf5-1.8.11_gcc-4.4.7
51     module add harvard/centos6/netcdf-4.3.0_gcc-4.4.7
52     OPTFILE="../tools/build_options/linux_amd64_gfortran"
53 jmc 1.2 options="$typ -MPI 32"
54 jmc 1.1 ulimit -s unlimited
55     #- need this to get "staf":
56     export PATH="$PATH:$HOME/bin"
57    
58     gcmDIR="MITgcm_$sfx"
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     checkOut=1 ; #options="$options -do"
64     #options="$options -nc" ; checkOut=1
65     #options="$options -q" ; checkOut=0
66    
67     if test -d $TST_DIR ; then
68     echo "start from TST_DIR='$TST_DIR' at: "`date`
69     else
70     #if test ! -d $TST_DIR ; then mkdir $TST_DIR ; fi
71     #if test ! -d $TST_DIR ; then
72     # echo "ERROR: Can't create directory \"$TST_DIR\""
73     # exit 1
74     #fi
75     #echo "start in new dir TST_DIR='$TST_DIR' at: "`date`
76     echo "ERROR: missing directory \"$TST_DIR\""
77     exit 1
78     fi
79     cd $TST_DIR
80     pwd
81    
82     NSLOTS=$SLURM_NTASKS
83     THEDATE=`date`
84     echo '********************************************************************************'
85     echo 'Start job '$THEDATE
86     echo 'NSLOTS = '$NSLOTS
87     echo '======= NODELIST ==============================================================='
88     echo $SLURM_NODELIST
89     cat /etc/redhat-release
90     echo '======= env ===================================================================='
91     env | grep SLURM
92     echo '======= modules ================================================================'
93     module list 2>&1
94     echo '================================================================================'
95    
96     #- keep a copy of MPI_MFILE:
97     #cp -p $PBS_NODEFILE $OUTP"/mf_"$sfx
98    
99     #- check for disk space: relative space (99%) or absolute (10.G):
100     dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
101     if [ $dsp -gt 99 ] ; then
102     #dsp=`df -P . | tail -1 | awk '{print $4}'`
103     #if [ $dsp -le 100000000 ] ; then
104     echo 'Not enough space on this disk => do not run testreport.'
105     df .
106     exit
107     fi
108     if [ $checkOut -eq 1 ] ; then
109     if test ! -e $gcmDIR/.git/config ; then
110     echo "no file: $gcmDIR/.git/config => try to download a fresh clone"
111     checkOut=2
112     fi
113     if test "x$addExp" != x ; then
114     if test ! -e $gcmDIR/$git_other/.git/config ; then
115     echo "no file: $gcmDIR/$git_other/.git/config => try a fresh clone"
116     checkOut=2
117     fi
118     fi
119     fi
120     if [ $checkOut -eq 1 ] ; then
121     echo "cleaning output from $gcmDIR/verification :"
122     #- remove previous output tar files and tar & remove previous output-dir
123     /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
124     ( cd $gcmDIR/verification
125     listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
126     for dd in $listD
127     do
128     if test -d $dd ; then
129     tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
130     retVal=$?
131     if test "x$retVal" != x0 ; then
132     echo "ERROR in tar+gzip prev outp-dir: $dd"
133     echo " on '"`hostname`"' (return val=$retVal) but continue"
134     fi
135     fi
136     done )
137     echo "clean testreport output"
138     # echo "clean tst_2+2 + testreport output (+ Makefile_syntax files)"
139     # ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
140     ( cd $gcmDIR/verification ; ./testreport $typ -clean )
141     if test "x$addExp" != x ; then
142     ( cd $gcmDIR/verification
143     listD=`ls -o | grep '^l' | awk '{print $8}' 2> /dev/null`
144     echo " + remove local links: $listD"
145     /bin/rm -f $listD
146     )
147     fi
148     echo "Update $git_code code in dir $gcmDIR :"
149     ( cd $gcmDIR ; git pull ) 2>&1
150     retVal=$?
151     if test "x$retVal" != x0 ; then
152     echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit"
153     exit
154     fi
155     echo " and checkout master:"
156     ( cd $gcmDIR ; git checkout master -- . ) 2>&1
157     if test "x$addExp" != x ; then
158     echo "Update $git_other code in dir $gcmDIR/$git_other :"
159     ( cd $gcmDIR/$git_other ; git pull ) 2>&1
160     retVal=$?
161     if test "x$retVal" != x0 ; then
162     echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit"
163     exit
164     fi
165     echo " and checkout master:"
166     ( cd $gcmDIR/$git_other ; git checkout master -- . ) 2>&1
167     fi
168     fi
169    
170     if [ $checkOut -eq 2 ] ; then
171     if test -e $gcmDIR ; then
172     echo -n "Removing working copy: $gcmDIR ..."
173     rm -rf $gcmDIR
174     echo " done"
175     fi
176     echo "Make a clone of $git_code from repo: $git_repo ..."
177     git clone $git_repo/${git_code}.git $gcmDIR 2> $tmpFil
178     retVal=$?
179     if test $retVal = 0 ; then
180     echo ' done' ; rm -f $tmpFil
181     else
182     echo " Error: 'git clone' returned: $retVal"
183     cat $tmpFil ; rm -f $tmpFil
184     exit
185     fi
186     if test "x$addExp" != x ; then
187     echo "Make a clone of $git_other from repo: $git_repo ..."
188     ( cd $gcmDIR ; git clone $git_repo/${git_other}.git 2> $tmpFil )
189     retVal=$?
190     if test $retVal = 0 ; then
191     echo ' done' ; rm -f $tmpFil
192     else
193     echo " Error: 'git clone' returned: $retVal"
194     cat $tmpFil ; rm -f $tmpFil
195     exit
196     fi
197     fi
198     if test -d $gcmDIR/verification ; then
199     /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
200     /usr/bin/find $gcmDIR -type f | xargs chmod g+r
201     fi
202     fi
203    
204     #- change dir to $gcmDIR/verification + add link for additional experiments:
205     if test -e $gcmDIR/verification ; then
206     if [ $checkOut -lt 2 ] ; then
207     echo " dir $gcmDIR/verification exist" ; fi
208     cd $gcmDIR/verification
209     for exp2add in $addExp ; do
210     test -r $exp2add && /bin/rm -rf $exp2add
211     if test -d ../$git_other/$exp2add ; then
212     echo " add $exp2add link from $git_other"
213     ln -s ../$git_other/$exp2add .
214     if test $exp2add = 'global_oce_cs32' ; then
215     echo " link dir 'other_input/core2_cnyf' in here"
216     ( cd ../${git_other}/${exp2add}
217     test -L core2_cnyf && /bin/rm -f core2_cnyf
218     ln -s ../../../other_input/core2_cnyf . )
219     fi
220     if test $exp2add = 'global_oce_llc90' ; then
221     echo " link dir 'other_input/gael_oce_llc90_input' to 'input_fields'"
222     ( cd ../${git_other}/${exp2add}
223     test -L input_fields && /bin/rm -f input_fields
224     ln -s ../../../other_input/gael_oce_llc90_input input_fields
225     echo " link dirs: 'core2_cnyf' & 'global_oce_input_fields/*' in input_verifs"
226     test ! -e input_verifs && mkdir input_verifs
227     ( cd input_verifs ; /bin/rm -f *
228     ln -s ../../../../other_input/core2_cnyf .
229     ln -s ../../../../other_input/global_oce_input_fields/* . )
230     )
231     fi
232     else
233     echo " missing dir: $git_other/$exp2add"
234     continue
235     fi
236     done
237     else
238     echo "no dir: $gcmDIR/verification => exit"
239     exit
240     fi
241    
242     echo ''
243     echo ./testreport $options -of $OPTFILE \
244     -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
245     ./testreport $options -of $OPTFILE \
246     -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
247    
248     # echo ''
249     # echo ../tools/do_tst_2+2 -mpi \
250     # -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
251     # ../tools/do_tst_2+2 -mpi \
252     # -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
253    

  ViewVC Help
Powered by ViewVC 1.1.22