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

Annotation of /MITgcm/tools/example_scripts/ACESgrid/aces_test_all

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


Revision 1.7 - (hide annotations) (download)
Tue Feb 26 21:52:16 2008 UTC (16 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59o, checkpoint61b, checkpoint61a
Changes since 1.6: +30 -1 lines
also build the mpack utilities

1 jmc 1.1 #! /usr/bin/env bash
2    
3 jmc 1.7 # $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/aces_test_all,v 1.6 2008/01/25 15:17:20 jmc Exp $
4 jmc 1.1 # $Name: $
5    
6 jmc 1.4 echo -n '-- Starting: '
7     date
8 jmc 1.1 if test $# = 0
9     then
10 jmc 1.5 tst_list='gnu ifc pgi mth tuv'
11 jmc 1.1 else
12     tst_list=$*
13     fi
14    
15     . /etc/profile.d/modules.sh
16     module list > ~/tmp/.module_list 2>&1
17    
18 jmc 1.4 cd /home/jmc/test_ACES
19 jmc 1.1
20     # QSUB="/usr/local/bin/qsub"
21     # QSTAT="/usr/local/bin/qstat"
22     QSUB=qsub
23     QSTAT=qstat
24 jmc 1.4 MPACK="MITgcm_tools/mpack-1.6/mpack"
25 jmc 1.1 TST_DIR="/home/jmc/test_ACES/gcm_tests"
26    
27     nbtst=0
28     for i in $tst_list
29     do
30 jmc 1.5 sfx=`echo ${i}"_mpi" | sed 's/mth_mpi/ifc_mth/' | sed 's/tuv_mpi/op64_tuv/'`
31 jmc 1.4 if test -f MITgcm_tools/example_scripts/ACESgrid/aces_test_$sfx ; then
32     JOB="tst_"$i
33     job_exist=`$QSTAT -a | grep $USER | grep $JOB | wc -l`
34     if test "x_$job_exist" = x_0 ; then
35     $QSUB MITgcm_tools/example_scripts/ACESgrid/aces_test_$sfx
36     eval M_$i='submitted'
37     nbtst=`expr $nbtst + 1`
38     else
39     echo $JOB
40     $QSTAT -a | grep $USER | grep $JOB
41     echo 'job already exist => skip this test'
42     eval M_$i='skipped'
43     fi
44 jmc 1.1 else
45     echo 'no file:' aces_test_$sfx 'to submit'
46 jmc 1.4 eval M_$i='skipped'
47 jmc 1.1 fi
48     done
49    
50 jmc 1.4 #date_str=`date +%Y%m%d`"_0"
51 jmc 1.1
52 jmc 1.7 MPACKDIR=`dirname $MPACK`
53     #- build the mpack utility (from build_mpack in testreport):
54     ( cd $MPACKDIR && ./configure && make ) > TTT.build_mpack.$$ 2>&1
55     RETVAL=$?
56     if test "x$RETVAL" != x0 ; then
57     echo
58     echo "Error building the mpack tools at: $MPACK_DIR"
59     if test -x $MPACK ; then
60     HAVE_MPACK=t
61     echo " use (old ?) executable:" ; ls -l $MPACK
62     else
63     HAVE_MPACK=f
64     fi
65     else
66     if test -x $MPACK ; then
67     rm -f TTT.build_mpack.$$
68     HAVE_MPACK=t
69     echo " building mpack: OK"
70     else
71     echo " $MPACK not executable"
72     HAVE_MPACK=f
73     fi
74     fi
75     echo
76    
77 jmc 1.1 minutes=0
78     count=$nbtst
79     while test $count != 0 ; do
80    
81 jmc 1.4 sleep 600
82     minutes=$(( $minutes + 10 ))
83 jmc 1.1
84     for i in $tst_list ; do
85    
86     eval comm=\$M_$i
87     if test $comm = 'submitted' ; then
88     JOB="tst_"$i
89     ready_to_send=`$QSTAT -a | grep $USER | grep $JOB | wc -l`
90    
91     if test "x_$ready_to_send" = x_0 ; then
92     pat="/tmp/tr_aces-$i"'*'
93     rm -rf $pat
94 jmc 1.6 run_dir=${TST_DIR}"/MITgcm_"$i"/verification"
95 jmc 1.4 tdir=`ls -1 $run_dir | grep -v tr_out | grep '^tr_aces' | head -1`
96 jmc 1.1 if test ! "x$tdir" = x ; then
97 jmc 1.4 ( cd $run_dir ; tar -czf "/tmp/tr_aces-"$i".tar.gz" ./$tdir )
98 jmc 1.7 if test "x$HAVE_MPACK" = xt ; then
99 jmc 1.3 $MPACK -s MITgcm-test -m 3555000 "/tmp/tr_aces-"$i".tar.gz" jmc@mitgcm.org
100 jmc 1.1 echo "Email sent for $i"
101 jmc 1.7 else
102     echo "no email sent for $i (no mpack)"
103     fi
104 jmc 1.1 else
105     echo "Output not found so no email sent for $i"
106     fi
107     eval M_$i=done
108     count=`expr $count - 1`
109 jmc 1.4 chmod 644 output/tst_$i.std*
110 jmc 1.1 fi
111     fi
112     done
113    
114     # "long" queue is 24hrs = 24*60min = 1440min
115 jmc 1.4 if test $minutes -gt 2160 ; then
116     hrs=$(( $minutes / 60 ));
117 jmc 1.1 echo "Time expired after $minutes minutes ($hrs hours)"
118     echo ' ' $count '/' $nbtst 'tests not yet finished'
119     exit 1
120     fi
121    
122     done
123    
124     echo "All $nbtst tests completed successfully."
125 jmc 1.4 echo -n '-- Finished: '
126     date
127 jmc 1.1

  ViewVC Help
Powered by ViewVC 1.1.22