/[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.4 - (hide annotations) (download)
Thu Dec 6 03:39:18 2007 UTC (16 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.3: +29 -16 lines
- only submit a new test if previous one is done (safer since 1rst thing
  testing job does is to remove the testing dir)
- do not rely on synbolic link to acces the testing script (use the real path)
- avoid temporary copy of output-dir in /tmp.

1 jmc 1.1 #! /usr/bin/env bash
2    
3 jmc 1.4 # $Header: /u/gcmpack/MITgcm/tools/example_scripts/ACESgrid/aces_test_all,v 1.3 2007/11/30 17:09:21 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     tst_list='gnu ifc pgi mth'
11     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     sfx=`echo ${i}"_mpi" | sed 's/mth_mpi/ifc_mth/g'`
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     minutes=0
53     count=$nbtst
54     while test $count != 0 ; do
55    
56 jmc 1.4 sleep 600
57     minutes=$(( $minutes + 10 ))
58 jmc 1.1
59     for i in $tst_list ; do
60    
61     eval comm=\$M_$i
62     if test $comm = 'submitted' ; then
63     JOB="tst_"$i
64     ready_to_send=`$QSTAT -a | grep $USER | grep $JOB | wc -l`
65    
66     if test "x_$ready_to_send" = x_0 ; then
67     pat="/tmp/tr_aces-$i"'*'
68     rm -rf $pat
69     run_dir=${TST_DIR}"/tmp_"$i"/MITgcm/verification"
70 jmc 1.4 tdir=`ls -1 $run_dir | grep -v tr_out | grep '^tr_aces' | head -1`
71 jmc 1.1 if test ! "x$tdir" = x ; then
72 jmc 1.4 ( cd $run_dir ; tar -czf "/tmp/tr_aces-"$i".tar.gz" ./$tdir )
73 jmc 1.3 $MPACK -s MITgcm-test -m 3555000 "/tmp/tr_aces-"$i".tar.gz" jmc@mitgcm.org
74 jmc 1.1 echo "Email sent for $i"
75     else
76     echo "Output not found so no email sent for $i"
77     fi
78     eval M_$i=done
79     count=`expr $count - 1`
80 jmc 1.4 chmod 644 output/tst_$i.std*
81 jmc 1.1 fi
82     fi
83     done
84    
85     # "long" queue is 24hrs = 24*60min = 1440min
86 jmc 1.4 if test $minutes -gt 2160 ; then
87     hrs=$(( $minutes / 60 ));
88 jmc 1.1 echo "Time expired after $minutes minutes ($hrs hours)"
89     echo ' ' $count '/' $nbtst 'tests not yet finished'
90     exit 1
91     fi
92    
93     done
94    
95     echo "All $nbtst tests completed successfully."
96 jmc 1.4 echo -n '-- Finished: '
97     date
98 jmc 1.1

  ViewVC Help
Powered by ViewVC 1.1.22