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

  ViewVC Help
Powered by ViewVC 1.1.22