#!/bin/bash -l # this script is a qsub companion script to handle single MATLAB # PCT batch job. See run_pct_jobs for running Array of jobs. # Usage: # scc1$ qsub ./run_matlab_pct_job # 4 cores, n=100 # scc1$ qsub -pe omp 8 ./run_matlab_pct_job # 8 cores, n=100 # scc1$ qsub -pe omp 8 -v n=200 ./run_matlab_pct_job # 8 cores, n=200 # Requires RCS MATLAB utilities. Add this line to your startup.m # addpath(genpath('/project/scv/examples/matlab/RCS_utils'),'-begin') # # Specify SGE batch scheduler options # Merge 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 # Request 4 cores from omp queue (example needs multicores) # For serial apps, prepend the line below with another # #$ -pe omp 4 # set default value for n; override with qsub -v at runtime #$ -v n=100 # Load newest version of matlab on SCC module load matlab # Execute the Matlab program matlab -nodisplay -r "runBatchJob($n, $NSLOTS); exit"