#!/bin/bash # # First we need to get into the main directory # if [[ ! -d ./bin ]]; then cd ../ if [[ ! -d ./bin ]]; then echo "Error: survey must be executed from the main, or bin directory" exit fi fi # # Now let shell know where to find important executables # main=`pwd` dirbin=$main/bin # Begin Local versions # set dirbin = /home/tstelzer/bin/MG_ME # End Local versions cd SubProcesses t=`find ./ -maxdepth 2 -name "ajob*" |wc -l` r=`find ./ -maxdepth 2 -name "run.ajob*" |wc -l` w=`find ./ -maxdepth 2 -name "wait.ajob*" |wc -l` d=`find ./ -maxdepth 2 -name "done.ajob*" |wc -l` echo "waiting while finishing jobs on cluster" echo "ajob*: $w, run.ajob*: $r, wait.ajob*: $d, done.ajob*: $t" rm -f ../status echo $w $r $d $t > ../status $dirbin/gen_crossxhtml-pl $2 while [[ $d -lt $t ]]; do sleep 10 t=`find ./ -maxdepth 2 -name "ajob*" |wc -l` r=`find ./ -maxdepth 2 -name "run.ajob*" |wc -l` w=`find ./ -maxdepth 2 -name "wait.ajob*" |wc -l` d=`find ./ -maxdepth 2 -name "done.ajob*" |wc -l` echo "ajob*: $t, run.ajob*: $r, wait.ajob*: $w, done.ajob*: $d" #echo $w $r $d $t rm -f ../status echo $w $r $d $t > ../status $dirbin/gen_crossxhtml-pl $2 done rm -f ../running_jobs