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

Annotation of /MITgcm_contrib/test_scripts/svante/test_svante_pgi_adm

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


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

  ViewVC Help
Powered by ViewVC 1.1.22