/[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.5 - (hide annotations) (download)
Thu Dec 29 22:05:32 2016 UTC (8 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.4: +28 -15 lines
update script to run on new head node (svante-login) using SLURM batch system

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

  ViewVC Help
Powered by ViewVC 1.1.22