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

Annotation of /MITgcm_contrib/test_scripts/engaging/test_engag_op64_adm

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


Revision 1.16 - (hide annotations) (download)
Thu Jun 27 22:26:36 2019 UTC (6 years ago) by jmc
Branch: MAIN
Changes since 1.15: +1 -2 lines
remove list of excluded nodes

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

  ViewVC Help
Powered by ViewVC 1.1.22