/[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.12 - (hide annotations) (download)
Fri Feb 9 17:33:41 2018 UTC (7 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.11: +2 -2 lines
add "git checkout masteri" before "git pull" (safer this way).

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

  ViewVC Help
Powered by ViewVC 1.1.22