Gaussian g09

See also

Gaussian Supports GPGPUs! Read about our Nvidia Tesla K20 GPGPU card. Gaussian Supports Parallelization! Read the example: Parallelization With Linda

The Gaussian software is installed on linux clusters and is available for use if you are authorized to use the available license. You must be added to the gaussian unix group in order to run g09 which should be specifically requested when requesting a research account.

Setting up g09

g09 requires some simple modifications to your user environment. Add the following to to your ~/.bashrc file:

g09root="/share/apps"
GAUSS_SCRDIR=/scratch/$USER/gaussian_scratch
export g09root GAUSS_SCRDIR
source $g09root/g09/bsd/g09.profile

The $GAUSS_SCRDIR env variable is used as the Gaussian scratch folder. For now, leave this in your home directory and keep an eye on its size and clean up old files.

Testing Gaussian

Warning

Guassian will not run on the gravel.rc.pdx.edu cluster due to the lack of the SSE4_2 CPU instruction set.

You can test to make sure g09 is working properly and your environment is set up correctly by setting up a simple g09 test and then writing a schelulings script to submit the job to slurm, the cluster scheduler. The following is a simple test:

Download g09-test.gjf

%nprocshared=8
%mem=2GB
%chk=test2.chk
# opt hf/sto-3g nosymm

Title Card Required

0 1
 O                 -0.37773358   -0.54671967    0.00000000
 H                  0.58226642   -0.54671967    0.00000000
 H                 -0.69818817    0.35821616    0.00000000

This test file will run a single g09 job using 8 threads and 4Gb of memory.

Next set up a simple slurm script to schedule your your g09 job. Set up a simple bash script with some special directives in the header to do this:

Download g09-slurm.sh

#!/bin/sh
#SBATCH --job-name=g09-test

# max run time
#SBATCH --time=10:00:00

# The number of compute nodes to request
# g09 only needs 1 node per job, but n tasks that you specify with %nprocshared
# Figure out the optimal number of nprocshared per task for your
# job through benchmarking. You can also request exclusive mode with the --exlusive
# flag.

#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8

# Specify slurm partition
#SBATCH --partition main

# command to run
srun g09 g09-test.gjf

To enqueue the job run:

sbatch g09-slurm.sh

Now check the queue to see if your job has been accepted:

squeue

We can keep an eye on activity using:

sinfo

or by visiting the ganglia monitoring tool.

For a more extensive test try the following g09 file which will fail on servers without the correct CPU instutions required by gaussian:

Download l2-PtCl-td.gjf

%nprocshared=8
%mem=4GB
%chk=l2-PtCl-td.chk
# td=(nstates=30) b3lyp/gen nosymm pseudo=read

Title Card Required

