/[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.6 - (hide annotations) (download)
Sat Jan 6 16:05:39 2018 UTC (7 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.5: +8 -5 lines
- exclude some nodes ;
- to send testreport output, use new email address: jm_c@mitgcm.org
 (replacing jmc@dev.mitgcm.org).

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

  ViewVC Help
Powered by ViewVC 1.1.22