/[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.20 - (hide annotations) (download)
Sun Apr 18 15:33:52 2021 UTC (4 years, 3 months ago) by jmc
Branch: MAIN
Changes since 1.19: +3 -1 lines
exclude 2 centos7 nodes that are wrongly assign (by Slurm) as centos6

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

  ViewVC Help
Powered by ViewVC 1.1.22