0 1
 C                 -1.42605900   -1.78595500    4.47177600
 C                 -0.23700600   -1.48797500    3.81418000
 C                 -0.29248900   -0.27930700    3.09516400
 C                 -1.52624800    0.35385000    3.19048400
 H                  0.62060900   -2.14434300    3.87326900
 C                  0.66670500    0.52939000    2.22266900
 C                 -0.23501800    1.70545400    1.85006000
 C                 -0.10957800    2.87803500    1.08184600
 C                 -1.27206400    3.64213600    1.05907300
 C                 -1.49221900    1.56565900    2.42647200
 H                  0.78006800    3.18781600    0.55060700
 C                 -1.75229000   -2.91978600    5.31788500
 C                 -0.85909500   -4.04433300    5.49068200
 C                 -2.94371100   -3.00911400    6.02677900
 C                 -1.21536400   -5.16654500    6.35238300
 C                 -3.28390500   -4.10205100    6.85863200
 H                 -3.65868200   -2.19379000    5.96631200
 C                 -2.46759200   -5.20170900    7.05831100
 H                 -4.22896400   -4.04680100    7.39045100
 C                 -1.54074000    4.89299300    0.37319500
 C                 -0.51768600    5.62641500   -0.33980000
 C                 -2.80041400    5.47825500    0.34518700
 C                 -0.82312000    6.87784500   -1.02697200
 C                 -3.08876900    6.69382500   -0.31880600
 H                 -3.62783800    4.98014700    0.84184100
 C                 -2.14911900    7.43416300   -1.01507200
 H                 -4.11795700    7.03898800   -0.29835400
 C                 -2.87063400   -6.32159500    7.93702000
 C                 -4.22691700   -6.68574900    8.03873200
 C                 -1.93719200   -7.03494100    8.71300700
 C                 -4.63955400   -7.70650100    8.89167000
 H                 -4.96623200   -6.18169500    7.42386500
 C                 -2.34468500   -8.05808000    9.56514400
 H                 -0.88544100   -6.78650800    8.64939500
 C                 -3.69744600   -8.39719900    9.66211300
 H                 -5.69139300   -7.97317500    8.95025200
 H                 -1.61842800   -8.59836600   10.16537700
 C                 -2.50499900    8.70175300   -1.68959300
 C                 -3.50199100    9.53591200   -1.14772800
 C                 -1.89430700    9.10280300   -2.89295100
 C                 -3.89244200   10.70928900   -1.78672900
 H                 -3.96281900    9.27711200   -0.19962400
 C                 -2.27833300   10.27867300   -3.53331000
 H                 -1.11376900    8.49118400   -3.32734000
 C                 -3.28359100   11.08486900   -2.98775600
 H                 -4.66050400   11.34575300   -1.35722400
 H                 -1.79639900   10.56850500   -4.46318100
 N                 -4.07171900   -9.46401200   10.56574500
 N                 -3.71840300   12.31202500   -3.61981100
 N                  0.33329500   -4.19313600    4.90581000
 N                 -0.27926800   -6.12260300    6.38220100
 N                  0.76660100    5.27319100   -0.44420800
 N                  0.24485600    7.42269900   -1.62245700
 S                  1.51690500    6.42886500   -1.33477900
 S                  0.94299900   -5.63128500    5.40797100
 C                 -4.40664900   -9.12127000   11.89377000
 C                 -5.17687700   -7.97634800   12.14869900
 C                 -4.34283600   -9.60182700   14.18091500
 C                 -5.52467100   -7.65712900   13.45343900
 H                 -5.49773100   -7.35662900   11.32218300
 C                 -5.11585900   -8.49577900   14.49102200
 H                 -3.94932900  -10.26511200   14.93926400
 H                 -6.12431200   -6.77400000   13.65325000
 H                 -5.37415200   -8.29592600   15.52481600
 C                 -4.14362400  -10.77913600   10.05825100
 C                 -4.68450600  -11.01234700    8.78449100
 C                 -4.78242200  -12.31116700    8.30628300
 H                 -5.02587500  -10.17595000    8.18967400
 C                 -3.81232100  -13.07506900   10.35141900
 C                 -4.35769000  -13.36762500    9.11300500
 H                 -5.20418400  -12.49517500    7.32259600
 H                 -3.41484000  -13.83993100   11.00480500
 H                 -4.42850700  -14.39991700    8.78939000
 C                 -4.72718300   12.23479500   -4.60446800
 C                 -4.73955000   11.17103400   -5.51991100
 C                 -6.61586700   13.15471800   -5.63177100
 C                 -5.71757200   11.12029600   -6.50294900
 H                 -3.98134700   10.40268900   -5.45488900
 C                 -6.66488300   12.14225100   -6.57481300
 H                 -7.34871100   13.94933500   -5.59551200
 H                 -5.72584300   10.30085900   -7.21559900
 H                 -7.43919500   12.15381300   -7.33353800
 C                 -3.04183100   13.50639100   -3.28964600
 C                 -1.65018900   13.49879100   -3.10856300
 C                 -3.09417500   15.80897000   -2.88832600
 C                 -0.98894500   14.68226400   -2.81294000
 H                 -1.10503200   12.56981000   -3.20764500
 C                 -1.72118400   15.86649500   -2.71981700
 H                 -3.72850700   16.67813400   -2.77830800
 H                  0.08841800   14.68018200   -2.67644900
 H                 -1.24743500   16.81777900   -2.50536000
 N                 -3.74790900   14.64913000   -3.13885600
 N                 -3.67841900  -11.80553800   10.80506300
 C                  1.90408000    0.99546100    3.02272300
 H                  1.60934300    1.56239600    3.91115000
 H                  2.49848300    0.13329700    3.34569400
 H                  2.54291900    1.63447500    2.40267500
 C                  1.10500100   -0.26760300    0.97312800
 H                  1.68603700   -1.14965400    1.26503600
 H                  0.23864600   -0.60305700    0.39464700
 H                  1.73363000    0.35254100    0.32412300
 N                 -5.68518500   13.18764500   -4.64808200
 N                 -3.97023600   -9.89597400   12.91206600
 S                 -2.54644600    2.87372600    2.03405300
 S                 -2.64337900   -0.52444300    4.16929700
 Cl                -1.13350700  -13.17743500   12.06869000
 Cl                -1.47762200  -10.95005100   14.54071300
 Cl                -5.89484700   16.20066100   -1.42115400
 Cl                -8.16395200   14.48562700   -3.18515200
 Pt                -2.64648100  -11.43798500   12.55368200
 Pt                -5.81082900   14.60832300   -3.15575700

