1 |
#!/bin/bash |
2 |
# |
3 |
#PBS -q one |
4 |
#PBS -N tst_ifc |
5 |
#PBS -l nodes=1:ppn=6 |
6 |
#PBS -e /data/jm_c/test_acesgrid/output/tst_ifc.stderr |
7 |
#PBS -o /data/jm_c/test_acesgrid/output/tst_ifc.stdout |
8 |
|
9 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/test_aces_ifc_mpi,v 1.2 2013/11/24 13:37:00 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='acesgrid' |
19 |
TST_DIR="/data/jm_c/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='ifc' |
28 |
export MODULEPATH="/mit/jahn/usr/modulefiles:${MODULEPATH}" |
29 |
module add intel |
30 |
OPTFILE="../tools/build_options/linux_amd64_ifort11" |
31 |
options="-j 2 -MPI 6" |
32 |
#- need this to get "staf": |
33 |
export PATH="$PATH:$HOME/bin" |
34 |
|
35 |
dAlt=`date +%j` ; dAlt=`expr $dAlt % 2` |
36 |
#if [ $dAlt -eq 1 ] ; then options="$options -fast" ; fi |
37 |
|
38 |
#- keep a copy of MPI_MFILE: |
39 |
cp -p $PBS_NODEFILE $HERE"/mf_"$sfx |
40 |
|
41 |
checkOut=1 |
42 |
#options="$options -nc" ; checkOut=0 |
43 |
#options="$options -q" ; checkOut=0 |
44 |
|
45 |
addExp=0 |
46 |
cvsArg="-d :pserver:cvsanon@mitgcm.org:/u/gcmpack" |
47 |
gcmDIR="MITgcm_$sfx" |
48 |
cd $TST_DIR |
49 |
#- check for disk space: relative space (99%) or absolute (10.G): |
50 |
#dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
51 |
#if [ $dsp -gt 99 ] ; then |
52 |
dsp=`df -P . | tail -1 | awk '{print $4}'` |
53 |
if [ $dsp -le 10000000 ] ; then |
54 |
echo 'Not enough space on this disk => do not run testreport.' |
55 |
df . |
56 |
exit |
57 |
fi |
58 |
if [ $checkOut -eq 1 ] ; then |
59 |
if test -d $gcmDIR/CVS ; then |
60 |
#- remove previous output tar files and tar & remove previous output-dir |
61 |
/bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz |
62 |
( cd $gcmDIR/verification |
63 |
listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null` |
64 |
for dd in $listD |
65 |
do |
66 |
if test -d $dd ; then |
67 |
tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd |
68 |
RETVAL=$? |
69 |
if test "x$RETVAL" != x0 ; then |
70 |
echo "ERROR in tar+gzip prev outp-dir: $dd" |
71 |
echo " on '"`hostname`"' (return val=$RETVAL) but continue" |
72 |
fi |
73 |
fi |
74 |
done ) |
75 |
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
76 |
echo ' remove all Makefile_syntax and do "cvs update -P -d"' |
77 |
( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax ) |
78 |
# echo "cvs update of dir $gcmDIR :" |
79 |
( cd $gcmDIR ; cvs -q $cvsArg update -P -d ) 2>&1 |
80 |
RETVAL=$? |
81 |
if test "x$RETVAL" != x0 ; then |
82 |
echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit" |
83 |
exit |
84 |
fi |
85 |
else |
86 |
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
87 |
checkOut=2 |
88 |
fi |
89 |
fi |
90 |
if [ $checkOut -eq 2 ] ; then |
91 |
if test -e $gcmDIR ; then |
92 |
rm -rf $gcmDIR |
93 |
fi |
94 |
# cvs co MITgcm |
95 |
cvs $cvsArg co -P -d $gcmDIR MITgcm > /dev/null 2>&1 |
96 |
if [ $addExp -ge 1 ]; then |
97 |
echo " add dir: offline_cheapaml (from Contrib:verification_other)" |
98 |
( cd $gcmDIR/verification ; cvs $cvsArg co -P -d offline_cheapaml \ |
99 |
MITgcm_contrib/verification_other/offline_cheapaml > /dev/null 2>&1 ) |
100 |
fi |
101 |
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
102 |
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
103 |
fi |
104 |
|
105 |
#- change dir to $gcmDIR/verification dir: |
106 |
if test -e $gcmDIR/verification ; then |
107 |
if [ $checkOut -lt 2 ] ; then |
108 |
echo " dir $gcmDIR/verification exist" ; fi |
109 |
cd $gcmDIR/verification |
110 |
else |
111 |
echo "no dir: $gcmDIR/verification => exit" |
112 |
exit |
113 |
fi |
114 |
|
115 |
SavD="$HOME/test_$dNam/send" |
116 |
SEND="ssh login $SavD/mpack" |
117 |
|
118 |
if [ $dAlt -eq 1 ] ; then |
119 |
options="$options -fast" |
120 |
|
121 |
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
122 |
-send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
123 |
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
124 |
-send "$SEND" -sd $SavD -a jmc@mitgcm.org |
125 |
|
126 |
echo '' |
127 |
echo ../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
128 |
-send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
129 |
../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
130 |
-send "$SEND" -sd $SavD -a jmc@mitgcm.org |
131 |
|
132 |
else |
133 |
options="$options -devel" |
134 |
|
135 |
echo ./testreport $options -of $OPTFILE \ |
136 |
-repl_mk do_make_syntax.sh -obj -dd |
137 |
./testreport $options -of $OPTFILE \ |
138 |
-repl_mk do_make_syntax.sh -obj -dd 2>&1 |
139 |
|
140 |
echo '' |
141 |
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
142 |
-q -send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
143 |
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
144 |
-q -send "$SEND" -sd $SavD -a jmc@mitgcm.org |
145 |
|
146 |
echo '' |
147 |
echo ../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
148 |
-send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
149 |
../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
150 |
-send "$SEND" -sd $SavD -a jmc@mitgcm.org |
151 |
|
152 |
fi |