#!/bin/bash -l # this is a qsub companion script for running Array Job # Usage examples: # scc1$ qsub -t 3-7:2 ./run_matlab_aj # n=3,5,7 # scc1$ qsub -v a=3 -v b=4 -t 3-7:2 ./run_matlab_aj # n=3,5,7 # Specify qsub options # Merge batch output and error files in one #$ -j y # Send email to SCC userID when job finished or aborted #$ -m ae # Give the job(s) a name #$ -N myJobs #$ -v a=1 #$ -v b=2 # Load newest version of matlab on SCC module load matlab # use env var SGE_TASK_ID as random matrix size n matlab -nodisplay -singleCompThread -r \ "myRand($SGE_TASK_ID),fprintf(1,'a=%f; b=%f\n',$a,$b),exit"