#!/bin/bash p=$1 rm -f combine.log > /dev/null rm -f combine.err > /dev/null rm -f combine.out > /dev/null if [ "$p" = "1" ] then echo '#!/bin/bash' > combine.pbs echo 'if [[ "$PBS_O_WORKDIR" != "" ]]; then' >> combine.pbs echo ' cd $PBS_O_WORKDIR' >> combine.pbs echo 'fi' >> combine.pbs echo "../bin/combine_events;touch combine.out" >> combine.pbs chmod u+x combine.pbs #qsub -l walltime=50:00:00 -N combine_run -e combine.err -o combine.log -V -q madgraph combine.pbs >> ../running_jobs #qsub -q qwork@ms -l walltime=48:00:00 -e combine.err -o combine.log -V -q madgraph combine.pbs >> ../running_jobs qsub -q qwork@ms -l walltime=48:00:00 -e combine.err -o combine.log -V combine.pbs >> ../running_jobs while [ ! -e combine.out ] do echo "[INFO] combine.log not available yet ... waiting" sleep 1 done #rm -f combine.pbs echo "[INFO] combine done ... waiting 60s" sleep 60 ###################################################### #ji+ #this two files are not ready yet ... do the cat later #while [ ! -e combine.log ] #do # echo "[WARNING] combine.log not available yet, job not completely finished ... waiting" # sleep 10 #done cat combine.log #while [ ! -e combine.err ] #do # echo "[WARNING] combine.err not available yet, job not completely finished" # sleep 10 #done cat combine.err #ji else ../bin/combine_events fi # Remove huge scratch file rm -f scratch