/[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.1 - (hide annotations) (download)
Thu Feb 16 21:39:48 2017 UTC (9 years, 6 months ago) by jmc
Branch: MAIN
try Adjoint MPI test using PGI compiler, all run on compute node
 with access to TAF via (ssh) ProxyCommand.

1 jmc 1.1 #!/bin/bash
2     #SBATCH -J tst_pgiAdm
3     #SBATCH -p fdr
4     #SBATCH -t 6:00:00
5     #SBATCH --mem-per-cpu 4000
6     #SBATCH -N 1
7     #SBATCH --tasks-per-node 6
8     #SBATCH -e /home/jm_c/test_svante/output/tst_pgiAdm.stderr
9     #SBATCH -o /home/jm_c/test_svante/output/tst_pgiAdm.stdout
10    
11     # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/svante/test_svante_pgi_mpi,v 1.6 2017/01/13 22:41:26 jmc Exp $
12     # $Name: $
13    
14     if test -f /etc/profile.d/modules.sh ; then . /etc/profile.d/modules.sh ; fi
15     if test -f /etc/profile.d/zz_modules.sh ; then . /etc/profile.d/zz_modules.sh ; fi
16     # Note: added "ulimit -s unlimited" in file "~/.bashrc"
17     # to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI
18    
19     umask 0022
20     #- to get case insensitive "ls" (and order of tested experiments)
21     export LC_ALL="en_US.UTF-8"
22     echo " running on: "`hostname`
23     headNode='svante-login'
24    
25     dNam='svante'
26     HERE="$HOME/test_${dNam}"
27     OUTP="$HERE/output"; SavD="$HERE/send"
28     SEND="ssh $headNode $SavD/mpack"
29     TST_DISK="/net/fs09/d0/jm_c"
30     TST_DIR="$TST_DISK/test_${dNam}"
31    
32     cd $TST_DISK ; pwd
33     if test -d $TST_DIR ; then
34     echo "start from TST_DIR='$TST_DIR' at: "`date`
35     else
36     echo "ERROR: missing directory \"$TST_DIR\""
37     exit 1
38     fi
39    
40     sfx='pgiAdm'; typ='-adm'
41     addExp=''
42     module add pgi/16.9
43     module add openmpi
44     module add netcdf
45     OPTFILE="../tools/build_options/linux_amd64_pgf77"
46     #- needed for DIVA with MPI:
47     export MPI_INC_DIR="/home/software/pgi/16.9/linux86-64/2016/mpi/openmpi-1.10.2/include"
48     options="$typ -MPI 6"
49     #- need this to get "staf":
50     export PATH="$PATH:$HOME/bin"
51    
52     dAlt=`date +%d` ; dAlt=`expr $dAlt % 3`
53     if [ $dAlt -eq 1 ] ; then options="$options -fast"
54     else options="$options -devel" ; fi
55    
56     checkOut=2 ; #options="$options -do"
57     #options="$options -nc" ; checkOut=1
58     #options="$options -q" ; checkOut=0
59    
60     NSLOTS=$SLURM_NTASKS
61     THEDATE=`date`
62     echo '********************************************************************************'
63     echo 'Start job '$THEDATE
64     echo 'NSLOTS = '$NSLOTS
65     echo '======= NODELIST ==============================================================='
66     echo $SLURM_NODELIST
67     cat /etc/redhat-release
68     echo '======= env ===================================================================='
69     env | grep SLURM
70     echo '======= modules ================================================================'
71     module list 2>&1
72     echo '================================================================================'
73    
74     cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
75     gcmDIR="MITgcm_$sfx"
76     cd $TST_DIR
77     #- check for disk space: relative space (99%) or absolute (10.G):
78     dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
79     if [ $dsp -gt 99 ] ; then
80     #dsp=`df -P . | tail -1 | awk '{print $4}'`
81     #if [ $dsp -le 100000000 ] ; then
82     echo 'Not enough space on this disk => do not run testreport.'
83     df .
84     exit
85     fi
86     if [ $checkOut -eq 1 ] ; then
87     if test -d $gcmDIR/CVS ; then
88     echo "cleaning output from $gcmDIR/verification :"
89     #- remove previous output tar files and tar & remove previous output-dir
90     /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
91     ( cd $gcmDIR/verification
92     listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
93     for dd in $listD
94     do
95     if test -d $dd ; then
96     tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
97     RETVAL=$?
98     if test "x$RETVAL" != x0 ; then
99     echo "ERROR in tar+gzip prev outp-dir: $dd"
100     echo " on '"`hostname`"' (return val=$RETVAL) but continue"
101     fi
102     fi
103     done )
104     ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
105     ( cd $gcmDIR/verification ; ./testreport $typ -clean )
106     echo "cvs update of dir $gcmDIR :"
107     ( cd $gcmDIR ; $cmdCVS update -P -d ) 2>&1
108     RETVAL=$?
109     if test "x$RETVAL" != x0 ; then
110     echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit"
111     exit
112     fi
113     else
114     echo "no dir: $gcmDIR/CVS => try a fresh check-out"
115     checkOut=2
116     fi
117     fi
118     if [ $checkOut -eq 2 ] ; then
119     if test -e $gcmDIR ; then
120     echo -n "Removing working copy: $gcmDIR ..."
121     rm -rf $gcmDIR
122     echo " done"
123     fi
124     # make a local copy (instead of using CVS):
125     today=`date +%Y%m%d`
126     nCount=0; updFile='updated_code'
127     updDate=0 ; test -f $updFile && updDate=`cat $updFile`
128     while [ $today -gt $updDate ] ; do
129     nCount=`expr $nCount + 1`
130     if [ $nCount -gt 40 ] ; then
131     echo " waiting too long (nCount=$nCount) for updated code"
132     echo " today=$today , updDate=$updDate "
133     ls -l $updFile
134     exit
135     fi
136     sleep 60
137     updDate=0 ; test -f $updFile && updDate=`cat $updFile`
138     done
139     ls -l $updFile
140     echo " waited nCount=$nCount for updated code ($updDate) to copy"
141     if test -d MITgcm ; then
142     echo -n "Make local copy of dir 'MITgcm' to: $gcmDIR ..."
143     cp -pra MITgcm $gcmDIR
144     echo " done"
145     else echo " dir: MITgcm missing => exit" ; exit ; fi
146     # cvs co MITgcm
147     #echo "Downloading using '$cmdCVS co -P -d $gcmDIR MITgcm' ..."
148     #$cmdCVS co -P -d $gcmDIR MITgcm > /dev/null
149     #RETVAL=$?
150     #if test "x$RETVAL" != x0 ; then
151     # echo "cvs co on '"`hostname`"' fail (return val=$RETVAL) => exit"
152     # exit
153     #else echo " done" ; fi
154     #if test -d $gcmDIR/verification ; then
155     # for exp2add in $addExp ; do
156     # echo " add dir: $exp2add (from Contrib:verification_other)"
157     # ( cd $gcmDIR/verification ; $cmdCVS co -P -d $exp2add \
158     # MITgcm_contrib/verification_other/$exp2add > /dev/null )
159     # done
160     # /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
161     # /usr/bin/find $gcmDIR -type f | xargs chmod g+r
162     #fi
163     fi
164    
165     #- change dir to $gcmDIR/verification dir:
166     if test -e $gcmDIR/verification ; then
167     if [ $checkOut -lt 2 ] ; then
168     echo " dir $gcmDIR/verification exist" ; fi
169     cd $gcmDIR/verification
170     else
171     echo "no dir: $gcmDIR/verification => exit"
172     exit
173     fi
174    
175     echo ''
176     echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \
177     -send \"$SEND\" -sd $SavD -a jmc@mitgcm.org
178     ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \
179     -send "$SEND" -sd $SavD -a jmc@mitgcm.org
180    
181     #echo ''
182     #echo ../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \
183     # -send \"$SEND\" -sd $SavD -a jmc@mitgcm.org
184     #../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \
185     # -send "$SEND" -sd $SavD -a jmc@mitgcm.org
186    

  ViewVC Help
Powered by ViewVC 1.1.22