#! /usr/bin/env bash # $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/example_scripts/ACESgrid/Attic/aces_test_all,v 1.2 2007/08/08 18:47:48 jmc Exp $ # $Name: $ if test $# = 0 then tst_list='gnu ifc pgi mth' else tst_list=$* fi . /etc/profile.d/modules.sh module list > ~/tmp/.module_list 2>&1 cd /home/jmc/test_ACES/bin # QSUB="/usr/local/bin/qsub" # QSTAT="/usr/local/bin/qstat" QSUB=qsub QSTAT=qstat MPACK="./mpack" TST_DIR="/home/jmc/test_ACES/gcm_tests" nbtst=0 for i in $tst_list do sfx=`echo ${i}"_mpi" | sed 's/mth_mpi/ifc_mth/g'` if test -f ./aces_test_$sfx ; then $QSUB ./aces_test_$sfx eval M_$i='submitted' nbtst=`expr $nbtst + 1` else echo 'no file:' aces_test_$sfx 'to submit' fi done date_str=`date +%Y%m%d`"_0" minutes=0 count=$nbtst while test $count != 0 ; do sleep 300 minutes=$(( $minutes + 5 )) for i in $tst_list ; do eval comm=\$M_$i if test $comm = 'submitted' ; then JOB="tst_"$i ready_to_send=`$QSTAT -a | grep $USER | grep $JOB | wc -l` if test "x_$ready_to_send" = x_0 ; then pat="/tmp/tr_aces-$i"'*' rm -rf $pat run_dir=${TST_DIR}"/tmp_"$i"/MITgcm/verification" tdir=`ls -1 $run_dir | grep -v tr_out | grep '^tr' | head -1` if test ! "x$tdir" = x ; then cp -ra $run_dir"/"$tdir "/tmp/tr_aces-"$i"_"$date_str ( cd /tmp ; tar -czf "./tr_aces-"$i".tar.gz" "./tr_aces-"$i"_"$date_str ) $MPACK -s MITgcm-test -m 3555000 "/tmp/tr_aces-"$i".tar.gz" edhill@mitgcm.org echo "Email sent for $i" else echo "Output not found so no email sent for $i" fi eval M_$i=done count=`expr $count - 1` chmod 644 ../output/tst_$i.std* fi fi done hrs=$(( $minutes / 60 )); # "long" queue is 24hrs = 24*60min = 1440min if test $minutes -gt 1440 ; then echo "Time expired after $minutes minutes ($hrs hours)" echo ' ' $count '/' $nbtst 'tests not yet finished' exit 1 fi done echo "All $nbtst tests completed successfully."