/[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.1 - (hide annotations) (download)
Fri Apr 14 21:01:30 2017 UTC (8 years, 3 months ago) by jmc
Branch: MAIN
add a multi-threaded test with PGI compiler

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

  ViewVC Help
Powered by ViewVC 1.1.22