#!/bin/csh # # SGE script for MATLAB with PCT # # Note: A line of the form "#$ qsub_option" is interpreted by qsub # as if "qsub_option" was passed to qsub on the commandline. # ## Start qsub instructions here ################################ # Set runtime (aka wallclock) limit for this job for each core, # Format: -l h_rt=HH:MM:SS (need not specify if <= 12 hours) #$ -l h_rt=24:00:00 # # Invoke Parallel Environment -- only if multiprocessors are required # There is no default value for processor count. You must provide. #$ -pe omp 4 # # Merge stderr into the stdout file, to reduce clutter. #$ -j y # Send email to your-user-name@bu.edu when job aborted or ended #$ -m ae # Optionally, remove leading # to send email to another address ##$ -M your-email-address ## end of qsub options ######################################## echo "\n\n********************************************" echo "* This job runs on $HOSTNAME" echo "********************************************\n\n" # IMPORTANT: DONOT indent any of the below statements matlab -nodisplay << MATLAB_ENV % The below works like a script m-file between MATLAB_ENVs % NSLOTS = N in -pe omp N (4 in example; qsub can override at runtime) [s, nprocs] = unix('printenv NSLOTS'); nprocs = str2double(nprocs); n = 2000; % parfor i=1:n work distributed among nprocs cores s = myApp(n, nprocs); % example code with parfor i=1:n with nprocs cores exit % don't forget to exit MATLAB MATLAB_ENV # keep this line to ensure newline