Running Multicore/Multiprocessor Gaussian 09 Jobs via PBS/TORQUE

Andrew J. Pounds, Ph.D
Departments of Chemistry and Computer Science
Mercer University

When running across several nodes in a cluster, Gaussian 09 requires the names of all the processor nodes to be included in the Gaussian command file as an argument to the %LindaWorkers statement. This can be problematic in situations where a batch scheduler, like PBS or TORQUE, is being used because one never knows exactly which nodes are going to be allocated to the job. One workaround for this is to extract the names allocated to the job from PBS and explicitly place this information at the top of the Gaussian command file before running it. The only caveat to this is that the information must be properly formatted for the Gaussian command file before inclusion. These operations can also be done in the PBS/TORQUE script by piping the contents of the $PBS_NODEFILE through a series of Unix utils. The following example shows explicitly how this can be accomplished.



In the following PBS/TORQUE example script a Gaussian 09 job is going to be run that uses two cores per processor on four separate nodes of the "ithaca" cluster.

#PBS -N G09_JOB
#PBS -j oe
#PBS -l nodes=4:ithaca:ppn=2,walltime=1:00:00
#PBS -W stagein=/tmp/divsoh.com@zeus:/home/pounds/vinyl/divsoh.com
#PBS -W stageout=/tmp/divsoh.log@zeus:/home/pounds/vinyl/divsoh.log
#PBS -W stageout=/tmp/divsoh.chk@zeus:/home/pounds/vinyl/divsoh.chk
#
source $g09root/g09/bsd/g09.login
cd /tmp
echo -n "%LindaWorkers=" >GaussianNodeHeader
(echo `cat $PBS_NODEFILE`) | tr ' ' '\n' | sort | uniq | tr '\n' ',' | sed '{s/,$/\n/}' - >>GaussianNodeHeader
cp divsoh.com divsoh.com_hold
cat GaussianNodeHeader divsoh.com_hold >divsoh.com
rm GaussianNodeHeader
g09 divsoh


The important part of the original Gaussian job file is shown below. Note that the %NProcShared=2 is required to tell Gaussian to use two processors per node.

%NProcShared=2
%mem=1500MB
%chk=divsoh.chk
#MP2/6-31+G(2d,p) opt=tight

Gaussian job title.

Charge and Multiplicity goes here.
Coordinates start here.