/[MITgcm]/MITgcm_contrib/test_scripts/engaging/test_submit_engag
ViewVC logotype

Contents of /MITgcm_contrib/test_scripts/engaging/test_submit_engag

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


Revision 1.1 - (show annotations) (download)
Mon Oct 19 18:23:42 2015 UTC (9 years, 9 months ago) by jmc
Branch: MAIN
scripts to run (TAF) AD & TLM testreport on engaging cluster

1 #! /usr/bin/env bash
2
3 # $Header: $
4 # $Name: $
5
6 today=`date +%Y%m%d`
7 dInWeek=`date +%a`
8
9 if test $# = 0
10 then
11 TEST_LIST='gnu mp2 adm pgi path mth op64 tuv'
12 TEST_LIST='o64Adm gfoTlm'
13 #if test "x$dInWeek" = xSat ; then TEST_LIST="$TEST_LIST iad ifc oad" ; fi
14 #if test "x$dInWeek" = xSun ; then TEST_LIST="$TEST_LIST iad ifc oad" ; fi
15 else
16 TEST_LIST=$*
17 fi
18
19 QSUB="/usr/bin/sbatch"
20 QSTAT="/usr/bin/qstat"
21 dNam='engaging'
22 HERE="$HOME/test_$dNam"
23 TST_DIR="/pool001/jm_c/test_$dNam"
24 logPfix='test_submit'
25
26 SUB_DIR="$HERE/engaging"
27 OUT_DIR="$HERE/output"
28 LOG_FIL="$OUT_DIR/$logPfix."`date +%m%d`".log"
29
30 #-- clean up old log files and start a new one:
31 cd $OUT_DIR
32
33 rm -f $logPfix.*.log_bak
34 if test -f $LOG_FIL ; then mv -f $LOG_FIL ${LOG_FIL}_bak ; fi
35 echo -n '-- Starting: ' | tee -a $LOG_FIL
36 date | tee -a $LOG_FIL
37
38 n=$(( `ls $logPfix.*.log | wc -l` - 10 ))
39 if test $n -gt 0 ; then
40 echo ' remove old log files:' | tee -a $LOG_FIL
41 ls -lt $logPfix.*.log | tail -"$n" | tee -a $LOG_FIL
42 ls -t $logPfix.*.log | tail -"$n" | xargs rm -f
43 fi
44
45 . /etc/profile.d/modules.sh
46 module list >> $LOG_FIL 2>&1
47
48 #-- now really do something:
49 #cd $HERE
50 #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
51
52 JOB_LIST=$TEST_LIST
53 NB_SUB_JOBS=0
54 for i in $JOB_LIST
55 do
56 case $i in
57 'o64Adm') sfx='op64_adm' ;;
58 'gfoTlm') sfx='gfo_tlm' ;;
59 *) sfx=${i}'_mpi' ;;
60 esac
61 BATCH_SCRIPT="test_engag_$sfx"
62 if test -f $SUB_DIR/$BATCH_SCRIPT ; then
63 JOB="tst_"$i
64 job_exist=`$QSTAT -a | grep $USER | grep $JOB | wc -l`
65 if test "x_$job_exist" = x_0 ; then
66 #-- move previous output file
67 outList=`ls $JOB.std??? 2> /dev/null`
68 if test "x$outList" != x ; then
69 echo -n " moving job $JOB old output files:"
70 if test -d $OUT_DIR/prev ; then
71 for xx in $outList ; do
72 echo -n " $xx"
73 mv -f $xx $OUT_DIR/prev
74 done
75 echo " to dir $OUT_DIR/prev"
76 else
77 echo " <-- missing dir $OUT_DIR/prev"
78 fi
79 else echo " no old output files from job '$JOB'"
80 fi
81 #-- submit job
82 echo -n " $JOB : " | tee -a $LOG_FIL
83 $QSUB $SUB_DIR/$BATCH_SCRIPT | tee -a $LOG_FIL
84 #eval M_$i='submitted'
85 NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1`
86 else
87 echo $JOB | tee -a $LOG_FIL
88 $QSTAT -a | grep $USER | grep $JOB | tee -a $LOG_FIL
89 echo 'job already exist => skip this test' | tee -a $LOG_FIL
90 #eval M_$i='skipped'
91 fi
92 else
93 echo 'no file:' $BATCH_SCRIPT 'to submit' | tee -a $LOG_FIL
94 #eval M_$i='skipped'
95 fi
96 done
97 echo " info-sub-list: NB_SUB_JOBS='$NB_SUB_JOBS'" >> $LOG_FIL
98
99 #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
100 exit 0

  ViewVC Help
Powered by ViewVC 1.1.22