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