/[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.11 - (hide annotations) (download)
Mon Sep 19 02:20:02 2022 UTC (2 years, 9 months ago) by jmc
Branch: MAIN
Changes since 1.10: +2 -2 lines
remove "curly" from list of excluded nodes

1 jmc 1.1 #!/bin/bash
2     #SBATCH -J pgiMth_tst
3     #SBATCH -p fdr
4 jmc 1.4 #SBATCH -t 18:00:00
5 jmc 1.1 #SBATCH --mem-per-cpu 4000
6     #SBATCH -N 1
7     #SBATCH --tasks-per-node 3
8 jmc 1.11 #SBATCH -x larry,moe,shemp
9 jmc 1.1 #SBATCH -e /home/jm_c/test_svante/output/pgiMth_tst.stderr
10     #SBATCH -o /home/jm_c/test_svante/output/pgiMth_tst.stdout
11     #SBATCH --no-requeue
12    
13 jmc 1.11 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/svante/test_svante_pgi_mth,v 1.10 2020/09/21 20:34:32 jmc Exp $
14 jmc 1.1 # $Name: $
15    
16     if test -f /etc/profile.d/modules.sh ; then . /etc/profile.d/modules.sh ; fi
17     if test -f /etc/profile.d/zz_modules.sh ; then . /etc/profile.d/zz_modules.sh ; fi
18     # Note: added "ulimit -s unlimited" in file "~/.bashrc"
19     # to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI
20    
21     umask 0022
22     #- to get case insensitive "ls" (and order of tested experiments)
23     export LC_ALL="en_US.UTF-8"
24     echo " running on: "`hostname`
25     headNode='svante-login'
26    
27     dNam='svante'
28     HERE="$HOME/test_${dNam}"
29     OUTP="$HERE/output"; SavD="$HERE/send"
30     SEND="ssh $headNode $SavD/mpack"
31 jmc 1.7 #TST_DISK="/net/fs09/d1/jm_c"
32     TST_DISK="/scratch/jm_c"
33 jmc 1.10 #TST_DIR="$TST_DISK/test_${dNam}"
34     TST_DIR="test_${dNam}"
35 jmc 1.6 #- where local copy of code is (need to be consistent with "test_submit_svante"):
36 jmc 1.7 #srcDIR='.'
37     srcDIR=$HERE
38 jmc 1.6 srcCode="MITgcm_today"
39    
40 jmc 1.9 #- following lines are not used here:
41     cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
42     #- which GitHub repository to use and how to access it:
43     git_repo='MITgcm'; git_code='MITgcm' ; git_other='verification_other'
44     #git_repo='altMITgcm'; #git_code='MITgcm66h'
45     #--
46     git_repo="https://github.com/$git_repo"
47     #git_repo="git://github.com/$git_repo"
48     #git_repo="git@github.com:$git_repo"
49 jmc 1.1
50 jmc 1.2 typ='' ; addExp='' ; skipExp=''
51     sfx='pgiMth'
52     skipExp='internal_wave tutorial_advection_in_gyre'
53 jmc 1.1 module add pgi/16.9
54     #module add openmpi
55     module add netcdf
56     OPTFILE="../tools/build_options/linux_amd64_pgf77"
57     #- needed for DIVA with MPI:
58     #export MPI_INC_DIR="/home/software/pgi/16.9/linux86-64/2016/mpi/openmpi-1.10.2/include"
59     options="$typ -mth"
60     export OMP_NUM_THREADS=2
61     export OMP_STACKSIZE=400m
62     #- need this to get "staf":
63     #export PATH="$PATH:$HOME/bin"
64    
65 jmc 1.9 gcmDIR="MITgcm_$sfx"
66 jmc 1.1 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.10 echo "cd $TST_DISK ; pwd (x1)"
75 jmc 1.9 cd $TST_DISK
76 jmc 1.10 pwd ; ls -l
77     if test ! -d $TST_DIR ; then sleep 5 ; pwd ; ls -l ; fi
78 jmc 1.9 if test ! -d $TST_DIR ; then
79     echo -n "Creating a working dir: $TST_DIR ..."
80     #/bin/rm -rf $TST_DIR
81     mkdir $TST_DIR
82     retVal=$?
83     if test "x$retVal" != x0 ; then
84 jmc 1.10 echo " FAIL"
85     echo "Error: unable to make dir: $TST_DIR (err=$retVal ) from $TST_DISK --> Exit"
86 jmc 1.9 exit 1
87 jmc 1.10 else echo " done"
88 jmc 1.9 fi
89     fi
90 jmc 1.10 echo "start from DIR='$TST_DISK/$TST_DIR' at: "`date`
91 jmc 1.9 cd $TST_DIR
92     pwd
93    
94 jmc 1.1 NSLOTS=$SLURM_NTASKS
95     THEDATE=`date`
96     echo '********************************************************************************'
97     echo 'Start job '$THEDATE
98     echo 'NSLOTS = '$NSLOTS
99     echo '======= NODELIST ==============================================================='
100     echo $SLURM_NODELIST
101     cat /etc/redhat-release
102     echo '======= env ===================================================================='
103     env | grep SLURM
104     echo '======= modules ================================================================'
105     module list 2>&1
106     echo '================================================================================'
107    
108     #- check for disk space: relative space (99%) or absolute (10.G):
109     dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
110     if [ $dsp -gt 99 ] ; then
111     #dsp=`df -P . | tail -1 | awk '{print $4}'`
112     #if [ $dsp -le 100000000 ] ; then
113     echo 'Not enough space on this disk => do not run testreport.'
114     df .
115     exit
116     fi
117 jmc 1.9
118 jmc 1.1 if [ $checkOut -eq 1 ] ; then
119     echo "cleaning output from $gcmDIR/verification :"
120     #- remove previous output tar files and tar & remove previous output-dir
121     /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
122     ( cd $gcmDIR/verification
123     listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
124     for dd in $listD
125     do
126     if test -d $dd ; then
127     tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
128 jmc 1.6 retVal=$?
129     if test "x$retVal" != x0 ; then
130 jmc 1.1 echo "ERROR in tar+gzip prev outp-dir: $dd"
131 jmc 1.6 echo " on '"`hostname`"' (return val=$retVal) but continue"
132 jmc 1.1 fi
133     fi
134     done )
135 jmc 1.9 echo "clean tst_2+2 + testreport output"
136 jmc 1.1 ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
137     ( cd $gcmDIR/verification ; ./testreport $typ -clean )
138 jmc 1.9 if test "x$addExp" != x ; then
139     ( cd $gcmDIR/verification
140     listD=`ls -o | grep '^l' | awk '{print $8}' 2> /dev/null`
141     echo " + remove local links: $listD"
142     /bin/rm -f $listD
143     )
144     fi
145     echo "Update $git_code code in dir $gcmDIR :"
146     ( cd $gcmDIR ; git pull ) 2>&1
147 jmc 1.6 retVal=$?
148     if test "x$retVal" != x0 ; then
149 jmc 1.9 echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit"
150 jmc 1.1 exit
151     fi
152 jmc 1.9 echo " and checkout master:"
153     ( cd $gcmDIR ; git checkout master -- . ) 2>&1
154     if test "x$addExp" != x ; then
155     echo "Update $git_other code in dir $gcmDIR/$git_other :"
156     ( cd $gcmDIR/$git_other ; git pull ) 2>&1
157     retVal=$?
158     if test "x$retVal" != x0 ; then
159     echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit"
160     exit
161     fi
162     echo " and checkout master:"
163     ( cd $gcmDIR/$git_other ; git checkout master -- . ) 2>&1
164 jmc 1.1 fi
165     fi
166 jmc 1.9
167 jmc 1.1 if [ $checkOut -eq 2 ] ; then
168     if test -e $gcmDIR ; then
169     echo -n "Removing working copy: $gcmDIR ..."
170     rm -rf $gcmDIR
171     echo " done"
172     fi
173 jmc 1.9 # make a local copy (instead of making a new clone):
174 jmc 1.1 today=`date +%Y%m%d`
175 jmc 1.6 nCount=0; updFile="${srcDIR}/updated_code"
176 jmc 1.1 updDate=0 ; test -f $updFile && updDate=`cat $updFile`
177     while [ $today -gt $updDate ] ; do
178     nCount=`expr $nCount + 1`
179     if [ $nCount -gt 40 ] ; then
180     echo " waiting too long (nCount=$nCount) for updated code"
181     echo " today=$today , updDate=$updDate "
182     ls -l $updFile
183     exit
184     fi
185     sleep 60
186     updDate=0 ; test -f $updFile && updDate=`cat $updFile`
187     done
188     ls -l $updFile
189     echo " waited nCount=$nCount for updated code ($updDate) to copy"
190 jmc 1.6 if test -d $srcDIR/$srcCode ; then
191     echo -n "Make local copy of dir '$srcDIR/$srcCode' to: $gcmDIR ..."
192     cp -pra $srcDIR/$srcCode $gcmDIR
193 jmc 1.1 echo " done"
194 jmc 1.6 else echo " dir: $srcDIR/$srcCode missing => exit" ; exit ; fi
195 jmc 1.1 fi
196    
197     #- change dir to $gcmDIR/verification dir:
198     if test -e $gcmDIR/verification ; then
199     if [ $checkOut -lt 2 ] ; then
200     echo " dir $gcmDIR/verification exist" ; fi
201     cd $gcmDIR/verification
202 jmc 1.9 for exp2add in $addExp ; do
203     test -r $exp2add && /bin/rm -rf $exp2add
204     if test -d ../$git_other/$exp2add ; then
205     echo " add $exp2add link from $git_other"
206     ln -s ../$git_other/$exp2add .
207     if test $exp2add = 'global_oce_cs32' ; then
208     echo " link dir 'other_input/core2_cnyf' in here"
209     ( cd ../${git_other}/${exp2add}
210     test -L core2_cnyf && /bin/rm -f core2_cnyf
211     ln -s ../../../other_input/core2_cnyf . )
212     fi
213     if test $exp2add = 'global_oce_llc90' ; then
214     echo " link dir 'other_input/gael_oce_llc90_input' to 'input_fields'"
215     ( cd ../${git_other}/${exp2add}
216     test -L input_fields && /bin/rm -f input_fields
217     ln -s ../../../other_input/gael_oce_llc90_input input_fields
218     echo " link dirs: 'core2_cnyf' & 'global_oce_input_fields/*' in input_verifs"
219     test ! -e input_verifs && mkdir input_verifs
220     ( cd input_verifs ; /bin/rm -f *
221     ln -s ../../../../other_input/core2_cnyf .
222     ln -s ../../../../other_input/global_oce_input_fields/* . )
223     )
224     fi
225     else
226     echo " missing dir: $git_other/$exp2add"
227     continue
228     fi
229     done
230 jmc 1.1 else
231     echo "no dir: $gcmDIR/verification => exit"
232     exit
233     fi
234    
235     echo ''
236 jmc 1.2 echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
237 jmc 1.5 -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
238 jmc 1.2 ./testreport $options -of $OPTFILE -skd "$skipExp" \
239 jmc 1.5 -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
240 jmc 1.1
241     echo ''
242 jmc 1.2 echo ../tools/do_tst_2+2 \
243 jmc 1.5 -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
244 jmc 1.2 ../tools/do_tst_2+2 \
245 jmc 1.5 -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
246 jmc 1.1

  ViewVC Help
Powered by ViewVC 1.1.22