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

Annotation 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.17 - (hide annotations) (download)
Thu Jun 27 22:26:36 2019 UTC (6 years ago) by jmc
Branch: MAIN
Changes since 1.16: +1 -2 lines
remove list of excluded nodes

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

  ViewVC Help
Powered by ViewVC 1.1.22