Skip to content

Instantly share code, notes, and snippets.

@wtbarnes
Created August 27, 2015 18:24
Show Gist options
  • Save wtbarnes/48472e6e62e9e90f2517 to your computer and use it in GitHub Desktop.
Save wtbarnes/48472e6e62e9e90f2517 to your computer and use it in GitHub Desktop.
shell script for running MATLAB non-interactively through PBS/TORQUE. From kodiak.baylor.edu
#!/bin/bash
#PBS -S /bin/bash
#PBS -l nodes=1:ppn=1
# This script allows the user to execute a Matlab .m file using the Torque batch
# system.
# How to run this script in batch: $ qsub -v prog=myMatlabProgram.m ./run_matlab.sh
cd $PBS_O_WORKDIR
echo "Current working directory is now: " `pwd`
echo "Starting MATLAB at `date`"
# Be sure to include a "quit;" as the last line of the .m file.
echo "### prog = $prog ###"
# Deleted -nojvm to attempt matlabpool
/usr/local/bin/matlab -nodisplay -nodesktop -nojvm -nosplash -singleCompThread < $prog
echo "MATLAB run completed at `date`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment