/[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.9 - (hide annotations) (download)
Tue Sep 12 18:47:45 2017 UTC (7 years, 10 months ago) by jmc
Branch: MAIN
Changes since 1.8: +17 -4 lines
split compilation (using -j option) and run (without -j) in 2 steps

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     #SBATCH -e /home/jm_c/test_engaging/output/tst_ifcMp2.stderr
8     #SBATCH -o /home/jm_c/test_engaging/output/tst_ifcMp2.stdout
9     #SBATCH --no-requeue --constraint=centos6
10    
11 jmc 1.9 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_ifc_mp2,v 1.8 2017/08/26 16:25:49 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.5 typ='' ; addExp='' ; skipExp=''
46     sfx='ifcMp2'
47 jmc 1.3 addExp='atm_gray offline_cheapaml'
48 jmc 1.1 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 jmc 1.4 export GENERIC='on' # <-- to prevent the use of "-xHost" option
54 jmc 1.1 mpiCMD="mpirun -env I_MPI_DEBUG 2 -n TR_NPROC ./mitgcmuv" #- currently not used
55 jmc 1.8 options="$typ -MPI 4 -mth"
56 jmc 1.9 #options="-j 4 $options"
57 jmc 1.1 export OMP_NUM_THREADS=2
58 jmc 1.2 export KMP_STACKSIZE=400m
59 jmc 1.1 #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 -fast"
67     else options="$options -devel" ; fi
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 jmc 1.4 echo '======= Procs =================================================================='
81     grep 'model name' /proc/cpuinfo | uniq
82     echo -n ' x '
83     grep -c 'model name' /proc/cpuinfo
84 jmc 1.1 cat /etc/redhat-release
85     echo '======= env ===================================================================='
86     env | grep SLURM
87     echo '======= modules ================================================================'
88     module list 2>&1
89     echo '================================================================================'
90    
91     #-
92     MPI_MFile="${OUTP}/mf_${sfx}" #- currently not used
93     #mpiCMD="mpirun -hostfile TR_MFILE -n TR_NPROC ./mitgcmuv"
94     #- make the testreport MPI_MFILE:
95     #listNODES=`echo $SLURM_NODELIST | sed -e 's/\[/ /' -e 's/\]//' -e 's/,/ /' -e 's/-/ /'`
96     # duplicate the 2 listed nodes into a 6 list file:
97     #/bin/rm -f $MPI_MFile ; touch $MPI_MFile
98     #for nc in `seq 1 4` ; do pfx=''
99     # for nd in $listNODES ; do
100     # if test "x$pfx" = x ; then pfx=$nd ; else
101     # echo "${pfx}${nd}" >> $MPI_MFile
102     # fi
103     # done
104     #done
105    
106     cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
107     gcmDIR="MITgcm_$sfx"
108     cd $TST_DIR
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     if test -d $gcmDIR/CVS ; then
120     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     RETVAL=$?
130     if test "x$RETVAL" != x0 ; then
131     echo "ERROR in tar+gzip prev outp-dir: $dd"
132     echo " on '"`hostname`"' (return val=$RETVAL) but continue"
133     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     echo "cvs update of dir $gcmDIR :"
142     ( cd $gcmDIR ; $cmdCVS update -P -d ) 2>&1
143     RETVAL=$?
144     if test "x$RETVAL" != x0 ; then
145     echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit"
146     exit
147     fi
148     else
149     echo "no dir: $gcmDIR/CVS => try a fresh check-out"
150     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     # cvs co MITgcm
160     echo "Downloading using '$cmdCVS co -P -d $gcmDIR MITgcm' ..."
161     $cmdCVS co -P -d $gcmDIR MITgcm > /dev/null
162     RETVAL=$?
163     if test "x$RETVAL" != x0 ; then
164     echo "cvs co on '"`hostname`"' fail (return val=$RETVAL) => exit"
165     exit
166     else echo " done" ; fi
167     if test -d $gcmDIR/verification ; then
168     /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
169     /usr/bin/find $gcmDIR -type f | xargs chmod g+r
170     fi
171     fi
172    
173     # -change dir to $gcmDIR/verification dir + add additional experiments:
174     if test -e $gcmDIR/verification ; then
175     if [ $checkOut -lt 2 ] ; then
176     echo " dir $gcmDIR/verification exist" ; fi
177     cd $gcmDIR/verification
178     for exp2add in $addExp ; do
179     if test -d ${exp2add}/CVS ; then
180     echo " assumes dir: $exp2add has been updated"
181     else
182     test -r $exp2add && /bin/rm -rf $exp2add
183     echo " add dir: $exp2add (from Contrib:verification_other)"
184     ( $cmdCVS co -P -d $exp2add \
185     MITgcm_contrib/verification_other/$exp2add > /dev/null )
186     /usr/bin/find $exp2add -type d | xargs chmod g+rxs
187     /usr/bin/find $exp2add -type f | xargs chmod g+r
188     fi
189     done
190     else
191     echo "no dir: $gcmDIR/verification => exit"
192     exit
193     fi
194    
195 jmc 1.9 #- 0) just make all module header ( *__genmod.mod files) using modified Makefile
196     # <-- skip this step
197 jmc 1.1 echo ''
198 jmc 1.9 #- 1) just compile ("-nr"), using "-j 4" to speed up
199     echo ./testreport $options -of $OPTFILE \
200     -j 4 -nr -odir ${dNam}-$sfx
201     ./testreport $options -of $OPTFILE \
202     -j 4 -nr -odir ${dNam}-$sfx
203     nFc=`grep -c '^Y . N N ' tr_out.txt`
204     echo " <= fail to compile $nFc experiments"
205    
206     echo ''
207     #- 2) run and report results ; also finish to compile those who failed with "-j"
208 jmc 1.5 #echo ./testreport $options -of $OPTFILE -command \'$mpiCMD\' -mf $MPI_MFile \
209     echo ./testreport $options -of $OPTFILE \
210 jmc 1.9 -q -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jmc@dev.mitgcm.org
211 jmc 1.5 #./testreport $options -of $OPTFILE -command "$mpiCMD" -mf $MPI_MFile \
212     ./testreport $options -of $OPTFILE \
213 jmc 1.9 -q -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jmc@dev.mitgcm.org
214 jmc 1.1
215     echo ''
216 jmc 1.9 #- 3) test restart and report results
217 jmc 1.5 #echo ../tools/do_tst_2+2 -mpi -exe \'$mpiCMD\' -mf $MPI_MFile \
218     echo ../tools/do_tst_2+2 -mpi \
219 jmc 1.6 -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jmc@dev.mitgcm.org
220 jmc 1.5 #../tools/do_tst_2+2 -mpi -exe "$mpiCMD" -mf $MPI_MFile \
221     ../tools/do_tst_2+2 -mpi \
222 jmc 1.6 -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jmc@dev.mitgcm.org
223 jmc 1.1

  ViewVC Help
Powered by ViewVC 1.1.22