1 |
#!/bin/bash |
2 |
# |
3 |
#PBS -q four-twelve |
4 |
#PBS -N tst_mth |
5 |
#PBS -l nodes=1:ppn=2 |
6 |
#PBS -e /home/jmc/test_aces/output/tst_mth.stderr |
7 |
#PBS -o /home/jmc/test_aces/output/tst_mth.stdout |
8 |
|
9 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/aces_test_ifc_mth,v 1.26 2013/06/13 22:01:34 jmc Exp $ |
10 |
# $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 "~/.bashrc" |
16 |
# to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI |
17 |
|
18 |
dNam='aces' |
19 |
TST_DIR="$HOME/test_$dNam" |
20 |
echo "start from TST_DIR='$TST_DIR' at: "`date` |
21 |
|
22 |
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='mth' |
28 |
module add ifc/9.0.021 icc/9.0.021 intel/9.0 |
29 |
module add netcdf/3.6.1/icc |
30 |
OPTFILE="../tools/build_options/linux_ia32_ifort" |
31 |
options='-j 2 -mth -devel' |
32 |
export OMP_NUM_THREADS=2 |
33 |
export KMP_STACKSIZE=400m |
34 |
|
35 |
#- keep a copy of MPI_MFILE: |
36 |
cp -p $PBS_NODEFILE $HERE"/mf_"$sfx |
37 |
|
38 |
checkOut=1 ; #options="$options -do" |
39 |
#options="$options -nc" ; checkOut=0 |
40 |
#options="$options -q" ; checkOut=0 |
41 |
|
42 |
addExp=0 |
43 |
cvsArg="-d :pserver:cvsanon@mitgcm.org:/u/gcmpack" |
44 |
gcmDIR="MITgcm_$sfx" |
45 |
cd $TST_DIR |
46 |
#- check for disk space: relative space (99%) or absolute (1.G): |
47 |
#dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
48 |
#if [ $dsp -gt 99 ] ; then |
49 |
dsp=`df -P . | tail -1 | awk '{print $4}'` |
50 |
if [ $dsp -le 1000000 ] ; then |
51 |
echo 'Not enough space on this disk => do not run testreport.' |
52 |
df . |
53 |
exit |
54 |
fi |
55 |
if [ $checkOut -eq 1 ] ; then |
56 |
if test -d $gcmDIR/CVS ; then |
57 |
#- remove previous output tar files and tar & remove previous output-dir |
58 |
/bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz |
59 |
( cd $gcmDIR/verification |
60 |
listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null` |
61 |
for dd in $listD |
62 |
do |
63 |
if test -d $dd ; then |
64 |
tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd |
65 |
RETVAL=$? |
66 |
if test "x$RETVAL" != x0 ; then |
67 |
echo "ERROR in tar+gzip prev outp-dir: $dd" |
68 |
echo " on '"`hostname`"' (return val=$RETVAL) but continue" |
69 |
fi |
70 |
fi |
71 |
done ) |
72 |
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
73 |
#- clean-up previous TAF output temp dir (generated on old system like here) |
74 |
# ( cd $gcmDIR/verification ; /bin/rm -rf */build/PaxHeaders.[0-9]* ) |
75 |
echo "cvs update of dir $gcmDIR :" |
76 |
( cd $gcmDIR ; cvs -q $cvsArg update -P -d ) 2>&1 |
77 |
RETVAL=$? |
78 |
if test "x$RETVAL" != x0 ; then |
79 |
echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit" |
80 |
exit |
81 |
fi |
82 |
else |
83 |
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
84 |
checkOut=2 |
85 |
fi |
86 |
fi |
87 |
if [ $checkOut -eq 2 ] ; then |
88 |
if test -e $gcmDIR ; then |
89 |
rm -rf $gcmDIR |
90 |
fi |
91 |
# cvs co MITgcm |
92 |
cvs $cvsArg co -P -d $gcmDIR MITgcm > /dev/null 2>&1 |
93 |
if [ $addExp -ge 1 ]; then |
94 |
echo " add dir: offline_cheapaml (from Contrib:verification_other)" |
95 |
( cd $gcmDIR/verification ; cvs $cvsArg co -P -d offline_cheapaml \ |
96 |
MITgcm_contrib/verification_other/offline_cheapaml > /dev/null 2>&1 ) |
97 |
fi |
98 |
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
99 |
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
100 |
fi |
101 |
|
102 |
#- change dir to $gcmDIR/verification dir: |
103 |
if test -e $gcmDIR/verification ; then |
104 |
if [ $checkOut -lt 2 ] ; then |
105 |
echo " dir $gcmDIR/verification exist" ; fi |
106 |
cd $gcmDIR/verification |
107 |
else |
108 |
echo "no dir: $gcmDIR/verification => exit" |
109 |
exit |
110 |
fi |
111 |
|
112 |
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx |
113 |
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx |
114 |
|
115 |
echo '' |
116 |
echo ../tools/do_tst_2+2 -o ${dNam}-$sfx -a NONE |
117 |
../tools/do_tst_2+2 -o ${dNam}-$sfx -a NONE |