/[MITgcm]/MITgcm/tools/example_scripts/ACESgrid/test_aces_adm_mpi
ViewVC logotype

Contents of /MITgcm/tools/example_scripts/ACESgrid/test_aces_adm_mpi

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.18 - (show annotations) (download)
Wed Jun 18 19:33:08 2014 UTC (9 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64z, checkpoint65b, checkpoint65a, checkpoint65
Changes since 1.17: +5 -5 lines
adjust disk space check for running on local /scratch disk

1 #!/bin/bash
2 #
3 #PBS -q one
4 #PBS -N tst_adm
5 #PBS -l nodes=1:ppn=6
6 #PBS -e /mit/jm_c/test_acesgrid/output/tst_adm.stderr
7 #PBS -o /mit/jm_c/test_acesgrid/output/tst_adm.stdout
8
9 # $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/test_aces_adm_mpi,v 1.17 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='adm'
42 addExp=''
43 module add pgi
44 module add openmpi
45 OPTFILE="../tools/build_options/linux_amd64_pgf77"
46 #- needed for DIVA with MPI:
47 export MPI_INC_DIR="/mit/software/pgi/pgi-11.7/pkg/openmpi/openmpi-1.4.3/include"
48 options="-adm -MPI 6"
49 #- need this to get "staf":
50 export PATH="$PATH:$HOME/bin"
51
52 dAlt=`date +%d` ; dAlt=`expr $dAlt % 3`
53 if [ $dAlt -eq 1 ] ; then options="$options -fast" ; fi
54
55 checkOut=2
56 #options="$options -nc" ; checkOut=1
57 #options="$options -q" ; checkOut=0
58
59 #- keep a copy of MPI_MFILE:
60 cp -p $PBS_NODEFILE $OUTP"/mf_"$sfx
61
62 cvsArg="-d :pserver:cvsanon@mitgcm.org:/u/gcmpack"
63 gcmDIR="MITgcm_$sfx"
64 cd $TST_DIR
65 #- check for disk space: relative space (99%) or absolute (10.G):
66 dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
67 if [ $dsp -gt 99 ] ; then
68 #dsp=`df -P . | tail -1 | awk '{print $4}'`
69 #if [ $dsp -le 100000000 ] ; then
70 echo 'Not enough space on this disk => do not run testreport.'
71 df .
72 exit
73 fi
74 if [ $checkOut -eq 1 ] ; then
75 if test -d $gcmDIR/CVS ; then
76 #- remove previous output tar files and tar & remove previous output-dir
77 /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
78 ( cd $gcmDIR/verification
79 listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
80 for dd in $listD
81 do
82 if test -d $dd ; then
83 tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
84 RETVAL=$?
85 if test "x$RETVAL" != x0 ; then
86 echo "ERROR in tar+gzip prev outp-dir: $dd"
87 echo " on '"`hostname`"' (return val=$RETVAL) but continue"
88 fi
89 fi
90 done )
91 # ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
92 echo "cvs update of dir $gcmDIR :"
93 ( 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 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 /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 echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \
130 -send \"$SEND\" -sd $SavD -a jmc@mitgcm.org
131 ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \
132 -send "$SEND" -sd $SavD -a jmc@mitgcm.org

  ViewVC Help
Powered by ViewVC 1.1.22