/[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.6 - (hide annotations) (download)
Fri Jan 13 22:41:26 2017 UTC (8 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.5: +3 -2 lines
minor updates

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

  ViewVC Help
Powered by ViewVC 1.1.22