/[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.7 - (hide annotations) (download)
Mon Feb 5 13:36:05 2018 UTC (7 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.6: +5 -4 lines
switch to local "/scratch/" disk

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     #SBATCH -e /home/jm_c/test_svante/output/pgiMth_tst.stderr
9     #SBATCH -o /home/jm_c/test_svante/output/pgiMth_tst.stdout
10     #SBATCH --no-requeue
11    
12 jmc 1.7 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/svante/test_svante_pgi_mth,v 1.6 2018/02/04 21:03:20 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.7 #TST_DISK="/net/fs09/d1/jm_c"
31     TST_DISK="/scratch/jm_c"
32 jmc 1.1 TST_DIR="$TST_DISK/test_${dNam}"
33 jmc 1.6 #- where local copy of code is (need to be consistent with "test_submit_svante"):
34 jmc 1.7 #srcDIR='.'
35     srcDIR=$HERE
36 jmc 1.6 srcCode="MITgcm_today"
37    
38     echo "cd $TST_DISK ; pwd (x2)"
39     cd $TST_DISK
40     pwd
41     if test ! -d $TST_DIR ; then
42     echo -n "Creating a working dir: $TST_DIR ..."
43     #/bin/rm -rf $TST_DIR
44     mkdir $TST_DIR
45     retVal=$?
46     if test "x$retVal" != x0 ; then
47     echo "Error: unable to make dir: $TST_DIR (err=$retVal ) --> Exit"
48     exit 1
49     fi
50 jmc 1.1 fi
51 jmc 1.6 echo "start from TST_DIR='$TST_DIR' at: "`date`
52     cd $TST_DIR
53     pwd
54 jmc 1.1
55 jmc 1.2 typ='' ; addExp='' ; skipExp=''
56     sfx='pgiMth'
57     skipExp='internal_wave tutorial_advection_in_gyre'
58 jmc 1.1 module add pgi/16.9
59     #module add openmpi
60     module add netcdf
61     OPTFILE="../tools/build_options/linux_amd64_pgf77"
62     #- needed for DIVA with MPI:
63     #export MPI_INC_DIR="/home/software/pgi/16.9/linux86-64/2016/mpi/openmpi-1.10.2/include"
64     options="$typ -mth"
65     export OMP_NUM_THREADS=2
66     export OMP_STACKSIZE=400m
67     #- 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.6 retVal=$?
115     if test "x$retVal" != x0 ; then
116 jmc 1.1 echo "ERROR in tar+gzip prev outp-dir: $dd"
117 jmc 1.6 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.6 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.6 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.6 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.6 else echo " dir: $srcDIR/$srcCode missing => exit" ; exit ; fi
163 jmc 1.1 # cvs co MITgcm
164     #echo "Downloading using '$cmdCVS co -P -d $gcmDIR MITgcm' ..."
165     #$cmdCVS co -P -d $gcmDIR MITgcm > /dev/null
166 jmc 1.6 #retVal=$?
167     #if test "x$retVal" != x0 ; then
168     # echo "cvs co on '"`hostname`"' fail (return val=$retVal) => exit"
169 jmc 1.1 # exit
170     #else echo " done" ; fi
171     #if test -d $gcmDIR/verification ; then
172     # for exp2add in $addExp ; do
173     # echo " add dir: $exp2add (from Contrib:verification_other)"
174     # ( cd $gcmDIR/verification ; $cmdCVS co -P -d $exp2add \
175     # MITgcm_contrib/verification_other/$exp2add > /dev/null )
176     # done
177     # /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
178     # /usr/bin/find $gcmDIR -type f | xargs chmod g+r
179     #fi
180     fi
181    
182     #- change dir to $gcmDIR/verification dir:
183     if test -e $gcmDIR/verification ; then
184     if [ $checkOut -lt 2 ] ; then
185     echo " dir $gcmDIR/verification exist" ; fi
186     cd $gcmDIR/verification
187     else
188     echo "no dir: $gcmDIR/verification => exit"
189     exit
190     fi
191    
192     echo ''
193 jmc 1.2 echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
194 jmc 1.5 -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
195 jmc 1.2 ./testreport $options -of $OPTFILE -skd "$skipExp" \
196 jmc 1.5 -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
197 jmc 1.1
198     echo ''
199 jmc 1.2 echo ../tools/do_tst_2+2 \
200 jmc 1.5 -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
201 jmc 1.2 ../tools/do_tst_2+2 \
202 jmc 1.5 -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
203 jmc 1.1

  ViewVC Help
Powered by ViewVC 1.1.22