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

Annotation of /MITgcm_contrib/test_scripts/engaging/test_engag_ifc_mpi

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


Revision 1.7 - (hide annotations) (download)
Wed Feb 7 19:39:19 2018 UTC (7 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.6: +48 -36 lines
change to use new code repository on GitHub

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

  ViewVC Help
Powered by ViewVC 1.1.22