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

  ViewVC Help
Powered by ViewVC 1.1.22