#!/bin/bash
# finds jobs not done and does them

for i in {1..200..1}

 do   

   for j in {1..436..1}

      do 
       
         {
		if [ ! -f /u/flashscratch/d/desmond/hamster_max_shuff_gam_"$i"_batch_"$j".txt ]; then

           		echo /u/flashscratch/d/desmond/hamster_max_shuff_gam_"$i"_batch_"$j".txt "not found"
           		echo "SGE_TASK_ID is " $(((j-1)*500 + 1))

			# export i
                        # export j			

			qsub -cwd -V -N PJ -l h_data=4G,h_rt=6:00:00 -M eplau -m n -t $(((j-1)*500 + 1))-$(((j-1)*500 + 1)):500 hamster_test_rescue $i $j 
			

           	fi
   	}     
    done
done
