/[MITgcm]/MITgcm_contrib/test_scripts/svante/test_svante_ifc_mpi
ViewVC logotype

Annotation of /MITgcm_contrib/test_scripts/svante/test_svante_ifc_mpi

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


Revision 1.15 - (hide annotations) (download)
Tue Jun 12 21:42:21 2018 UTC (7 years, 1 month ago) by jmc
Branch: MAIN
Changes since 1.14: +3 -1 lines
avoid newer nodes to always get same results

1 jmc 1.1 #!/bin/bash
2 jmc 1.4 #SBATCH -J ifcMPI_tst
3 jmc 1.1 #SBATCH -p fdr
4 jmc 1.10 #SBATCH -t 23:30:00
5 jmc 1.1 #SBATCH --mem-per-cpu 4000
6     #SBATCH -N 1
7     #SBATCH --tasks-per-node 6
8 jmc 1.15 #SBATCH -x curly,larry,moe,shemp
9 jmc 1.4 #SBATCH -e /home/jm_c/test_svante/output/ifcMPI_tst.stderr
10     #SBATCH -o /home/jm_c/test_svante/output/ifcMPI_tst.stdout
11 jmc 1.2 #SBATCH --no-requeue
12 jmc 1.1
13 jmc 1.15 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/svante/test_svante_ifc_mpi,v 1.14 2018/03/23 13:58:23 jmc Exp $
14 jmc 1.1 # $Name: $
15    
16     if test -f /etc/profile.d/modules.sh ; then . /etc/profile.d/modules.sh ; fi
17     if test -f /etc/profile.d/zz_modules.sh ; then . /etc/profile.d/zz_modules.sh ; 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     headNode='svante-login'
26    
27     dNam='svante'
28     HERE="$HOME/test_${dNam}"
29     OUTP="$HERE/output"; SavD="$HERE/send"
30     SEND="ssh $headNode $SavD/mpack"
31 jmc 1.12 #TST_DISK="/net/fs09/d1/jm_c"
32     TST_DISK="/scratch/jm_c"
33 jmc 1.1 TST_DIR="$TST_DISK/test_${dNam}"
34 jmc 1.11 #- where local copy of code is (need to be consistent with "test_submit_svante"):
35 jmc 1.12 #srcDIR='.'
36     srcDIR=$HERE
37 jmc 1.11 srcCode="MITgcm_today"
38    
39     echo "cd $TST_DISK ; pwd (x2)"
40     cd $TST_DISK
41     pwd
42     if test ! -d $TST_DIR ; then
43     echo -n "Creating a working dir: $TST_DIR ..."
44     #/bin/rm -rf $TST_DIR
45     mkdir $TST_DIR
46     retVal=$?
47     if test "x$retVal" != x0 ; then
48     echo "Error: unable to make dir: $TST_DIR (err=$retVal ) --> Exit"
49     exit 1
50     fi
51 jmc 1.1 fi
52 jmc 1.11 echo "start from TST_DIR='$TST_DIR' at: "`date`
53     cd $TST_DIR
54     pwd
55 jmc 1.1
56 jmc 1.5 typ='' ; addExp='' ; skipExp=''
57     sfx='ifcMPI'
58 jmc 1.1 module add intel/2017.0.1
59     module add openmpi
60     #module add netcdf
61     OPTFILE="../tools/build_options/linux_amd64_ifort11"
62 jmc 1.15 export GENERIC='on' # <-- to prevent the use of "-xHost" option
63 jmc 1.1 #- needed for DIVA with MPI:
64     #export MPI_INC_DIR=$INC_MPI
65 jmc 1.13 options="$typ -MPI 6"
66 jmc 1.7 #options="-j 2 $options"
67 jmc 1.1 #- need this to get "staf":
68     #export PATH="$PATH:$HOME/bin"
69    
70     dAlt=`date +%d` ; dAlt=`expr $dAlt % 3`
71     #if [ $dAlt -eq 1 ] ; then options="$options -fast"
72     #else options="$options -devel" ; fi
73    
74     checkOut=2 ; #options="$options -do"
75     #options="$options -nc" ; checkOut=1
76     #options="$options -q" ; checkOut=0
77    
78     NSLOTS=$SLURM_NTASKS
79     THEDATE=`date`
80     echo '********************************************************************************'
81     echo 'Start job '$THEDATE
82     echo 'NSLOTS = '$NSLOTS
83     echo '======= NODELIST ==============================================================='
84     echo $SLURM_NODELIST
85     cat /etc/redhat-release
86     echo '======= env ===================================================================='
87     env | grep SLURM
88     echo '======= modules ================================================================'
89     module list 2>&1
90     echo '================================================================================'
91    
92     cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
93     gcmDIR="MITgcm_$sfx"
94     #- check for disk space: relative space (99%) or absolute (10.G):
95     dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
96     if [ $dsp -gt 99 ] ; then
97     #dsp=`df -P . | tail -1 | awk '{print $4}'`
98     #if [ $dsp -le 100000000 ] ; then
99     echo 'Not enough space on this disk => do not run testreport.'
100     df .
101     exit
102     fi
103     if [ $checkOut -eq 1 ] ; then
104     if test -d $gcmDIR/CVS ; then
105     echo "cleaning output from $gcmDIR/verification :"
106     #- remove previous output tar files and tar & remove previous output-dir
107     /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
108     ( cd $gcmDIR/verification
109     listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
110     for dd in $listD
111     do
112     if test -d $dd ; then
113     tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
114 jmc 1.11 retVal=$?
115     if test "x$retVal" != x0 ; then
116 jmc 1.1 echo "ERROR in tar+gzip prev outp-dir: $dd"
117 jmc 1.11 echo " on '"`hostname`"' (return val=$retVal) but continue"
118 jmc 1.1 fi
119     fi
120     done )
121     ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
122     ( cd $gcmDIR/verification ; ./testreport $typ -clean )
123     echo "cvs update of dir $gcmDIR :"
124     ( cd $gcmDIR ; $cmdCVS update -P -d ) 2>&1
125 jmc 1.11 retVal=$?
126     if test "x$retVal" != x0 ; then
127     echo "cvs update on '"`hostname`"' fail (return val=$retVal) => exit"
128 jmc 1.1 exit
129     fi
130     else
131     echo "no dir: $gcmDIR/CVS => try a fresh check-out"
132     checkOut=2
133     fi
134     fi
135     if [ $checkOut -eq 2 ] ; then
136     if test -e $gcmDIR ; then
137     echo -n "Removing working copy: $gcmDIR ..."
138     rm -rf $gcmDIR
139     echo " done"
140     fi
141     # make a local copy (instead of using CVS):
142     today=`date +%Y%m%d`
143 jmc 1.11 nCount=0; updFile="${srcDIR}/updated_code"
144 jmc 1.1 updDate=0 ; test -f $updFile && updDate=`cat $updFile`
145     while [ $today -gt $updDate ] ; do
146     nCount=`expr $nCount + 1`
147     if [ $nCount -gt 40 ] ; then
148     echo " waiting too long (nCount=$nCount) for updated code"
149     echo " today=$today , updDate=$updDate "
150     ls -l $updFile
151     exit
152     fi
153     sleep 60
154     updDate=0 ; test -f $updFile && updDate=`cat $updFile`
155     done
156     ls -l $updFile
157     echo " waited nCount=$nCount for updated code ($updDate) to copy"
158 jmc 1.11 if test -d $srcDIR/$srcCode ; then
159     echo -n "Make local copy of dir '$srcDIR/$srcCode' to: $gcmDIR ..."
160     cp -pra $srcDIR/$srcCode $gcmDIR
161 jmc 1.1 echo " done"
162 jmc 1.11 else echo " dir: $srcDIR/$srcCode missing => exit" ; exit ; fi
163 jmc 1.1 fi
164    
165     #- change dir to $gcmDIR/verification dir:
166     if test -e $gcmDIR/verification ; then
167     if [ $checkOut -lt 2 ] ; then
168     echo " dir $gcmDIR/verification exist" ; fi
169     cd $gcmDIR/verification
170     else
171     echo "no dir: $gcmDIR/verification => exit"
172     exit
173     fi
174    
175     if [ $dAlt -eq 1 ] ; then
176     options="$options -fast"
177     echo ''
178 jmc 1.7 #- 1) just compile ("-nr"), using "-j 2" to speed up
179 jmc 1.5 echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
180 jmc 1.14 -j 4 -nr -odir ${dNam}-$sfx
181 jmc 1.5 ./testreport $options -of $OPTFILE -skd "$skipExp" \
182 jmc 1.14 -j 4 -nr -odir ${dNam}-$sfx
183 jmc 1.7 nFc=`grep -c '^Y . N N ' tr_out.txt`
184     echo " <= fail to compile $nFc experiments"
185 jmc 1.1 else
186     options="$options -devel"
187     echo ''
188 jmc 1.7 #- 0) just make all module header ( *__genmod.mod files) using modified Makefile
189 jmc 1.5 echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
190 jmc 1.14 -j 4 -repl_mk do_make_syntax.sh -obj -dd
191 jmc 1.5 ./testreport $options -of $OPTFILE -skd "$skipExp" \
192 jmc 1.14 -j 4 -repl_mk do_make_syntax.sh -obj -dd 2>&1
193 jmc 1.1 echo ''
194 jmc 1.7 #- 1) just compile ("-nr"), using "-j 2" to speed up
195     echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
196 jmc 1.14 -j 4 -nr -q -odir ${dNam}-$sfx
197 jmc 1.7 ./testreport $options -of $OPTFILE -skd "$skipExp" \
198 jmc 1.14 -j 4 -nr -q -odir ${dNam}-$sfx
199 jmc 1.7 nFc=`grep -c '^Y . N N ' tr_out.txt`
200     echo " <= fail to compile $nFc experiments"
201     fi
202     echo ''
203     #- 2) run and report results ; also finish to compile those who failed with "-j"
204 jmc 1.5 echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
205 jmc 1.9 -q -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
206 jmc 1.5 ./testreport $options -of $OPTFILE -skd "$skipExp" \
207 jmc 1.9 -q -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
208 jmc 1.1 echo ''
209 jmc 1.7 #- 3) test restart and report results
210 jmc 1.5 echo ../tools/do_tst_2+2 -mpi \
211 jmc 1.9 -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
212 jmc 1.5 ../tools/do_tst_2+2 -mpi \
213 jmc 1.9 -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
214 jmc 1.5

  ViewVC Help
Powered by ViewVC 1.1.22