1 |
jmc |
1.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_adm_mpi,v 1.14 2013/09/23 15:44:19 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 |
|
|
#- with mpich2, needs module torque to run |
31 |
|
|
module add torque |
32 |
|
|
OPTFILE="../tools/build_options/linux_amd64_ifort11" |
33 |
|
|
options="-j 2 -MPI 6" |
34 |
|
|
#- need this to get "staf": |
35 |
|
|
#export PATH="$PATH:$HOME/bin" |
36 |
|
|
|
37 |
|
|
dAlt=`date +%j` ; dAlt=`expr $dAlt % 2` |
38 |
|
|
if [ $dAlt -eq 1 ] ; then options="$options -fast" ; fi |
39 |
|
|
|
40 |
|
|
#- keep a copy of MPI_MFILE: |
41 |
|
|
cp -p $PBS_NODEFILE $HERE"/mf_"$sfx |
42 |
|
|
|
43 |
|
|
checkOut=1 |
44 |
|
|
#options="$options -nc" ; checkOut=0 |
45 |
|
|
#options="$options -q" ; checkOut=0 |
46 |
|
|
|
47 |
|
|
addExp=0 |
48 |
|
|
cvsArg="-d :pserver:cvsanon@mitgcm.org:/u/gcmpack" |
49 |
|
|
gcmDIR="MITgcm_$sfx" |
50 |
|
|
cd $TST_DIR |
51 |
|
|
#- check for disk space: relative space (99%) or absolute (10.G): |
52 |
|
|
#dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
53 |
|
|
#if [ $dsp -gt 99 ] ; then |
54 |
|
|
dsp=`df -P . | tail -1 | awk '{print $4}'` |
55 |
|
|
if [ $dsp -le 10000000 ] ; then |
56 |
|
|
echo 'Not enough space on this disk => do not run testreport.' |
57 |
|
|
df . |
58 |
|
|
exit |
59 |
|
|
fi |
60 |
|
|
if [ $checkOut -eq 1 ] ; then |
61 |
|
|
if test -d $gcmDIR/CVS ; then |
62 |
|
|
#- remove previous output tar files and tar & remove previous output-dir |
63 |
|
|
/bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz |
64 |
|
|
( cd $gcmDIR/verification |
65 |
|
|
listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null` |
66 |
|
|
for dd in $listD |
67 |
|
|
do |
68 |
|
|
if test -d $dd ; then |
69 |
|
|
tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd |
70 |
|
|
RETVAL=$? |
71 |
|
|
if test "x$RETVAL" != x0 ; then |
72 |
|
|
echo "ERROR in tar+gzip prev outp-dir: $dd" |
73 |
|
|
echo " on '"`hostname`"' (return val=$RETVAL) but continue" |
74 |
|
|
fi |
75 |
|
|
fi |
76 |
|
|
done ) |
77 |
|
|
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
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 |
|
|
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
119 |
|
|
-send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
120 |
|
|
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
121 |
|
|
-send "$SEND" -sd $SavD -a jmc@mitgcm.org |
122 |
|
|
|
123 |
|
|
echo '' |
124 |
|
|
echo ../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
125 |
|
|
-send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
126 |
|
|
../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
127 |
|
|
-send "$SEND" -sd $SavD -a jmc@mitgcm.org |
128 |
|
|
|