/[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.5 - (hide annotations) (download)
Fri Jan 5 22:13:25 2018 UTC (7 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.4: +5 -5 lines
to send testreport output, use new email address: jm_c@mitgcm.org
 (replacing jmc@dev.mitgcm.org)

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

  ViewVC Help
Powered by ViewVC 1.1.22