'UNSW - Science

UNSW - Science - HPC

Application Specific Katana PBS Examples

Matlab PBS Examples

Whilst you are working on making sure that your MATLAB code works on the cluster, the module command is being loaded correctly and you are referring to the right location for files you may want to use the following line to request an interactive terminal for 2 hours with 8Gb of memory.

z1234567@kc01b02:~$ qsub -I -l nodes=1:ppn=1,vmem=8gb,walltime=2:00:00

and once you have a terminal (and you know which version of MATLAB you want to run having used the module avail command you can run the following module add command to load the MATLAB module

z1234567@kc01b02:~$ module add matlab/2104b

SAS PBS Examples

Whilst you are working on making sure that your SAS code works on the cluster, the module command is being loaded correctly and you are referring to the right location for files you may want to use the following line to request a short term interactive terminal.

z1234567@kc01b02:~$ qsub -I -l nodes=1:ppn=1,vmem=8gb,walltime=1:00:00

and once you have a terminal you can run

z1234567@kc01b02:~$ module add sas
z1234567@kc01b02:~$ sas -nodms

To run a SAS program that you prepared earlier in your interactive terminal you type the following.

z1234567@kc01b02:~$ module add sas
z1234567@kc01b02:~$ sas program.sas

To use any of the following job scripts on Katana save the job script as myjob.pbs and then submit it by typing

qsub myjob.pbs

The following Katana PBS script requests 1 CPU core with a maximum of 4Gb of memory for a job that runs for up to 12 hours. This job script uses the module command to load the SAS application when the job script is run.

#!/bin/bash
 
#PBS -N MySASprog
#PBS -l nodes=1:ppn=1
#PBS -l vmem=4gb
#PBS -l walltime=12:00:00
#PBS -j oe
 
cd $PBS_O_WORKDIR
 
module add sas
 
sas program.sas 

In the next example we have added the module command to the .bashrc to simplify the job script and are also making use of an input file.

#!/bin/bash
 
#PBS -N MySASprog
#PBS -l nodes=1:ppn=1
#PBS -l vmem=4gb
#PBS -l walltime=12:00:00
#PBS -j oe
 
cd $PBS_O_WORKDIR
 
cat myinput.txt | sas program.sas 

If you want to make use of local scratch for better performance then you can use prologue and epilogue scripts to copy files to and from local scratch. For more details look at the Local Scratch page.

#!/bin/bash
 
#PBS -N SCRATCH
#PBS -l nodes=1:ppn=1
#PBS -l vmem=6gb
#PBS -l walltime=4:00:00
#PBS -l file=50gb
#PBS -j oe
 
#PBS -l prologue=/srv/scratch/z1234567/prologue
#PBS -l epilogue=/srv/scratch/z1234567/epilogue
 
cd $PBS_O_WORKDIR
 
sas program.sas

Stata PBS Examples

Whilst you are working on making sure that your Stata code works, the module command is being loaded correctly and you are referring to the right location for files you may want to use the following line to request a short term interactive terminal.

qsub -I -l nodes=1:ppn=1,vmem=8gb,walltime=1:00:00

The following Katana PBS script requests 1 CPU core with a maximum of 4Gb of memory for a job that runs for up to 12 hours. This job script assumes that you have added the module command to your .bashrc so that Stata is automatically loaded each time that a new terminal is opened.

#!/bin/bash
 
#PBS -N MyStataJob
#PBS -l nodes=1:ppn=1,vmem=4gb
#PBS -l walltime=12:00:00 
#PBS -j oe
 
cd $PBS_O_WORKDIR 
 
stata -b do StataClusterWorkshop.do 

The following PBS script requests 1 CPU core with a maximum of 8Gb of memory for a job that runs for up to 9 hours and will email you when the script is finished. It will also load Stata 12 after unloading any modules that are automatically loaded in a new terminal.

#!/bin/bash
 
#PBS -N MyStataJob
#PBS -l nodes=1:ppn=1,vmem=8gb
#PBS -l walltime=9:00:00 
#PBS -j oe
#PBS -M fred.bloggs@unsw.edu.au
#PBS -m ae
 
module purge
module add stata/12
 
cd $PBS_O_WORKDIR 
 
stata -b do StataClusterWorkshop.do