1 |
jmc |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
jmc |
1.4 |
#PBS -q four-twelve |
4 |
jmc |
1.1 |
#PBS -N tst_mth |
5 |
|
|
#PBS -l nodes=1:ppn=2 |
6 |
jmc |
1.19 |
#PBS -e /home/jmc/test_aces/output/tst_mth.stderr |
7 |
|
|
#PBS -o /home/jmc/test_aces/output/tst_mth.stdout |
8 |
jmc |
1.1 |
|
9 |
jmc |
1.19 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/aces_test_ifc_mth,v 1.18 2011/11/03 17:36:33 jmc Exp $ |
10 |
jmc |
1.1 |
# $Name: $ |
11 |
|
|
|
12 |
jmc |
1.10 |
if test -f /etc/profile.d/modules.sh ; then |
13 |
|
|
. /etc/profile.d/modules.sh |
14 |
|
|
fi |
15 |
jmc |
1.18 |
# 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 |
jmc |
1.10 |
|
22 |
jmc |
1.5 |
umask 0022 |
23 |
jmc |
1.10 |
#- to get case insensitive "ls" (and order of tested experiments) |
24 |
|
|
export LC_ALL="en_US.UTF-8" |
25 |
|
|
|
26 |
jmc |
1.12 |
HERE=$TST_DIR/output |
27 |
jmc |
1.5 |
sfx='mth' |
28 |
jmc |
1.16 |
module add ifc/9.0.021 icc/9.0.021 intel/9.0 |
29 |
jmc |
1.17 |
module add netcdf/3.6.1/icc |
30 |
|
|
OPTFILE="../tools/build_options/linux_ia32_ifort" |
31 |
|
|
options='-j 2 -mth -devel' |
32 |
jmc |
1.16 |
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 |
jmc |
1.1 |
|
38 |
jmc |
1.6 |
checkOut=1 |
39 |
|
|
#options="$options -nc" ; checkOut=0 |
40 |
|
|
#options="$options -q" ; checkOut=0 |
41 |
|
|
|
42 |
jmc |
1.5 |
gcmDIR="MITgcm_$sfx" |
43 |
|
|
cd $TST_DIR |
44 |
jmc |
1.7 |
#- check for disk space: |
45 |
jmc |
1.18 |
#dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
46 |
|
|
#if [ $dsp -gt 99 ] ; then |
47 |
|
|
dsp=`df -P . | tail -1 | awk '{print $4}'` |
48 |
jmc |
1.19 |
if [ $dsp -le 1000000 ] ; then |
49 |
jmc |
1.7 |
echo 'Not enough space on this disk => do not run testreport.' |
50 |
|
|
df . |
51 |
|
|
exit |
52 |
|
|
fi |
53 |
|
|
if [ $checkOut -eq 1 ] ; then |
54 |
|
|
if test -d $gcmDIR/CVS ; then |
55 |
jmc |
1.18 |
/bin/rm -rf $gcmDIR/verification/tr_${dNam}-${sfx}_????????_? |
56 |
jmc |
1.11 |
# ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
57 |
jmc |
1.7 |
echo "cvs update of dir $gcmDIR :" |
58 |
jmc |
1.13 |
( cd $gcmDIR ; cvs -q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d ) 2>&1 |
59 |
jmc |
1.15 |
RETVAL=$? |
60 |
|
|
if test "x$RETVAL" != x0 ; then |
61 |
jmc |
1.16 |
echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit" |
62 |
jmc |
1.15 |
exit |
63 |
|
|
fi |
64 |
jmc |
1.7 |
else |
65 |
|
|
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
66 |
|
|
checkOut=2 |
67 |
|
|
fi |
68 |
|
|
fi |
69 |
|
|
if [ $checkOut -eq 2 ] ; then |
70 |
jmc |
1.6 |
if test -e $gcmDIR ; then |
71 |
|
|
rm -rf $gcmDIR |
72 |
|
|
fi |
73 |
|
|
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P -d $gcmDIR MITgcm > /dev/null 2>&1 |
74 |
|
|
# cvs co MITgcm |
75 |
|
|
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
76 |
|
|
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
77 |
jmc |
1.15 |
fi |
78 |
|
|
|
79 |
|
|
#- change dir to $gcmDIR/verification dir: |
80 |
|
|
if test -e $gcmDIR/verification ; then |
81 |
|
|
if [ $checkOut -lt 2 ] ; then |
82 |
|
|
echo " dir $gcmDIR/verification exist" ; fi |
83 |
|
|
cd $gcmDIR/verification |
84 |
jmc |
1.6 |
else |
85 |
jmc |
1.16 |
echo "no dir: $gcmDIR/verification => exit" |
86 |
jmc |
1.15 |
exit |
87 |
jmc |
1.1 |
fi |
88 |
|
|
|
89 |
jmc |
1.18 |
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx |
90 |
|
|
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx |
91 |
jmc |
1.1 |
|