1 |
jmc |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
|
|
#PBS -q four-twelve |
4 |
|
|
#PBS -N tst_tuv |
5 |
|
|
#PBS -l nodes=1:ppn=2 |
6 |
jmc |
1.18 |
#PBS -e /home/jmc/test_aces/output/tst_tuv.stderr |
7 |
|
|
#PBS -o /home/jmc/test_aces/output/tst_tuv.stdout |
8 |
jmc |
1.8 |
|
9 |
jmc |
1.23 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/aces_test_op64_tuv,v 1.22 2013/01/25 23:26:00 jmc Exp $ |
10 |
jmc |
1.1 |
# $Name: $ |
11 |
|
|
|
12 |
jmc |
1.8 |
# ACES-grid PBS-batch script: test using open64 + "Trap Un-initialised Var." option |
13 |
|
|
|
14 |
jmc |
1.1 |
if test -f /etc/profile.d/modules.sh ; then |
15 |
|
|
. /etc/profile.d/modules.sh |
16 |
|
|
fi |
17 |
jmc |
1.17 |
# Note: added "ulimit -s unlimited" in file "~/.bashrc" |
18 |
|
|
# to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI |
19 |
|
|
|
20 |
|
|
dNam='aces' |
21 |
|
|
TST_DIR="$HOME/test_$dNam" |
22 |
|
|
echo "start from TST_DIR='$TST_DIR' at: "`date` |
23 |
jmc |
1.2 |
|
24 |
jmc |
1.7 |
umask 0022 |
25 |
|
|
#- to get case insensitive "ls" (and order of tested experiments) |
26 |
|
|
export LC_ALL="en_US.UTF-8" |
27 |
|
|
|
28 |
jmc |
1.10 |
HERE=$TST_DIR/output |
29 |
jmc |
1.2 |
sfx='tuv' |
30 |
jmc |
1.15 |
module add open64 |
31 |
jmc |
1.16 |
export NETCDF_ROOT='/usr/local/pkg/netcdf/netcdf-3.5.1/g77' |
32 |
|
|
OPTFILE="../tools/build_options/linux_ia32_open64" |
33 |
jmc |
1.21 |
options='-j 2 -devel -gsl' |
34 |
jmc |
1.15 |
export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized |
35 |
|
|
|
36 |
|
|
#- keep a copy of MPI_MFILE: |
37 |
|
|
cp -p $PBS_NODEFILE $HERE"/mf_"$sfx |
38 |
jmc |
1.1 |
|
39 |
jmc |
1.21 |
checkOut=1 ; options="$options -do" |
40 |
jmc |
1.3 |
#options="$options -nc" ; checkOut=0 |
41 |
|
|
#options="$options -q" ; checkOut=0 |
42 |
|
|
|
43 |
jmc |
1.2 |
gcmDIR="MITgcm_$sfx" |
44 |
|
|
cd $TST_DIR |
45 |
jmc |
1.23 |
#- check for disk space: relative space (99%) or absolute (1.G): |
46 |
jmc |
1.17 |
#dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
47 |
|
|
#if [ $dsp -gt 99 ] ; then |
48 |
|
|
dsp=`df -P . | tail -1 | awk '{print $4}'` |
49 |
jmc |
1.18 |
if [ $dsp -le 1000000 ] ; then |
50 |
jmc |
1.4 |
echo 'Not enough space on this disk => do not run testreport.' |
51 |
|
|
df . |
52 |
|
|
exit |
53 |
|
|
fi |
54 |
|
|
if [ $checkOut -eq 1 ] ; then |
55 |
|
|
if test -d $gcmDIR/CVS ; then |
56 |
jmc |
1.20 |
#- remove previous output tar files and tar & remove previous output-dir |
57 |
|
|
/bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz |
58 |
|
|
( cd $gcmDIR/verification |
59 |
jmc |
1.22 |
listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null` |
60 |
jmc |
1.20 |
for dd in $listD |
61 |
|
|
do |
62 |
|
|
if test -d $dd ; then |
63 |
|
|
tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd |
64 |
|
|
RETVAL=$? |
65 |
|
|
if test "x$RETVAL" != x0 ; then |
66 |
|
|
echo "ERROR in tar+gzip prev outp-dir: $dd" |
67 |
|
|
echo " on '"`hostname`"' (return val=$RETVAL) but continue" |
68 |
|
|
fi |
69 |
|
|
fi |
70 |
|
|
done ) |
71 |
jmc |
1.9 |
# ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
72 |
jmc |
1.4 |
echo "cvs update of dir $gcmDIR :" |
73 |
jmc |
1.11 |
( cd $gcmDIR ; cvs -q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d ) 2>&1 |
74 |
jmc |
1.14 |
RETVAL=$? |
75 |
|
|
if test "x$RETVAL" != x0 ; then |
76 |
jmc |
1.15 |
echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit" |
77 |
jmc |
1.14 |
exit |
78 |
|
|
fi |
79 |
jmc |
1.4 |
else |
80 |
|
|
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
81 |
|
|
checkOut=2 |
82 |
|
|
fi |
83 |
|
|
fi |
84 |
|
|
if [ $checkOut -eq 2 ] ; then |
85 |
jmc |
1.3 |
if test -e $gcmDIR ; then |
86 |
|
|
rm -rf $gcmDIR |
87 |
|
|
fi |
88 |
jmc |
1.13 |
# cvs co MITgcm |
89 |
jmc |
1.3 |
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P -d $gcmDIR MITgcm > /dev/null 2>&1 |
90 |
|
|
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
91 |
|
|
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
92 |
jmc |
1.14 |
fi |
93 |
|
|
|
94 |
|
|
#- change dir to $gcmDIR/verification dir: |
95 |
|
|
if test -e $gcmDIR/verification ; then |
96 |
|
|
if [ $checkOut -lt 2 ] ; then |
97 |
|
|
echo " dir $gcmDIR/verification exist" ; fi |
98 |
|
|
cd $gcmDIR/verification |
99 |
jmc |
1.3 |
else |
100 |
jmc |
1.15 |
echo "no dir: $gcmDIR/verification => exit" |
101 |
jmc |
1.14 |
exit |
102 |
jmc |
1.1 |
fi |
103 |
|
|
|
104 |
jmc |
1.17 |
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx |
105 |
|
|
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx |
106 |
jmc |
1.1 |
|
107 |
jmc |
1.13 |
#echo -n 'run ./testreport -clean ...' |
108 |
|
|
#./testreport -clean > /dev/null 2>&1 |
109 |
|
|
#echo -n ' done at: ' ; date |
110 |
jmc |
1.8 |
|