#! /usr/bin/env bash . /etc/profile.d/modules.sh module list > .module_list 2>&1 cd /home/edhill/local/bin # QSUB="/usr/local/bin/qsub" # QSTAT="/usr/local/bin/qstat" QSUB=qsub QSTAT=qstat MPACK="./mpack" $QSUB ./itrda_gnu_test_mpi $QSUB ./itrda_intel_test_mpi $QSUB ./itrda_pgi_test_mpi $QSUB ./itrda_intel_test_mth date_str=`date +%Y%m%d`"_0" minutes=0 while test ! "x_"$M_g77"_"$M_ifc"_"$M_pgf77"_"$M_mth = x_done_done_done_done ; do sleep 300 minutes=$(( $minutes + 5 )) for i in g77 ifort pgf77 mth ; do JOB="eh3_"$i comm="echo \$M_$i" ready_to_send=`eval $comm`"_"`$QSTAT -a | grep edhill | grep $JOB | wc -l` if test "x_$ready_to_send" = x__0 ; then pat="/tmp/tr_itrda-$i"'*' rm -rf $pat run_dir="/net/ds-01/scratch-5/edhill/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 fi done hrs=$(( $minutes / 60 )); # "long" queue is 24hrs = 24*60min = 1440min if test $minutes -gt 1440 ; then echo "Time expired with $minutes minutes ($hrs hours)." exit 1 fi done echo "All tests completed successfully."