How can I run Gaussian09 on a server?

What files do I need to run Gaussian on a compute node?

If your server uses SLURM to manage jobs, you will need both a Gaussian input file (.gau, .gzmat, etc.) and a .job file to tell the server how to manage and use your files.

Your Gaussian file should be formatted normally. Make sure to specify the number of processors, amount of memory, and a checkfile filename in your header. For example:

%nprocshared=16
%mem=8gb
%chk=File1.chk
#n B3LYP/6-31+G(d,p) opt

Your .job file must contain a few specifications. These include the number of processors and amount of memory, the location of the scratch directory on the server, and the location of the Gaussian program itself. This should look similar to:

#!/bin/bash
#SBATCH -n 16
#SBATCH --mem=9000
#SBATCH -p partitionname
#SBATCH -t 24:00:00

set -x
filename=File1
filetype=gzmat

## Telling the server where Gaussian is ##

module add path/to/Gaussian
unset PGI_TERM
prgname=g09 #Gaussian program name

## Setting up scratch and copying files ##

STORAGE_DIR="/scratch/users/you_username/${SLURM_JOB_ID}.${filename}"
GAUSS_SCRDIR=$STORAGE_DIR
export GAUSS_SCRDIR STORAGE_DIR
mkdir -pv $STORAGE_DIR
cd $STORAGE_DIR
cp $SLURM_SUBMIT_DIR/${filename}.${filetype} $STORAGE_DIR
for a in $extrafiles ; do cp -r $SLURM_SUBMIT_DIR/$a $STORAGE_DIR/ ;  done
cat ${filename}.${filetype}

##  Running Gaussian 09 and putting the output files back in your home directory ##

$prgname < ${filename}.${filetype} > ${filename}.out
cp -a $STORAGE_DIR $SLURM_SUBMIT_DIR

You will need to upload both of these files to the server via FTP (e.g. with FileZilla or similar), then submit the .job file on the cluster by logging in with SSH via Terminal or PuTTY, navigating to the folder where the files are stored, and running

sbatch filename.job
1 Like