1 |
jmc |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
jmc |
1.7 |
#PBS -q one |
4 |
jmc |
1.1 |
#PBS -N tst_tuv |
5 |
|
|
#PBS -l nodes=1:ppn=2 |
6 |
jmc |
1.9 |
#PBS -e /data/jm_c/test_acesgrid/output/tst_tuv.stderr |
7 |
|
|
#PBS -o /data/jm_c/test_acesgrid/output/tst_tuv.stdout |
8 |
jmc |
1.1 |
|
9 |
jmc |
1.11 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/test_aces_op64_tuv,v 1.10 2013/03/05 16:47:21 jmc Exp $ |
10 |
jmc |
1.1 |
# $Name: $ |
11 |
|
|
|
12 |
|
|
if test -f /etc/profile.d/modules.sh ; then |
13 |
|
|
. /etc/profile.d/modules.sh |
14 |
|
|
fi |
15 |
|
|
# Note: added "ulimit -s unlimited" in file "~/.tcshrc" |
16 |
|
|
# to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI |
17 |
|
|
|
18 |
jmc |
1.5 |
dNam='acesgrid' |
19 |
jmc |
1.9 |
TST_DIR="/data/jm_c/test_$dNam" |
20 |
jmc |
1.5 |
echo "start from TST_DIR='$TST_DIR' at: "`date` |
21 |
|
|
|
22 |
jmc |
1.1 |
umask 0022 |
23 |
|
|
#- to get case insensitive "ls" (and order of tested experiments) |
24 |
|
|
export LC_ALL="en_US.UTF-8" |
25 |
|
|
|
26 |
|
|
HERE=$TST_DIR/output |
27 |
|
|
sfx='tuv' |
28 |
|
|
module add open64 |
29 |
|
|
OPTFILE="../tools/build_options/linux_amd64_open64" |
30 |
|
|
options="-j 2 -devel" |
31 |
|
|
#options="-j 2 -mth -gsl" |
32 |
|
|
#export OMP_NUM_THREADS=2 |
33 |
|
|
#export OMP_SLAVE_STACK_SIZE=400m |
34 |
|
|
#export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized |
35 |
|
|
ulimit -s unlimited |
36 |
jmc |
1.6 |
#- need this to get "staf": |
37 |
|
|
export PATH="$PATH:$HOME/bin" |
38 |
jmc |
1.1 |
|
39 |
jmc |
1.6 |
|
40 |
|
|
dAlt=`date +%d` ; dAlt=`expr $dAlt % 3` |
41 |
|
|
if [ $dAlt -eq 1 ] ; then options="-adm -do -devel" ; fi |
42 |
jmc |
1.3 |
|
43 |
jmc |
1.4 |
#- keep a copy of MPI_MFILE: |
44 |
|
|
cp -p $PBS_NODEFILE $HERE"/mf_"$sfx |
45 |
|
|
|
46 |
jmc |
1.1 |
checkOut=1 |
47 |
|
|
#options="$options -nc" ; checkOut=0 |
48 |
|
|
#options="$options -q" ; checkOut=0 |
49 |
|
|
|
50 |
jmc |
1.11 |
addExp=0 |
51 |
|
|
cvsArg="-d :pserver:cvsanon@mitgcm.org:/u/gcmpack" |
52 |
jmc |
1.1 |
gcmDIR="MITgcm_$sfx" |
53 |
|
|
cd $TST_DIR |
54 |
jmc |
1.10 |
#- check for disk space: relative space (99%) or absolute (10.G): |
55 |
|
|
#dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
56 |
|
|
#if [ $dsp -gt 99 ] ; then |
57 |
|
|
dsp=`df -P . | tail -1 | awk '{print $4}'` |
58 |
|
|
if [ $dsp -le 10000000 ] ; then |
59 |
jmc |
1.1 |
echo 'Not enough space on this disk => do not run testreport.' |
60 |
|
|
df . |
61 |
|
|
exit |
62 |
|
|
fi |
63 |
|
|
if [ $checkOut -eq 1 ] ; then |
64 |
|
|
if test -d $gcmDIR/CVS ; then |
65 |
jmc |
1.8 |
#- remove previous output tar files and tar & remove previous output-dir |
66 |
|
|
/bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz |
67 |
|
|
( cd $gcmDIR/verification |
68 |
jmc |
1.9 |
listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null` |
69 |
jmc |
1.8 |
for dd in $listD |
70 |
|
|
do |
71 |
|
|
if test -d $dd ; then |
72 |
|
|
tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd |
73 |
|
|
RETVAL=$? |
74 |
|
|
if test "x$RETVAL" != x0 ; then |
75 |
|
|
echo "ERROR in tar+gzip prev outp-dir: $dd" |
76 |
|
|
echo " on '"`hostname`"' (return val=$RETVAL) but continue" |
77 |
|
|
fi |
78 |
|
|
fi |
79 |
|
|
done ) |
80 |
jmc |
1.1 |
# ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
81 |
|
|
echo "cvs update of dir $gcmDIR :" |
82 |
jmc |
1.11 |
( cd $gcmDIR ; cvs -q $cvsArg update -P -d ) 2>&1 |
83 |
jmc |
1.1 |
RETVAL=$? |
84 |
|
|
if test "x$RETVAL" != x0 ; then |
85 |
jmc |
1.4 |
echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit" |
86 |
jmc |
1.1 |
exit |
87 |
|
|
fi |
88 |
|
|
else |
89 |
|
|
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
90 |
|
|
checkOut=2 |
91 |
|
|
fi |
92 |
|
|
fi |
93 |
|
|
if [ $checkOut -eq 2 ] ; then |
94 |
|
|
if test -e $gcmDIR ; then |
95 |
|
|
rm -rf $gcmDIR |
96 |
|
|
fi |
97 |
|
|
# cvs co MITgcm |
98 |
jmc |
1.11 |
cvs $cvsArg co -P -d $gcmDIR MITgcm > /dev/null 2>&1 |
99 |
|
|
if [ $addExp -ge 1 ]; then |
100 |
|
|
echo " add dir: offline_cheapaml (from Contrib:verification_other)" |
101 |
|
|
( cd $gcmDIR/verification ; cvs $cvsArg co -P -d offline_cheapaml \ |
102 |
|
|
MITgcm_contrib/verification_other/offline_cheapaml > /dev/null 2>&1 ) |
103 |
|
|
fi |
104 |
jmc |
1.1 |
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
105 |
|
|
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
106 |
|
|
fi |
107 |
|
|
|
108 |
|
|
#- change dir to $gcmDIR/verification dir: |
109 |
|
|
if test -e $gcmDIR/verification ; then |
110 |
jmc |
1.2 |
if [ $checkOut -lt 2 ] ; then |
111 |
|
|
echo " dir $gcmDIR/verification exist" ; fi |
112 |
jmc |
1.1 |
cd $gcmDIR/verification |
113 |
|
|
else |
114 |
jmc |
1.3 |
echo "no dir: $gcmDIR/verification => exit" |
115 |
jmc |
1.1 |
exit |
116 |
|
|
fi |
117 |
|
|
|
118 |
jmc |
1.5 |
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx |
119 |
|
|
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx |
120 |
jmc |
1.1 |
|
121 |
|
|
#echo '' |
122 |
jmc |
1.5 |
#echo ../tools/do_tst_2+2 -o ${dNam}-$sfx -a NONE |
123 |
|
|
#../tools/do_tst_2+2 -o ${dNam}-$sfx -a NONE |
124 |
jmc |
1.1 |
|