1 |
#!/bin/bash |
2 |
# |
3 |
#PBS -q four-twelve |
4 |
#PBS -N tst_gnu |
5 |
#PBS -l nodes=2:ppn=2 |
6 |
#PBS -e /home/jmc/test_aces/output/tst_gnu.stderr |
7 |
#PBS -o /home/jmc/test_aces/output/tst_gnu.stdout |
8 |
|
9 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/aces_test_gnu_mpi,v 1.29 2014/05/08 18:44:03 jmc Exp $ |
10 |
# $Name: $ |
11 |
|
12 |
# ACES-grid PBS-batch script: MPI test using GNU (g77) compiler & mpich |
13 |
|
14 |
if test -f /etc/profile.d/modules.sh ; then |
15 |
. /etc/profile.d/modules.sh |
16 |
fi |
17 |
# Note: added "ulimit -s unlimited" in file "~/.bashrc" |
18 |
# to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI |
19 |
|
20 |
umask 0022 |
21 |
#- to get case insensitive "ls" (and order of tested experiments) |
22 |
export LC_ALL="en_US.UTF-8" |
23 |
echo " running on: "`hostname` |
24 |
|
25 |
dNam='aces' |
26 |
HERE="$HOME/test_$dNam" |
27 |
OUTP="$HERE/output"; SavD="$HERE/send" |
28 |
SEND="ssh geo $SavD/mpack" |
29 |
TST_DIR=$HERE |
30 |
|
31 |
if test -d $TST_DIR ; then |
32 |
echo "start from TST_DIR='$TST_DIR' at: "`date` |
33 |
else |
34 |
# if test ! -d /scratch/jm_c ; then mkdir /scratch/jm_c ; fi |
35 |
if test ! -d $TST_DIR ; then mkdir $TST_DIR ; fi |
36 |
if test ! -d $TST_DIR ; then |
37 |
echo "ERROR: Can't create directory \"$TST_DIR\"" |
38 |
exit 1 |
39 |
fi |
40 |
echo "start in new dir TST_DIR='$TST_DIR' at: "`date` |
41 |
fi |
42 |
|
43 |
sfx='gnu' |
44 |
addExp='' |
45 |
module add mpich/$sfx |
46 |
export MPI_INC_DIR='/usr/local/pkg/mpich/mpich-gcc/include' |
47 |
OPTFILE="../tools/build_options/linux_ia32_g77" |
48 |
options="-j 2 -MPI 4 -mf $PBS_NODEFILE" |
49 |
EXE="mpirun -machinefile TR_MFILE -v -np TR_NPROC ./mitgcmuv" |
50 |
|
51 |
checkOut=1 ; options="$options -do" |
52 |
#options="$options -nc" ; checkOut=0 |
53 |
#options="$options -q" ; checkOut=0 |
54 |
|
55 |
#- keep a copy of MPI_MFILE: |
56 |
cp -p $PBS_NODEFILE $OUTP"/mf_"$sfx |
57 |
|
58 |
cvsArg="-d :pserver:cvsanon@mitgcm.org:/u/gcmpack" |
59 |
gcmDIR="MITgcm_$sfx" |
60 |
cd $TST_DIR |
61 |
#- check for disk space: relative space (99%) or absolute (1.G): |
62 |
#dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
63 |
#if [ $dsp -gt 99 ] ; then |
64 |
dsp=`df -P . | tail -1 | awk '{print $4}'` |
65 |
if [ $dsp -le 1000000 ] ; then |
66 |
echo 'Not enough space on this disk => do not run testreport.' |
67 |
df . |
68 |
exit |
69 |
fi |
70 |
if [ $checkOut -eq 1 ] ; then |
71 |
if test -d $gcmDIR/CVS ; then |
72 |
#- remove previous output tar files and tar & remove previous output-dir |
73 |
/bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz |
74 |
( cd $gcmDIR/verification |
75 |
listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null` |
76 |
for dd in $listD |
77 |
do |
78 |
if test -d $dd ; then |
79 |
tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd |
80 |
RETVAL=$? |
81 |
if test "x$RETVAL" != x0 ; then |
82 |
echo "ERROR in tar+gzip prev outp-dir: $dd" |
83 |
echo " on '"`hostname`"' (return val=$RETVAL) but continue" |
84 |
fi |
85 |
fi |
86 |
done ) |
87 |
# ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
88 |
#- clean-up previous TAF output temp dir (generated on old system like here) |
89 |
# ( cd $gcmDIR/verification ; /bin/rm -rf */build/PaxHeaders.[0-9]* ) |
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 |
# avoid hanging in fizhi-cs-32x32x40 (due to I/O problems with g77) |
128 |
echo ./testreport $options -of $OPTFILE -command \"$EXE\" -odir ${dNam}-$sfx \ |
129 |
-send \"$SEND\" -sd $SavD -a jmc@mitgcm.org -skd fizhi-cs-32x32x40 |
130 |
# -skd fizhi-cs-32x32x40 |
131 |
./testreport $options -of $OPTFILE -command "$EXE" -odir ${dNam}-$sfx \ |
132 |
-send "$SEND" -sd $SavD -a jmc@mitgcm.org -skd fizhi-cs-32x32x40 |
133 |
# -skd fizhi-cs-32x32x40 |