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

Annotation of /MITgcm_contrib/test_scripts/svante/test_svante_pgi_mpi

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


Revision 1.12 - (hide annotations) (download)
Thu Dec 28 17:33:38 2017 UTC (7 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.11: +3 -3 lines
- move testing from /net/fs09/d0/jm_c to /net/fs09/d1/jm_c
- increase time limit of each testing job

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

  ViewVC Help
Powered by ViewVC 1.1.22