#!/bin/csh # # SGE script for MATLAB standalone (generated with mcc) # # Submit job with the command: scc1% qsub batch_standalone # To submit multiple batch jobs: scc1% submitmjobs 1 1 1 1 batch_standalone # (See submitmjobs for instructions) # # 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. # The standaloneDemo program needs multicores to test PCT usage # If your own app use 1 core, prepend line with extra # or remove line ##$ -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" set NODENAME = `echo $HOSTNAME | sed 's/.scc.bu.edu//'` # Running MATLAB standalone results in creation of a cache folder in home dir # This may cause runtime issues. Below is a workaround. set TMPDIR=/scratch/kadin/mcr_cache_root_$USER/$JOB_ID mkdir -p $TMPDIR setenv MCR_CACHE_ROOT $TMPDIR echo "\n\n********************************************" echo "* Created local scratch folder /net/$NODENAME$TMPDIR" echo "********************************************\n\n" # Ready to run standalone with commandline inputs (if required). For # multicores, use $NSLOTS requested by you in #$ -pe above # Output to screen go to your ?.o$JOB_ID file runx2 $MATLAB_J # remove TMPDIR from local scratch rm -rf /net/$NODENAME$TMPDIR echo "\n\n********************************************" echo "* Removed local scratch folder /net/$NODENAME$TMPDIR" echo "********************************************\n\n"