UITS

UA Home UITS Home UA Search
Modified: Mar 27 2003

Batch Script Examples

A Simple Script

This script will run a Gaussian job in the batch_12hr queue.
#!/bin/csh
   ### name of the job
#PBS -N test_12hr  
   ### send mail about the job
#PBS  -m bea       
  ### send mail to user
#PBS  -M  your_Netid@email.arizona.edu 
  ### name of the queue
#PBS  -q batch_12hr  
  ### resource limits
  ### cputime per process and total cputime
#PBS -l pcput=12:0:0,cput=12:0:0  
  ### change to my working directory (see xdisk)
cd /xdisk/your_Netid 
./my-executable < my-input > my-output

Gaussian Example

This script will run a Gaussian job in the batch_12hr queue.
#!/bin/csh

  ### name of the job
#PBS -N test_12hr      
  ### send mail about the job
#PBS  -m bea              
  ### send mail to user
#PBS  -M  your_Netid@email.arizona.edu 
  ### No checkpoint
#PBS  -c n                  
  ### Do Not restart the job
#PBS -r n                 
  ### name of the queue
#PBS  -q batch_12hr          
  ### resource limits
  ### cputime per process and total cputime
#PBS -l pcput=12:0:0,cput=12:0:0  
set SCR = /scratch/your_Netid

setenv GAUSS_ARCDIR $SCR/SCR
setenv GAUSS_EXEDIR $SCR/bin
setenv GAUSS_SCRDIR $SCR/SCR
setenv LD_LIBRARY64_PATH $SCR/bin
 
cd /scratch/your_Netid

date
time $GAUSS_EXEDIR/g98  water-.dat
date

Xterm Example

#!/bin/csh

#PBS  -m bea
#PBS  -M  your_Netid@email.arizona.edu
#PBS  -c n

setenv DISPLAY dyer.rc.arizona.edu:0

exec /usr/bin/X11/xterm

SAS Example

#!/bin/csh

#PBS  -m bea
#PBS  -M  your_Netid@email.arizona.edu
  ###  By default the "work" directory 
  ###    is located in /tmp/SASWORK
cd my-working-directory

sas file.sas 

Matlab Example

#!/bin/csh

#PBS  -m bea
#PBS  -M  your_Netid@email.arizona.edu

cd my-working-directory

setup matlab6

  ### Clear the DISPLAY.
unsetenv DISPLAY
  ### Call MATLAB with the appropriate input and output,
  ### make it immune to hangups and quits using "nohup",
  ### and run it in the background.
nohup matlab < testmatlab.m > output 

U-System Information
UA Homepage      UITS Homepage
The Center for Computing & Information Technology (UITS)
UITS Knowledgebase
Telephone: 621-HELP
Email: Consult@listserv.arizona.edu

Website maintained by:
UITS Computing Services