1 |
#!/bin/bash |
2 |
# |
3 |
#PBS -q one |
4 |
#PBS -N tst_mth |
5 |
#PBS -l nodes=1:ppn=2 |
6 |
#PBS -e /mit/jm_c/test_acesgrid/output/tst_mth.stderr |
7 |
#PBS -o /mit/jm_c/test_acesgrid/output/tst_mth.stdout |
8 |
|
9 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/test_aces_path_mth,v 1.15 2014/05/08 18:44:03 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 |
umask 0022 |
19 |
#- to get case insensitive "ls" (and order of tested experiments) |
20 |
export LC_ALL="en_US.UTF-8" |
21 |
echo " running on: "`hostname` |
22 |
|
23 |
dNam='acesgrid' |
24 |
HERE="$HOME/test_$dNam" |
25 |
OUTP="$HERE/output"; SavD="$HERE/send" |
26 |
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 |
|
41 |
sfx='mth' |
42 |
addExp='' |
43 |
module add ekopath |
44 |
OPTFILE="../tools/build_options/linux_amd64_pathf90" |
45 |
options="-j 2 -mth" |
46 |
export OMP_NUM_THREADS=2 |
47 |
export PSC_OMP_STACK_SIZE=400m |
48 |
ulimit -s unlimited |
49 |
|
50 |
dAlt=`date +%d` ; dAlt=`expr $dAlt % 3` |
51 |
if [ $dAlt -eq 1 ] ; then options="$options -fast" ; fi |
52 |
|
53 |
checkOut=2 |
54 |
#options="$options -nc" ; checkOut=1 |
55 |
#options="$options -q" ; checkOut=0 |
56 |
|
57 |
#- keep a copy of MPI_MFILE: |
58 |
cp -p $PBS_NODEFILE $OUTP"/mf_"$sfx |
59 |
|
60 |
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 |
#if [ $dsp -le 100000000 ] ; then |
68 |
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 |
echo "cvs update of dir $gcmDIR :" |
91 |
( cd $gcmDIR ; cvs -q $cvsArg update -P -d ) 2>&1 |
92 |
RETVAL=$? |
93 |
if test "x$RETVAL" != x0 ; then |
94 |
echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit" |
95 |
exit |
96 |
fi |
97 |
else |
98 |
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
99 |
checkOut=2 |
100 |
fi |
101 |
fi |
102 |
if [ $checkOut -eq 2 ] ; then |
103 |
if test -e $gcmDIR ; then |
104 |
rm -rf $gcmDIR |
105 |
fi |
106 |
# cvs co MITgcm |
107 |
cvs $cvsArg co -P -d $gcmDIR MITgcm > /dev/null 2>&1 |
108 |
for exp2add in $addExp ; do |
109 |
echo " add dir: $exp2add (from Contrib:verification_other)" |
110 |
( cd $gcmDIR/verification ; cvs $cvsArg co -P -d $exp2add \ |
111 |
MITgcm_contrib/verification_other/$exp2add > /dev/null 2>&1 ) |
112 |
done |
113 |
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
114 |
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
115 |
fi |
116 |
|
117 |
#- change dir to $gcmDIR/verification dir: |
118 |
if test -e $gcmDIR/verification ; then |
119 |
if [ $checkOut -lt 2 ] ; then |
120 |
echo " dir $gcmDIR/verification exist" ; fi |
121 |
cd $gcmDIR/verification |
122 |
else |
123 |
echo "no dir: $gcmDIR/verification => exit" |
124 |
exit |
125 |
fi |
126 |
|
127 |
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
128 |
-send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
129 |
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
130 |
-send "$SEND" -sd $SavD -a jmc@mitgcm.org |
131 |
|
132 |
echo '' |
133 |
#echo ../tools/do_tst_2+2 -o ${dNam}-$sfx -a NONE |
134 |
#../tools/do_tst_2+2 -o ${dNam}-$sfx -a NONE |
135 |
echo ../tools/do_tst_2+2 -o ${dNam}-$sfx -send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
136 |
../tools/do_tst_2+2 -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jmc@mitgcm.org |