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.19 |
#SBATCH --no-requeue |
10 |
|
|
#SBATCH --constraint=centos6 |
11 |
jmc |
1.1 |
|
12 |
jmc |
1.19 |
# $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_op64_adm,v 1.18 2019/12/08 18:09:34 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.17 |
git_repo='MITgcm'; git_code='MITgcm' ; git_other='verification_other' |
35 |
jmc |
1.11 |
#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='o64Adm'; typ='-adm' |
43 |
|
|
module add open64 |
44 |
|
|
module add mvapich2/open64/64/2.0b |
45 |
|
|
export MPI_INC_DIR="$MPI_HOME/include" |
46 |
|
|
OPTFILE="../tools/build_options/linux_amd64_open64" |
47 |
|
|
#options="-j 2 -devel -gsl" |
48 |
|
|
options="$typ -MPI 6" |
49 |
jmc |
1.18 |
#- currently, no NetCDF => no pkg/profiles |
50 |
|
|
options="$options -skd global_oce_biogeo_bling" |
51 |
jmc |
1.1 |
#export OMP_NUM_THREADS=2 |
52 |
|
|
#export OMP_SLAVE_STACK_SIZE=400m |
53 |
|
|
#export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized |
54 |
|
|
ulimit -s unlimited |
55 |
|
|
#- need this to get "staf": |
56 |
|
|
export PATH="$PATH:$HOME/bin" |
57 |
|
|
|
58 |
jmc |
1.11 |
gcmDIR="MITgcm_$sfx" |
59 |
jmc |
1.1 |
dAlt=`date +%d` ; dAlt=`expr $dAlt % 3` |
60 |
|
|
if [ $dAlt -eq 1 ] ; then options="$options -fast" |
61 |
|
|
else options="$options -devel" ; fi |
62 |
|
|
|
63 |
jmc |
1.3 |
checkOut=1 ; #options="$options -do" |
64 |
jmc |
1.1 |
#options="$options -nc" ; checkOut=1 |
65 |
|
|
#options="$options -q" ; checkOut=0 |
66 |
|
|
|
67 |
jmc |
1.11 |
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 |
jmc |
1.1 |
NSLOTS=$SLURM_NTASKS |
83 |
jmc |
1.2 |
THEDATE=`date` |
84 |
jmc |
1.1 |
echo '********************************************************************************' |
85 |
|
|
echo 'Start job '$THEDATE |
86 |
|
|
echo 'NSLOTS = '$NSLOTS |
87 |
|
|
echo '======= NODELIST ===============================================================' |
88 |
|
|
echo $SLURM_NODELIST |
89 |
jmc |
1.4 |
cat /etc/redhat-release |
90 |
jmc |
1.1 |
echo '======= env ====================================================================' |
91 |
jmc |
1.2 |
env | grep SLURM |
92 |
|
|
echo '======= modules ================================================================' |
93 |
|
|
module list 2>&1 |
94 |
jmc |
1.1 |
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 |
jmc |
1.15 |
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 |
jmc |
1.1 |
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 |
jmc |
1.11 |
retVal=$? |
131 |
|
|
if test "x$retVal" != x0 ; then |
132 |
jmc |
1.1 |
echo "ERROR in tar+gzip prev outp-dir: $dd" |
133 |
jmc |
1.11 |
echo " on '"`hostname`"' (return val=$retVal) but continue" |
134 |
jmc |
1.1 |
fi |
135 |
|
|
fi |
136 |
|
|
done ) |
137 |
|
|
# ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
138 |
|
|
( cd $gcmDIR/verification ; ./testreport $typ -clean ) |
139 |
jmc |
1.15 |
if test "x$addExp" != x ; then |
140 |
|
|
( cd $gcmDIR/verification |
141 |
|
|
listD=`ls -o | grep '^l' | awk '{print $8}' 2> /dev/null` |
142 |
|
|
echo " + remove local links: $listD" |
143 |
|
|
/bin/rm -f $listD |
144 |
|
|
) |
145 |
|
|
fi |
146 |
jmc |
1.17 |
echo "Update $git_code code in dir $gcmDIR :" |
147 |
jmc |
1.14 |
( cd $gcmDIR ; git pull ) 2>&1 |
148 |
jmc |
1.11 |
retVal=$? |
149 |
|
|
if test "x$retVal" != x0 ; then |
150 |
|
|
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
151 |
jmc |
1.1 |
exit |
152 |
|
|
fi |
153 |
jmc |
1.14 |
echo " and checkout master:" |
154 |
|
|
( cd $gcmDIR ; git checkout master -- . ) 2>&1 |
155 |
jmc |
1.15 |
if test "x$addExp" != x ; then |
156 |
|
|
echo "Update $git_other code in dir $gcmDIR/$git_other :" |
157 |
|
|
( cd $gcmDIR/$git_other ; git pull ) 2>&1 |
158 |
|
|
retVal=$? |
159 |
|
|
if test "x$retVal" != x0 ; then |
160 |
|
|
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
161 |
|
|
exit |
162 |
|
|
fi |
163 |
|
|
echo " and checkout master:" |
164 |
|
|
( cd $gcmDIR/$git_other ; git checkout master -- . ) 2>&1 |
165 |
jmc |
1.1 |
fi |
166 |
|
|
fi |
167 |
jmc |
1.17 |
|
168 |
jmc |
1.1 |
if [ $checkOut -eq 2 ] ; then |
169 |
|
|
if test -e $gcmDIR ; then |
170 |
jmc |
1.3 |
echo -n "Removing working copy: $gcmDIR ..." |
171 |
|
|
rm -rf $gcmDIR |
172 |
|
|
echo " done" |
173 |
jmc |
1.1 |
fi |
174 |
jmc |
1.17 |
echo "Make a clone of $git_code from repo: $git_repo ..." |
175 |
jmc |
1.13 |
git clone $git_repo/${git_code}.git $gcmDIR 2> $tmpFil |
176 |
jmc |
1.11 |
retVal=$? |
177 |
|
|
if test $retVal = 0 ; then |
178 |
|
|
echo ' done' ; rm -f $tmpFil |
179 |
|
|
else |
180 |
|
|
echo " Error: 'git clone' returned: $retVal" |
181 |
|
|
cat $tmpFil ; rm -f $tmpFil |
182 |
jmc |
1.1 |
exit |
183 |
jmc |
1.11 |
fi |
184 |
jmc |
1.15 |
if test "x$addExp" != x ; then |
185 |
|
|
echo "Make a clone of $git_other from repo: $git_repo ..." |
186 |
|
|
( cd $gcmDIR ; git clone $git_repo/${git_other}.git 2> $tmpFil ) |
187 |
|
|
retVal=$? |
188 |
|
|
if test $retVal = 0 ; then |
189 |
|
|
echo ' done' ; rm -f $tmpFil |
190 |
|
|
else |
191 |
|
|
echo " Error: 'git clone' returned: $retVal" |
192 |
|
|
cat $tmpFil ; rm -f $tmpFil |
193 |
|
|
exit |
194 |
|
|
fi |
195 |
|
|
fi |
196 |
jmc |
1.1 |
if test -d $gcmDIR/verification ; then |
197 |
|
|
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
198 |
|
|
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
199 |
|
|
fi |
200 |
|
|
fi |
201 |
|
|
|
202 |
jmc |
1.17 |
#- change dir to $gcmDIR/verification + add link for additional experiments: |
203 |
jmc |
1.1 |
if test -e $gcmDIR/verification ; then |
204 |
|
|
if [ $checkOut -lt 2 ] ; then |
205 |
|
|
echo " dir $gcmDIR/verification exist" ; fi |
206 |
|
|
cd $gcmDIR/verification |
207 |
jmc |
1.7 |
for exp2add in $addExp ; do |
208 |
jmc |
1.15 |
test -r $exp2add && /bin/rm -rf $exp2add |
209 |
|
|
if test -d ../$git_other/$exp2add ; then |
210 |
|
|
echo " add $exp2add link from $git_other" |
211 |
|
|
ln -s ../$git_other/$exp2add . |
212 |
jmc |
1.7 |
else |
213 |
jmc |
1.15 |
echo " missing dir: $git_other/$exp2add" |
214 |
|
|
continue |
215 |
jmc |
1.7 |
fi |
216 |
|
|
done |
217 |
jmc |
1.1 |
else |
218 |
|
|
echo "no dir: $gcmDIR/verification => exit" |
219 |
|
|
exit |
220 |
|
|
fi |
221 |
|
|
|
222 |
jmc |
1.8 |
echo '' |
223 |
|
|
echo ./testreport $options -of $OPTFILE \ |
224 |
jmc |
1.10 |
-odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org |
225 |
jmc |
1.8 |
./testreport $options -of $OPTFILE \ |
226 |
jmc |
1.10 |
-odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org |
227 |
jmc |
1.8 |
|
228 |
|
|
# echo '' |
229 |
|
|
# echo ../tools/do_tst_2+2 -mpi \ |
230 |
jmc |
1.10 |
# -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org |
231 |
jmc |
1.8 |
# ../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.1 |
|