Instructional cluster: submitting gaussian jobs with gsub

From Research Computing

Intro

On monad.gc.cuny.edu, the command gsub (gsub with a 'g' for gaussian, not the SGE command qsub with a 'q') is available for submitting single-threaded gaussian jobs. The command is intended to simplify job submission. The command gsub is invoked as follows:

gsub gaussian_input_file

where gaussian_input_file is a .com file.

Example


Source code of gsub

The SGE name parameter is ordinarily "hard coded" into the script. Accordingly, a "here document" is executed first, to create the input script for qsub, evaluating the name provided to gsub in the line

#$ -N $1

The standard output and standard error files for the job will have the form

$1.o$JOB_ID  and  $1.e$JOB_ID

respectively. The command

#$ -cwd

is asserted so that the script will leave its output in the directory from which it is executed, as opposed to the default directory, which is the user's home directory. The gsub code follows.

#!/bin/bash
if [ $# -ne 1 ]; then
  echo "Usage: gsub gaussianfile"
  exit
fi
qsub <<__HereDocument__
#!/bin/bash
#$ -S /bin/bash
#$ -cwd
#$ -N $1
 
export g03root=/usr/local/gaussian
. /usr/local/gaussian/g03/bsd/g03.profile
export SGE_ROOT=/usr/local/sge
.  /usr/local/sge/default/common/settings.sh
export GAUSS_SCRDIR=/tmp
 
g03 $1
__HereDocument__