/[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.14 - (hide annotations) (download)
Sun Feb 4 21:03:20 2018 UTC (7 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.13: +36 -31 lines
- rename local copy of the code to MITgcm_today
- prepare for running on local /scratch disk

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

  ViewVC Help
Powered by ViewVC 1.1.22