/[MITgcm]/MITgcm_contrib/test_scripts/engaging/test_engag_op64_adm
ViewVC logotype

Annotation of /MITgcm_contrib/test_scripts/engaging/test_engag_op64_adm

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


Revision 1.25 - (hide annotations) (download)
Mon Oct 31 03:25:50 2022 UTC (2 years, 8 months ago) by jmc
Branch: MAIN
Changes since 1.24: +15 -9 lines
add FWD test using open64 compiler

+ minor improvement for experiments to skip (works if none, single or multiple
  exp. to skip).

1 jmc 1.1 #!/bin/bash
2 jmc 1.13 #SBATCH -J o64Adm_tst
3 jmc 1.1 #SBATCH -p sched_mit_hill
4     #SBATCH --mem-per-cpu 4000
5     #SBATCH -n 6
6     #SBATCH -N 2
7 jmc 1.23 # #SBATCH -x node[360,365]
8 jmc 1.13 #SBATCH -e /home/jm_c/test_engaging/output/o64Adm_tst.stderr
9     #SBATCH -o /home/jm_c/test_engaging/output/o64Adm_tst.stdout
10 jmc 1.19 #SBATCH --no-requeue
11 jmc 1.24 #SBATCH --constraint=centos7
12 jmc 1.1
13 jmc 1.25 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_op64_adm,v 1.24 2022/08/17 15:31:02 jmc Exp $
14 jmc 1.1 # $Name: $
15    
16     if test -f /etc/profile.d/modules.sh ; then
17     . /etc/profile.d/modules.sh
18     fi
19 jmc 1.3 # Note: added "ulimit -s unlimited" in file "~/.bashrc"
20 jmc 1.1 # to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI
21    
22     umask 0022
23     #- to get case insensitive "ls" (and order of tested experiments)
24     export LC_ALL="en_US.UTF-8"
25     echo " running on: "`hostname`
26    
27     dNam='engaging'
28     HERE="$HOME/test_$dNam"
29     OUTP="$HERE/output"; SavD="$HERE/send"
30 jmc 1.22 SEND="ssh eofe8 $SavD/mpack"
31 jmc 1.1 TST_DIR="/pool001/jm_c/test_$dNam"
32 jmc 1.11 tmpFil="/tmp/"`basename $0`".$$"
33     cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
34 jmc 1.13 #- which GitHub repository to use and how to access it:
35 jmc 1.17 git_repo='MITgcm'; git_code='MITgcm' ; git_other='verification_other'
36 jmc 1.11 #git_repo='altMITgcm'; #git_code='MITgcm66h'
37 jmc 1.13 #--
38     git_repo="https://github.com/$git_repo"
39     #git_repo="git://github.com/$git_repo"
40     #git_repo="git@github.com:$git_repo"
41 jmc 1.1
42 jmc 1.21 dblTr=0 ; typ='' ; addExp='' ; skipExp=''
43     sfx='o64Adm'; typ='-adm' ; dblTr=1
44 jmc 1.25 #- currently, no NetCDF => no pkg/profiles
45     skipExp="$skipExp global_oce_biogeo_bling"
46 jmc 1.1 module add open64
47     module add mvapich2/open64/64/2.0b
48     export MPI_INC_DIR="$MPI_HOME/include"
49     OPTFILE="../tools/build_options/linux_amd64_open64"
50     #options="-j 2 -devel -gsl"
51     options="$typ -MPI 6"
52     #export OMP_NUM_THREADS=2
53     #export OMP_SLAVE_STACK_SIZE=400m
54     #export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized
55     ulimit -s unlimited
56     #- need this to get "staf":
57     export PATH="$PATH:$HOME/bin"
58    
59 jmc 1.11 gcmDIR="MITgcm_$sfx"
60 jmc 1.1 dAlt=`date +%d` ; dAlt=`expr $dAlt % 3`
61     if [ $dAlt -eq 1 ] ; then options="$options -fast"
62     else options="$options -devel" ; fi
63 jmc 1.25 if test "x$skipExp" != x ; then skipExp=`echo $skipExp | sed 's/^ *//'` ; fi
64 jmc 1.1
65 jmc 1.3 checkOut=1 ; #options="$options -do"
66 jmc 1.1 #options="$options -nc" ; checkOut=1
67 jmc 1.21 #options="$options -q" ; checkOut=0 ; dblTr=0
68 jmc 1.1
69 jmc 1.11 if test -d $TST_DIR ; then
70     echo "start from TST_DIR='$TST_DIR' at: "`date`
71     else
72     #if test ! -d $TST_DIR ; then mkdir $TST_DIR ; fi
73     #if test ! -d $TST_DIR ; then
74     # echo "ERROR: Can't create directory \"$TST_DIR\""
75     # exit 1
76     #fi
77     #echo "start in new dir TST_DIR='$TST_DIR' at: "`date`
78     echo "ERROR: missing directory \"$TST_DIR\""
79     exit 1
80     fi
81     cd $TST_DIR
82     pwd
83 jmc 1.20 df .
84 jmc 1.11
85 jmc 1.1 NSLOTS=$SLURM_NTASKS
86 jmc 1.2 THEDATE=`date`
87 jmc 1.1 echo '********************************************************************************'
88     echo 'Start job '$THEDATE
89     echo 'NSLOTS = '$NSLOTS
90     echo '======= NODELIST ==============================================================='
91     echo $SLURM_NODELIST
92 jmc 1.4 cat /etc/redhat-release
93 jmc 1.1 echo '======= env ===================================================================='
94 jmc 1.2 env | grep SLURM
95     echo '======= modules ================================================================'
96     module list 2>&1
97 jmc 1.1 echo '================================================================================'
98    
99     #- keep a copy of MPI_MFILE:
100     #cp -p $PBS_NODEFILE $OUTP"/mf_"$sfx
101    
102     #- check for disk space: relative space (99%) or absolute (10.G):
103     dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
104     if [ $dsp -gt 99 ] ; then
105     #dsp=`df -P . | tail -1 | awk '{print $4}'`
106     #if [ $dsp -le 100000000 ] ; then
107     echo 'Not enough space on this disk => do not run testreport.'
108     df .
109     exit
110     fi
111     if [ $checkOut -eq 1 ] ; then
112 jmc 1.15 if test ! -e $gcmDIR/.git/config ; then
113     echo "no file: $gcmDIR/.git/config => try to download a fresh clone"
114     checkOut=2
115     fi
116     if test "x$addExp" != x ; then
117     if test ! -e $gcmDIR/$git_other/.git/config ; then
118     echo "no file: $gcmDIR/$git_other/.git/config => try a fresh clone"
119     checkOut=2
120     fi
121     fi
122     fi
123     if [ $checkOut -eq 1 ] ; then
124 jmc 1.1 echo "cleaning output from $gcmDIR/verification :"
125     #- remove previous output tar files and tar & remove previous output-dir
126     /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
127     ( cd $gcmDIR/verification
128     listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
129     for dd in $listD
130     do
131     if test -d $dd ; then
132     tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
133 jmc 1.11 retVal=$?
134     if test "x$retVal" != x0 ; then
135 jmc 1.1 echo "ERROR in tar+gzip prev outp-dir: $dd"
136 jmc 1.11 echo " on '"`hostname`"' (return val=$retVal) but continue"
137 jmc 1.1 fi
138     fi
139     done )
140     # ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
141     ( cd $gcmDIR/verification ; ./testreport $typ -clean )
142 jmc 1.15 if test "x$addExp" != x ; then
143     ( cd $gcmDIR/verification
144     listD=`ls -o | grep '^l' | awk '{print $8}' 2> /dev/null`
145     echo " + remove local links: $listD"
146     /bin/rm -f $listD
147     )
148     fi
149 jmc 1.17 echo "Update $git_code code in dir $gcmDIR :"
150 jmc 1.14 ( cd $gcmDIR ; git pull ) 2>&1
151 jmc 1.11 retVal=$?
152     if test "x$retVal" != x0 ; then
153     echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit"
154 jmc 1.1 exit
155     fi
156 jmc 1.14 echo " and checkout master:"
157     ( cd $gcmDIR ; git checkout master -- . ) 2>&1
158 jmc 1.15 if test "x$addExp" != x ; then
159     echo "Update $git_other code in dir $gcmDIR/$git_other :"
160     ( cd $gcmDIR/$git_other ; git pull ) 2>&1
161     retVal=$?
162     if test "x$retVal" != x0 ; then
163     echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit"
164     exit
165     fi
166     echo " and checkout master:"
167     ( cd $gcmDIR/$git_other ; git checkout master -- . ) 2>&1
168 jmc 1.1 fi
169     fi
170 jmc 1.17
171 jmc 1.1 if [ $checkOut -eq 2 ] ; then
172     if test -e $gcmDIR ; then
173 jmc 1.3 echo -n "Removing working copy: $gcmDIR ..."
174     rm -rf $gcmDIR
175     echo " done"
176 jmc 1.1 fi
177 jmc 1.17 echo "Make a clone of $git_code from repo: $git_repo ..."
178 jmc 1.13 git clone $git_repo/${git_code}.git $gcmDIR 2> $tmpFil
179 jmc 1.11 retVal=$?
180     if test $retVal = 0 ; then
181     echo ' done' ; rm -f $tmpFil
182     else
183     echo " Error: 'git clone' returned: $retVal"
184     cat $tmpFil ; rm -f $tmpFil
185 jmc 1.1 exit
186 jmc 1.11 fi
187 jmc 1.15 if test "x$addExp" != x ; then
188     echo "Make a clone of $git_other from repo: $git_repo ..."
189     ( cd $gcmDIR ; git clone $git_repo/${git_other}.git 2> $tmpFil )
190     retVal=$?
191     if test $retVal = 0 ; then
192     echo ' done' ; rm -f $tmpFil
193     else
194     echo " Error: 'git clone' returned: $retVal"
195     cat $tmpFil ; rm -f $tmpFil
196     exit
197     fi
198     fi
199 jmc 1.1 if test -d $gcmDIR/verification ; then
200     /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
201     /usr/bin/find $gcmDIR -type f | xargs chmod g+r
202     fi
203     fi
204    
205 jmc 1.17 #- change dir to $gcmDIR/verification + add link for additional experiments:
206 jmc 1.1 if test -e $gcmDIR/verification ; then
207     if [ $checkOut -lt 2 ] ; then
208     echo " dir $gcmDIR/verification exist" ; fi
209     cd $gcmDIR/verification
210 jmc 1.7 for exp2add in $addExp ; do
211 jmc 1.15 test -r $exp2add && /bin/rm -rf $exp2add
212     if test -d ../$git_other/$exp2add ; then
213     echo " add $exp2add link from $git_other"
214     ln -s ../$git_other/$exp2add .
215 jmc 1.7 else
216 jmc 1.15 echo " missing dir: $git_other/$exp2add"
217     continue
218 jmc 1.7 fi
219     done
220 jmc 1.1 else
221     echo "no dir: $gcmDIR/verification => exit"
222     exit
223     fi
224    
225 jmc 1.21 if [ $dblTr -eq 1 ] ; then
226 jmc 1.8 echo ''
227 jmc 1.25 #- 1) just compile ("-nr")
228     echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
229     -odir ${dNam}-$sfx -nr
230     ./testreport $options -of $OPTFILE -skd "$skipExp" \
231     -odir ${dNam}-$sfx -nr
232 jmc 1.21 options="$options -q"
233     fi
234    
235     echo ''
236 jmc 1.25 #- 2) run and report results ; also finish to compile those who failed
237     echo ./testreport $options -of $OPTFILE -skd \'$skipExp\' \
238     -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
239     ./testreport $options -of $OPTFILE -skd "$skipExp" \
240     -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
241 jmc 1.8
242     # echo ''
243 jmc 1.25 #- 3) test restart and report results
244 jmc 1.8 # echo ../tools/do_tst_2+2 -mpi \
245 jmc 1.10 # -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
246 jmc 1.8 # ../tools/do_tst_2+2 -mpi \
247 jmc 1.10 # -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
248 jmc 1.1
249 jmc 1.24 # exit 0
250     echo -n "-- SLURM_TASKS_PER_NODE= $SLURM_TASKS_PER_NODE ; " >> ${OUTP}/tracer_adj.log
251     date >> ${OUTP}/tracer_adj.log
252     grep 'My Processor Name' tutorial_tracer_adjsens/run/STDOUT.000? \
253     | sed 's/tutorial_tracer_adjsens\// /' >> ${OUTP}/tracer_adj.log
254     grep 'My Processor Name' tutorial_tracer_adjsens/tr_run.som81/STDOUT.000? \
255     | sed 's/tutorial_tracer_adjsens\// /' >> ${OUTP}/tracer_adj.log

  ViewVC Help
Powered by ViewVC 1.1.22