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

Contents of /MITgcm_contrib/test_scripts/engaging/test_engag_ifc_mp2

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


Revision 1.30 - (show annotations) (download)
Sat Dec 30 16:55:12 2023 UTC (22 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.29: +6 -6 lines
print time few more times

1 #!/bin/bash
2 #SBATCH -J ifcMp2_tst
3 #SBATCH -p sched_mit_hill
4 #SBATCH -t 06:00:00
5 #SBATCH --mem-per-cpu 4000
6 #SBATCH -N 1
7 #SBATCH --tasks-per-node 10
8 # #SBATCH -x node[360,365]
9 #SBATCH -e /home/jm_c/test_engaging/output/ifcMp2_tst.stderr
10 #SBATCH -o /home/jm_c/test_engaging/output/ifcMp2_tst.stdout
11 #SBATCH --no-requeue
12
13 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_ifc_mp2,v 1.29 2023/11/06 14:23:01 jmc Exp $
14 # $Name: $
15
16 if test -f /etc/profile.d/modules.sh ; then . /etc/profile.d/modules.sh ; fi
17 # Note: added "ulimit -s unlimited" in file "~/.bashrc"
18 # 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 headNode='eofe8'
25
26 dNam='engaging'
27 HERE="$HOME/test_${dNam}"
28 OUTP="$HERE/output"; SavD="$HERE/send"
29 SEND="ssh $headNode $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 dblTr=0 ; typ='' ; addExp='' ; skipExp=''
42 sfx='ifcMp2'; dblTr=1
43 addExp='atm_gray atm_strato offline_cheapaml'
44 module add slurm
45 module add gcc
46 module add engaging/intel/2013.1.046
47 #export MPI_INC_DIR="$MPI_HOME/include"
48 OPTFILE="../tools/build_options/linux_amd64_ifort+impi"
49 export GENERIC='on' # <-- to prevent the use of "-xHost" option
50 mpiCMD="mpirun -env I_MPI_DEBUG 2 -n TR_NPROC ./mitgcmuv" #- currently not used
51 options="$typ -MPI 4 -mth"
52 #options="-j 4 $options"
53 export OMP_NUM_THREADS=2
54 export KMP_STACKSIZE=400m
55 #options="$options -gsl"
56 #export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized
57 ulimit -s unlimited
58 #- need this to get "staf" & "do_make_syntax.sh":
59 export PATH="$PATH:$HOME/bin"
60
61 gcmDIR="MITgcm_$sfx"
62 dAlt=`date +%d` ; dAlt=`expr $dAlt % 3`
63 if [ $dAlt -eq 1 ] ; then options="$options -fast"
64 else options="$options -devel" ; fi
65 if test "x$skipExp" != x ; then skipExp=`echo $skipExp | sed 's/^ *//'` ; fi
66
67 checkOut=1 ; #options="$options -do"
68 #options="$options -nc" ; checkOut=1 ; dblTr=0
69 #options="$options -q" ; checkOut=0 ; dblTr=0
70 # dblTr=-1 #- skip testreport completely (only run "do_tst_2+2")
71
72 if test -d $TST_DIR ; then
73 echo "start from TST_DIR='$TST_DIR' at: "`date`
74 else
75 #if test ! -d $TST_DIR ; then mkdir $TST_DIR ; fi
76 #if test ! -d $TST_DIR ; then
77 # echo "ERROR: Can't create directory \"$TST_DIR\""
78 # exit 1
79 #fi
80 #echo "start in new dir TST_DIR='$TST_DIR' at: "`date`
81 echo "ERROR: missing directory \"$TST_DIR\""
82 exit 1
83 fi
84 cd $TST_DIR
85 pwd
86 df .
87
88 NSLOTS=$SLURM_NTASKS
89 THEDATE=`date`
90 echo '********************************************************************************'
91 echo 'Start job '$THEDATE
92 echo 'NSLOTS = '$NSLOTS
93 echo '======= NODELIST ==============================================================='
94 echo $SLURM_NODELIST
95 cat /etc/redhat-release
96 echo '======= Procs =================================================================='
97 grep 'model name' /proc/cpuinfo | uniq
98 echo -n ' x '
99 grep -c 'model name' /proc/cpuinfo
100 echo '======= env ===================================================================='
101 env | grep SLURM
102 echo '======= modules ================================================================'
103 module list 2>&1
104 echo '================================================================================'
105
106 #-
107 MPI_MFile="${OUTP}/mf_${sfx}" #- currently not used
108 #mpiCMD="mpirun -hostfile TR_MFILE -n TR_NPROC ./mitgcmuv"
109 #- make the testreport MPI_MFILE:
110 #listNODES=`echo $SLURM_NODELIST | sed -e 's/\[/ /' -e 's/\]//' -e 's/,/ /' -e 's/-/ /'`
111 # duplicate the 2 listed nodes into a 6 list file:
112 #/bin/rm -f $MPI_MFile ; touch $MPI_MFile
113 #for nc in `seq 1 4` ; do pfx=''
114 # for nd in $listNODES ; do
115 # if test "x$pfx" = x ; then pfx=$nd ; else
116 # echo "${pfx}${nd}" >> $MPI_MFile
117 # fi
118 # done
119 #done
120
121 #- check for disk space: relative space (99%) or absolute (10.G):
122 dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
123 if [ $dsp -gt 99 ] ; then
124 #dsp=`df -P . | tail -1 | awk '{print $4}'`
125 #if [ $dsp -le 100000000 ] ; then
126 echo 'Not enough space on this disk => do not run testreport.'
127 df .
128 exit
129 fi
130
131 if [ $checkOut -eq 1 ] ; then
132 if test ! -e $gcmDIR/.git/config ; then
133 echo "no file: $gcmDIR/.git/config => try to download a fresh clone"
134 checkOut=2
135 fi
136 if test "x$addExp" != x ; then
137 if test ! -e $gcmDIR/$git_other/.git/config ; then
138 echo "no file: $gcmDIR/$git_other/.git/config => try a fresh clone"
139 checkOut=2
140 fi
141 fi
142 fi
143 if [ $checkOut -eq 1 ] ; then
144 echo "cleaning output from $gcmDIR/verification @ "`date +"%H:%M:%S"`" :"
145 #- remove previous output tar files and tar & remove previous output-dir
146 /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
147 ( cd $gcmDIR/verification
148 listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
149 for dd in $listD
150 do
151 if test -d $dd ; then
152 tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
153 retVal=$?
154 if test "x$retVal" != x0 ; then
155 echo "ERROR in tar+gzip prev outp-dir: $dd"
156 echo " on '"`hostname`"' (return val=$retVal) but continue"
157 fi
158 fi
159 done )
160 echo "clean tst_2+2 + testreport output (+ Makefile_syntax files)"
161 ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
162 ( cd $gcmDIR/verification ; ./testreport $typ -clean )
163 ( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax )
164 ( cd $gcmDIR/verification ; rm -f */build/port_rand.i */build/ptracers_set_iolabel.i )
165 if test "x$addExp" != x ; then
166 ( cd $gcmDIR/verification
167 listD=`ls -o | grep '^l' | awk '{print $8}' 2> /dev/null`
168 echo " + remove local links: $listD"
169 /bin/rm -f $listD
170 )
171 fi
172 echo "Update $git_code code in dir $gcmDIR @ "`date +"%H:%M:%S"`" :"
173 ( cd $gcmDIR ; git pull ) 2>&1
174 retVal=$?
175 if test "x$retVal" != x0 ; then
176 echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit"
177 exit
178 fi
179 echo " and checkout master @ "`date +"%H:%M:%S"`" :"
180 ( cd $gcmDIR ; git checkout master -- . ) 2>&1
181 if test "x$addExp" != x ; then
182 echo "Update $git_other code in dir $gcmDIR/$git_other @ "`date +"%H:%M:%S"`" :"
183 ( cd $gcmDIR/$git_other ; git pull ) 2>&1
184 retVal=$?
185 if test "x$retVal" != x0 ; then
186 echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit"
187 exit
188 fi
189 echo " and checkout master @ "`date +"%H:%M:%S"`" :"
190 ( cd $gcmDIR/$git_other ; git checkout master -- . ) 2>&1
191 fi
192 fi
193
194 if [ $checkOut -eq 2 ] ; then
195 if test -e $gcmDIR ; then
196 echo -n "Removing working copy: $gcmDIR ..."
197 rm -rf $gcmDIR
198 echo " done"
199 fi
200 echo "Make a clone of $git_code from repo: $git_repo ..."
201 git clone $git_repo/${git_code}.git $gcmDIR 2> $tmpFil
202 retVal=$?
203 if test $retVal = 0 ; then
204 echo ' done' ; rm -f $tmpFil
205 else
206 echo " Error: 'git clone' returned: $retVal"
207 cat $tmpFil ; rm -f $tmpFil
208 exit
209 fi
210 if test "x$addExp" != x ; then
211 echo "Make a clone of $git_other from repo: $git_repo ..."
212 ( cd $gcmDIR ; git clone $git_repo/${git_other}.git 2> $tmpFil )
213 retVal=$?
214 if test $retVal = 0 ; then
215 echo ' done' ; rm -f $tmpFil
216 else
217 echo " Error: 'git clone' returned: $retVal"
218 cat $tmpFil ; rm -f $tmpFil
219 exit
220 fi
221 fi
222 if test -d $gcmDIR/verification ; then
223 /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
224 /usr/bin/find $gcmDIR -type f | xargs chmod g+r
225 fi
226 fi
227
228 #- change dir to $gcmDIR/verification + add link for additional experiments:
229 if test -e $gcmDIR/verification ; then
230 if [ $checkOut -lt 2 ] ; then
231 echo " dir $gcmDIR/verification exist" ; fi
232 cd $gcmDIR/verification
233 for exp2add in $addExp ; do
234 test -r $exp2add && /bin/rm -rf $exp2add
235 if test -d ../$git_other/$exp2add ; then
236 echo " add $exp2add link from $git_other"
237 ln -s ../$git_other/$exp2add .
238 else
239 echo " missing dir: $git_other/$exp2add"
240 continue
241 fi
242 done
243 else
244 echo "no dir: $gcmDIR/verification => exit"
245 exit
246 fi
247
248 if [ $dblTr -eq 1 ] ; then
249 echo ''
250 #- 0) just make all module header ( *__genmod.mod files) using modified Makefile
251 # <-- skip this step
252 #- 1) just compile ("-nr"), using "-j 4" to speed up
253 echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
254 -j 4 -nr -odir ${dNam}-$sfx
255 ./testreport $options -of $OPTFILE -skd "$skipExp" \
256 -j 4 -nr -odir ${dNam}-$sfx
257 nFc=`grep -c '^Y . N N ' tr_out.txt`
258 echo " <= fail to compile $nFc experiments"
259 options="$options -q"
260 fi
261
262 if [ $dblTr -ge 0 ] ; then
263 echo ''
264 #- 2) run and report results ; also finish to compile those who failed with "-j"
265 #echo ./testreport $options -of $OPTFILE -command \'$mpiCMD\' -mf $MPI_MFile \
266 echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
267 -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
268 #./testreport $options -of $OPTFILE -command "$mpiCMD" -mf $MPI_MFile \
269 ./testreport $options -of $OPTFILE -skd "$skipExp" \
270 -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
271 retVal=$?
272 else retVal=0 ; fi
273
274 if test "x$retVal" != x0 ; then
275 echo "<== testreport returned retVal=${retVal}, expecting 0"
276 echo " -> skip restart test 'do_tst_2+2'"
277 else
278 echo ''
279 #- 3) test restart and report results
280 #echo ../tools/do_tst_2+2 -mpi -exe \'$mpiCMD\' -mf $MPI_MFile \
281 echo ../tools/do_tst_2+2 -mpi \
282 -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
283 #../tools/do_tst_2+2 -mpi -exe "$mpiCMD" -mf $MPI_MFile \
284 ../tools/do_tst_2+2 -mpi \
285 -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
286 fi

  ViewVC Help
Powered by ViewVC 1.1.22