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

Annotation of /MITgcm_contrib/test_scripts/svante/test_svante_pgi_mth

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


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

1 jmc 1.1 #!/bin/bash
2     #SBATCH -J pgiMth_tst
3     #SBATCH -p fdr
4 jmc 1.4 #SBATCH -t 18:00:00
5 jmc 1.1 #SBATCH --mem-per-cpu 4000
6     #SBATCH -N 1
7     #SBATCH --tasks-per-node 3
8 jmc 1.8 #SBATCH -x curly,larry,moe,shemp
9 jmc 1.1 #SBATCH -e /home/jm_c/test_svante/output/pgiMth_tst.stderr
10     #SBATCH -o /home/jm_c/test_svante/output/pgiMth_tst.stdout
11     #SBATCH --no-requeue
12    
13 jmc 1.8 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/svante/test_svante_pgi_mth,v 1.7 2018/02/05 13:36:05 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.7 #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.6 #- where local copy of code is (need to be consistent with "test_submit_svante"):
35 jmc 1.7 #srcDIR='.'
36     srcDIR=$HERE
37 jmc 1.6 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.6 echo "start from TST_DIR='$TST_DIR' at: "`date`
53     cd $TST_DIR
54     pwd
55 jmc 1.1
56 jmc 1.2 typ='' ; addExp='' ; skipExp=''
57     sfx='pgiMth'
58     skipExp='internal_wave tutorial_advection_in_gyre'
59 jmc 1.1 module add pgi/16.9
60     #module add openmpi
61     module add netcdf
62     OPTFILE="../tools/build_options/linux_amd64_pgf77"
63     #- needed for DIVA with MPI:
64     #export MPI_INC_DIR="/home/software/pgi/16.9/linux86-64/2016/mpi/openmpi-1.10.2/include"
65     options="$typ -mth"
66     export OMP_NUM_THREADS=2
67     export OMP_STACKSIZE=400m
68     #- need this to get "staf":
69     #export PATH="$PATH:$HOME/bin"
70    
71     dAlt=`date +%d` ; dAlt=`expr $dAlt % 3`
72     if [ $dAlt -eq 1 ] ; then options="$options -fast"
73     else options="$options -devel" ; fi
74    
75     checkOut=2 ; #options="$options -do"
76     #options="$options -nc" ; checkOut=1
77     #options="$options -q" ; checkOut=0
78    
79     NSLOTS=$SLURM_NTASKS
80     THEDATE=`date`
81     echo '********************************************************************************'
82     echo 'Start job '$THEDATE
83     echo 'NSLOTS = '$NSLOTS
84     echo '======= NODELIST ==============================================================='
85     echo $SLURM_NODELIST
86     cat /etc/redhat-release
87     echo '======= env ===================================================================='
88     env | grep SLURM
89     echo '======= modules ================================================================'
90     module list 2>&1
91     echo '================================================================================'
92    
93     cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
94     gcmDIR="MITgcm_$sfx"
95     #- check for disk space: relative space (99%) or absolute (10.G):
96     dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
97     if [ $dsp -gt 99 ] ; then
98     #dsp=`df -P . | tail -1 | awk '{print $4}'`
99     #if [ $dsp -le 100000000 ] ; then
100     echo 'Not enough space on this disk => do not run testreport.'
101     df .
102     exit
103     fi
104     if [ $checkOut -eq 1 ] ; then
105     if test -d $gcmDIR/CVS ; then
106     echo "cleaning output from $gcmDIR/verification :"
107     #- remove previous output tar files and tar & remove previous output-dir
108     /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
109     ( cd $gcmDIR/verification
110     listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
111     for dd in $listD
112     do
113     if test -d $dd ; then
114     tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
115 jmc 1.6 retVal=$?
116     if test "x$retVal" != x0 ; then
117 jmc 1.1 echo "ERROR in tar+gzip prev outp-dir: $dd"
118 jmc 1.6 echo " on '"`hostname`"' (return val=$retVal) but continue"
119 jmc 1.1 fi
120     fi
121     done )
122     ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
123     ( cd $gcmDIR/verification ; ./testreport $typ -clean )
124     echo "cvs update of dir $gcmDIR :"
125     ( cd $gcmDIR ; $cmdCVS update -P -d ) 2>&1
126 jmc 1.6 retVal=$?
127     if test "x$retVal" != x0 ; then
128     echo "cvs update on '"`hostname`"' fail (return val=$retVal) => exit"
129 jmc 1.1 exit
130     fi
131     else
132     echo "no dir: $gcmDIR/CVS => try a fresh check-out"
133     checkOut=2
134     fi
135     fi
136     if [ $checkOut -eq 2 ] ; then
137     if test -e $gcmDIR ; then
138     echo -n "Removing working copy: $gcmDIR ..."
139     rm -rf $gcmDIR
140     echo " done"
141     fi
142     # make a local copy (instead of using CVS):
143     today=`date +%Y%m%d`
144 jmc 1.6 nCount=0; updFile="${srcDIR}/updated_code"
145 jmc 1.1 updDate=0 ; test -f $updFile && updDate=`cat $updFile`
146     while [ $today -gt $updDate ] ; do
147     nCount=`expr $nCount + 1`
148     if [ $nCount -gt 40 ] ; then
149     echo " waiting too long (nCount=$nCount) for updated code"
150     echo " today=$today , updDate=$updDate "
151     ls -l $updFile
152     exit
153     fi
154     sleep 60
155     updDate=0 ; test -f $updFile && updDate=`cat $updFile`
156     done
157     ls -l $updFile
158     echo " waited nCount=$nCount for updated code ($updDate) to copy"
159 jmc 1.6 if test -d $srcDIR/$srcCode ; then
160     echo -n "Make local copy of dir '$srcDIR/$srcCode' to: $gcmDIR ..."
161     cp -pra $srcDIR/$srcCode $gcmDIR
162 jmc 1.1 echo " done"
163 jmc 1.6 else echo " dir: $srcDIR/$srcCode missing => exit" ; exit ; fi
164 jmc 1.1 # cvs co MITgcm
165     #echo "Downloading using '$cmdCVS co -P -d $gcmDIR MITgcm' ..."
166     #$cmdCVS co -P -d $gcmDIR MITgcm > /dev/null
167 jmc 1.6 #retVal=$?
168     #if test "x$retVal" != x0 ; then
169     # echo "cvs co on '"`hostname`"' fail (return val=$retVal) => exit"
170 jmc 1.1 # exit
171     #else echo " done" ; fi
172     #if test -d $gcmDIR/verification ; then
173     # for exp2add in $addExp ; do
174     # echo " add dir: $exp2add (from Contrib:verification_other)"
175     # ( cd $gcmDIR/verification ; $cmdCVS co -P -d $exp2add \
176     # MITgcm_contrib/verification_other/$exp2add > /dev/null )
177     # done
178     # /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
179     # /usr/bin/find $gcmDIR -type f | xargs chmod g+r
180     #fi
181     fi
182    
183     #- change dir to $gcmDIR/verification dir:
184     if test -e $gcmDIR/verification ; then
185     if [ $checkOut -lt 2 ] ; then
186     echo " dir $gcmDIR/verification exist" ; fi
187     cd $gcmDIR/verification
188     else
189     echo "no dir: $gcmDIR/verification => exit"
190     exit
191     fi
192    
193     echo ''
194 jmc 1.2 echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
195 jmc 1.5 -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
196 jmc 1.2 ./testreport $options -of $OPTFILE -skd "$skipExp" \
197 jmc 1.5 -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
198 jmc 1.1
199     echo ''
200 jmc 1.2 echo ../tools/do_tst_2+2 \
201 jmc 1.5 -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
202 jmc 1.2 ../tools/do_tst_2+2 \
203 jmc 1.5 -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
204 jmc 1.1

  ViewVC Help
Powered by ViewVC 1.1.22