/[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.11 - (hide annotations) (download)
Sun Feb 4 21:03:20 2018 UTC (7 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.10: +32 -20 lines
- rename local copy of the code to MITgcm_today
- prepare for running on local /scratch disk

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

  ViewVC Help
Powered by ViewVC 1.1.22