8 |
|
|
9 |
if test $# = 0 |
if test $# = 0 |
10 |
then |
then |
11 |
TEST_LIST='o64Adm gfoTlm' |
TEST_LIST='o64Adm gfoTlm gfoMp2 ifort' |
12 |
#if test "x$dInWeek" = xSun ; then TEST_LIST="$TEST_LIST iad ifc oad" ; fi |
#if test "x$dInWeek" = xSun ; then TEST_LIST="$TEST_LIST iad ifc oad" ; fi |
13 |
else |
else |
14 |
TEST_LIST=$* |
TEST_LIST=$* |
31 |
|
|
32 |
rm -f $logPfix.*.log_bak |
rm -f $logPfix.*.log_bak |
33 |
if test -f $LOG_FIL ; then mv -f $LOG_FIL ${LOG_FIL}_bak ; fi |
if test -f $LOG_FIL ; then mv -f $LOG_FIL ${LOG_FIL}_bak ; fi |
34 |
echo -n '-- Starting: ' | tee -a $LOG_FIL |
echo -n '-- Starting: ' | tee -a $LOG_FIL |
35 |
date | tee -a $LOG_FIL |
date | tee -a $LOG_FIL |
36 |
|
|
37 |
n=$(( `ls $logPfix.*.log | wc -l` - 10 )) |
n=$(( `ls $logPfix.*.log | wc -l` - 10 )) |
38 |
if test $n -gt 0 ; then |
if test $n -gt 0 ; then |
39 |
echo ' remove old log files:' | tee -a $LOG_FIL |
echo ' remove old log files:' | tee -a $LOG_FIL |
40 |
ls -lt $logPfix.*.log | tail -"$n" | tee -a $LOG_FIL |
ls -lt $logPfix.*.log | tail -"$n" | tee -a $LOG_FIL |
41 |
ls -t $logPfix.*.log | tail -"$n" | xargs rm -f |
ls -t $logPfix.*.log | tail -"$n" | xargs rm -f |
42 |
fi |
fi |
43 |
|
|
44 |
. /etc/profile.d/modules.sh |
if test -f /etc/profile.d/modules.sh ; then |
45 |
module list >> $LOG_FIL 2>&1 |
. /etc/profile.d/modules.sh |
46 |
|
fi |
47 |
|
module list >> $LOG_FIL 2>&1 |
48 |
|
|
49 |
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
50 |
#-- now really do something: |
#-- now really do something: |
56 |
case $i in |
case $i in |
57 |
'o64Adm') sfx='op64_adm' ;; |
'o64Adm') sfx='op64_adm' ;; |
58 |
'gfoTlm') sfx='gfo_tlm' ;; |
'gfoTlm') sfx='gfo_tlm' ;; |
59 |
|
'gfoMp2') sfx='gfo_mp2' ;; |
60 |
*) sfx=${i}'_mpi' ;; |
*) sfx=${i}'_mpi' ;; |
61 |
esac |
esac |
62 |
BATCH_SCRIPT="test_engag_$sfx" |
BATCH_SCRIPT="test_engag_$sfx" |
67 |
#-- move previous output file |
#-- move previous output file |
68 |
outList=`ls $JOB.std??? 2> /dev/null` |
outList=`ls $JOB.std??? 2> /dev/null` |
69 |
if test "x$outList" != x ; then |
if test "x$outList" != x ; then |
70 |
echo -n " moving job $JOB old output files:" | tee -a $LOG_FIL |
echo -n " moving job $JOB old output files:" | tee -a $LOG_FIL |
71 |
if test -d $OUT_DIR/prev ; then |
if test -d $OUT_DIR/prev ; then |
72 |
for xx in $outList ; do |
for xx in $outList ; do |
73 |
echo -n " $xx" | tee -a $LOG_FIL |
pp=$OUT_DIR/prev/$xx ; echo -n " $xx" | tee -a $LOG_FIL |
74 |
mv -f $xx $OUT_DIR/prev |
test -f $pp.sav && mv -f $pp.sav $pp.old |
75 |
|
test -f $pp && mv -f $pp $pp.sav |
76 |
|
chmod a+r $xx ; mv -f $xx $OUT_DIR/prev |
77 |
done |
done |
78 |
echo " to dir ./prev" | tee -a $LOG_FIL |
echo " to dir ./prev" | tee -a $LOG_FIL |
79 |
else |
else |
80 |
echo " <-- missing dir $OUT_DIR/prev" | tee -a $LOG_FIL |
echo " <-- missing dir $OUT_DIR/prev" | tee -a $LOG_FIL |
81 |
fi |
fi |
82 |
else echo " no old output files from job '$JOB'" | tee -a $LOG_FIL |
else echo " no old output files from job '$JOB'" | tee -a $LOG_FIL |
83 |
fi |
fi |
84 |
#-- submit job |
#-- submit job |
85 |
echo -n "--> $JOB : " | tee -a $LOG_FIL |
echo -n "--> $JOB : " | tee -a $LOG_FIL |
86 |
$QSUB $SUB_DIR/$BATCH_SCRIPT | tee -a $LOG_FIL |
$QSUB $SUB_DIR/$BATCH_SCRIPT | tee -a $LOG_FIL |
87 |
NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1` |
NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1` |
88 |
else |
else |
89 |
echo "--> $JOB :" | tee -a $LOG_FIL |
echo "--> $JOB :" | tee -a $LOG_FIL |
90 |
$QSTAT -a | grep $USER | grep $JOB | tee -a $LOG_FIL |
$QSTAT -a | grep $USER | grep $JOB | tee -a $LOG_FIL |
91 |
echo ' job already exist => skip this test' | tee -a $LOG_FIL |
echo ' job already exist => skip this test' | tee -a $LOG_FIL |
92 |
fi |
fi |
93 |
else |
else |
94 |
echo 'no file:' $BATCH_SCRIPT 'to submit' | tee -a $LOG_FIL |
echo 'no file:' $BATCH_SCRIPT 'to submit' | tee -a $LOG_FIL |
95 |
fi |
fi |
96 |
done |
done |
97 |
echo "info-sub-list: NB_SUB_JOBS='$NB_SUB_JOBS'" >> $LOG_FIL |
echo "info-sub-list: NB_SUB_JOBS='$NB_SUB_JOBS'" >> $LOG_FIL |
98 |
|
echo -n '-- Finished at: ' | tee -a $LOG_FIL |
99 |
|
date | tee -a $LOG_FIL |
100 |
|
|
101 |
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
102 |
exit 0 |
exit 0 |