1 |
#!/bin/bash |
2 |
# |
3 |
#PBS -q four |
4 |
#PBS -N tst_pgi |
5 |
#PBS -l nodes=1:ppn=6 |
6 |
#PBS -e /mit/jm_c/test_acesgrid/output/tst_pgi.stderr |
7 |
#PBS -o /mit/jm_c/test_acesgrid/output/tst_pgi.stdout |
8 |
|
9 |
# $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/test_aces_pgi_mpi,v 1.3 2011/08/17 20:45:35 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 |
|
22 |
#TST_DIR="/home/jmc/test_ACES" |
23 |
TST_DIR="/mit/jm_c/test_acesgrid" |
24 |
HERE=$TST_DIR/output |
25 |
#cd $HERE |
26 |
|
27 |
sfx='pgi' |
28 |
module add pgi |
29 |
module add mvapich2 |
30 |
OPTFILE="../tools/build_options/linux_amd64_pgf77" |
31 |
#options="-j 2 -MPI 6 -mf $PBS_NODEFILE" |
32 |
#EXE="mpirun -machinefile TR_MFILE -v -np TR_NPROC ./mitgcmuv" |
33 |
options="-j 2 -MPI 6" |
34 |
EXE="mpirun -v -np TR_NPROC ./mitgcmuv" |
35 |
|
36 |
dAlt=`date +%d` ; dAlt=`expr $dAlt % 3` |
37 |
if [ $dAlt -eq 1 ] ; then options="$options -fast" ; fi |
38 |
|
39 |
#- keep a copy of MPI_MFILE: |
40 |
cp -p $PBS_NODEFILE $HERE"/mf_"$sfx |
41 |
|
42 |
checkOut=1 |
43 |
#options="$options -nc" ; checkOut=0 |
44 |
#options="$options -q" ; checkOut=0 |
45 |
|
46 |
gcmDIR="MITgcm_$sfx" |
47 |
cd $TST_DIR |
48 |
#- check for disk space: |
49 |
dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
50 |
if [ $dsp -gt 99 ] ; then |
51 |
echo 'Not enough space on this disk => do not run testreport.' |
52 |
df . |
53 |
exit |
54 |
fi |
55 |
if [ $checkOut -eq 1 ] ; then |
56 |
if test -d $gcmDIR/CVS ; then |
57 |
/bin/rm -rf $gcmDIR/verification/??_acesgrid-${sfx}_????????_? |
58 |
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
59 |
echo "cvs update of dir $gcmDIR :" |
60 |
( cd $gcmDIR ; cvs -q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d ) 2>&1 |
61 |
RETVAL=$? |
62 |
if test "x$RETVAL" != x0 ; then |
63 |
echo "cvs update fail (return val=$RETVAL) => exit" |
64 |
exit |
65 |
fi |
66 |
else |
67 |
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
68 |
checkOut=2 |
69 |
fi |
70 |
fi |
71 |
if [ $checkOut -eq 2 ] ; then |
72 |
if test -e $gcmDIR ; then |
73 |
rm -rf $gcmDIR |
74 |
fi |
75 |
# cvs co MITgcm |
76 |
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P -d $gcmDIR MITgcm > /dev/null 2>&1 |
77 |
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
78 |
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
79 |
fi |
80 |
|
81 |
#- change dir to $gcmDIR/verification dir: |
82 |
if test -e $gcmDIR/verification ; then |
83 |
if [ $checkOut -lt 2 ] ; then |
84 |
echo " dir $gcmDIR/verification exist" ; fi |
85 |
cd $gcmDIR/verification |
86 |
else |
87 |
echo "no dir: $gcmDIR/verification => exit" |
88 |
exit |
89 |
fi |
90 |
|
91 |
# avoid hanging in fizhi-cs-32x32x40 (due to I/O problems with g77) |
92 |
echo ./testreport $options -of $OPTFILE -command \"$EXE\" -odir acesgrid-$sfx \ |
93 |
-skd fizhi-cs-32x32x40 |
94 |
./testreport $options -of $OPTFILE -command "$EXE" -odir acesgrid-$sfx \ |
95 |
-skd fizhi-cs-32x32x40 |
96 |
|
97 |
echo '' |
98 |
#echo ../tools/do_tst_2+2 -mpi -mf $PBS_NODEFILE -exe \"$EXE\" -o acesgrid-$sfx -a NONE |
99 |
#../tools/do_tst_2+2 -mpi -mf $PBS_NODEFILE -exe "$EXE" -o acesgrid-$sfx -a NONE |
100 |
echo ../tools/do_tst_2+2 -mpi -exe \"$EXE\" -o acesgrid-$sfx -a NONE |
101 |
../tools/do_tst_2+2 -mpi -exe "$EXE" -o acesgrid-$sfx -a NONE |