Pt 0
Lanl2dz
****
C H Cl N S 0
6-31G(d)
****

Pt 0
Lanl2dz





Try editing or copying the g09-slurm.sh to point to the l2-PtCl-td.gjf file and launch a second job on the scheduler.

Parallelization With Linda

Gaussian g09 jobs can be run in parallel across multiple nodes which may increase performance and decrease runtime of jobs if done correctly. Documentation is spotty, but here is a sample to help you started. More information can be found in the dynamic hostfile example.

A few more notes from the developers:

  • “%NProcs=” (short for “%NProcShared”) in the input file requests the number of cores (processors) to use via shared-memory parallelization (number per Linda worker)
  • It is also possible to pass the number as an environment variable e.g. “GAUSS_PDEF=16” for 16 shared-memory cores.
  • “%NProcShared=” in the input takes precedence over “GAUSS_PDEF”, so one could override the latter by setting “%NProcShared” in the input file.

Download g09-slurm.sh

#!/bin/bash
#SBATCH --job-name=g09-test

# max run time
#SBATCH --time=10:00:00


# 4 servers, 1 linda worker per server, 16 CPUs per linda worker
#SBATCH --nodes=4
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=16

# Specify slurm partition
#SBATCH --partition main

# activate bash debugging from here
set -x

# Name of your gjf file ie l2-PtCl-td.gjf
JobFile=l2-PtCl-td

# This creates a list of nodes that you job received to run on
LindaList=./nodes_linda.$SLURM_JOBID
touch $LindaList

# This creates a jobfile
JobName=./${JobFile}${SLURM_JOBID}.gjf
touch $JobName

# Create a list of hostnames and save it to the LindaList machine file
srun hostname -s | sort -u > $LindaList

# Tell linda to use ssh
export GAUSS_LFLAGS=' -opt "Tsnet.Node.lindarsharg: ssh"'

# Read the contents of the machine file and put it in the job file
workers="%LindaWorkers="$(cat $LindaList | tr "\n" "," | sed "s/,$//")

# Write that out to the job file
cat <(echo -e "${workers}\r") ./$JobFile.gjf > $JobName

# Run gaussian using our job file and output to a matching results file
g09 /scratch/bcomnes/g09/linda/${JobFile}${SLURM_JOBID}.gjf /scratch/bcomnes/g09/linda/foo${SLURM_JOBID}.txt