Gaussian NRIS machines Job Examples
Note
Here we present tested examples for various job types on the different NRIS machines. This will be under more or less continoues development, and if you find things missing and/or not working as expected, do not hesitate to contact us.
Expected knowledge base
Before you run any Gaussian calculations, or any other calculations on NRIS machines for that matter, you are expected to update yourself on NRIS machinery specifics. A decent minimal curriculum is as follows:
Finding available Gaussian versions and submitting a standard Gaussian job
To see which versions of Gaussian software which are available on a given machine; type the following command after logged into the machine in question:
module avail Gaussian
To use Gaussian, type
module load Gaussian/<version>
specifying one of the available versions.
Please inspect the job script examples before submitting jobs!
To run an example - create a directory, step into it, create an input file (for example for water - see below), download one of the job scripts shown in the examples below and submit the script with:
$ sbatch saga_g16.sh
Gaussian input file examples
Water input example (note the blank line at the end;
water.com):
%chk=water
%mem=500MB
#p b3lyp/cc-pVDZ opt
structure optimization of water
0 1
O
H 1 0.96
H 1 0.96 2 109.471221
Caffeine input example (note the blank line at the end;
caffeine.com):
%chk=caffeine
%mem=5GB
#p b3lyp/cc-pVQZ
caffeine molecule example
0 1
C 1.179579 0.000000 -0.825950
C 2.359623 0.000000 0.016662
C 2.346242 0.000000 1.466600
C 0.000000 0.000000 1.440000
C 4.217536 0.000000 1.154419
C 4.765176 -0.384157 -0.964164
C 1.058378 -0.322767 3.578004
C -1.260613 -0.337780 -0.608570
N 1.092573 0.000000 2.175061
N 0.000000 0.000000 0.000000
N 3.391185 0.000000 1.965657
N 3.831536 0.000000 0.062646
O -1.345306 0.000000 1.827493
O 1.192499 0.000000 -2.225890
H -1.997518 -0.535233 0.168543
H -1.598963 0.492090 -1.227242
H -1.138698 -1.225644 -1.227242
H 0.031688 -0.271264 3.937417
H 1.445570 -1.329432 3.728432
H 1.672014 0.388303 4.129141
H 4.218933 -0.700744 -1.851470
H 5.400826 0.464419 -1.212737
H 5.381834 -1.206664 -0.604809
H 5.288201 0.000000 1.353412
Running Gaussian on Saga
On Saga there are some restrictions and tricky situations to consider. First and foremost, there is a heterogenous setup with some nodes having 52 cores and most nodes having 40 cores. Secondly, on Saga there is a 256 core limit, efficiently limiting the useful maximum amount of nodes for a Gaussian job to 6. And third, since you do share the nodes by default - you need to find a way to set resource allocations in a sharing environment not necessarily heterogenous across your given nodes.
Currently, we are working to find a solution to all these challenges and as of now our advices are:
Up to and including 2 nodes should can be done with standard advices for running jobs on Saga.
For 3 nodes and above you either need to run with full nodes or using the slurm exclusive flag: #SBATCH--exclusive. We prefer the latter due to robustness.
To facilitate this, the g16 wrapper has been edited to both be backwards compatible and adjust for the more recent insight on our side. If you are not using this wrapper, please look into the wrapper to find syntax for using in your job script. Wrapper(s) are all available in Gaussian Software folder. Current name is g16.ib.
Job script example (
saga_g16.sh):
#!/bin/bash -l
#SBATCH --account=nnXXXXk
#SBATCH --job-name=example
#SBATCH --time=0-00:05:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=40
#SBATCH --mem=32G
#SBATCH --output=slurm.%j.log
# make the program and environment visible to this script
module --quiet reset
module load Gaussian/g16_C.01
export GAUSS_LFLAGS2="--LindaOptions -s 20000000"
export PGI_FASTMATH_CPU=avx2
# name of input file without extension
input=water
# create the temporary folder
export GAUSS_SCRDIR=/cluster/work/users/$USER/$SLURM_JOB_ID
mkdir -p $GAUSS_SCRDIR
# copy input file to temporary folder
cp $SLURM_SUBMIT_DIR/$input.com $GAUSS_SCRDIR
# run the program
cd $GAUSS_SCRDIR
time g16.ib $input.com > $input.out
# copy result files back to submit directory
cp $input.out $input.chk $SLURM_SUBMIT_DIR
exit 0
Running Gaussian with Linda parallelization
Running Gaussian in Betzy and Olivia is slightly different than running it on Saga, and needs some one-time setup steps. These steps are outlined in Memory and Core Utilization. Following are just the example slurm sections and input files for some simple calculations.
Running Gaussian on Betzy
The input file (
water_Linda.com):
%chk=water
%mem=500MB
%NPROCSHARED=4
#p b3lyp/cc-pVDZ opt
structure optimization of water
0 1
O
H 1 0.96
H 1 0.96 2 109.471221
Note
Gaussian Defaults to 1 CPU if none are specified. Changing the variable --cpus-per-task in the submit script is not sufficient to increase the Gaussian’s CPU usage. The user must also change the line %NPROCSHARED in the input file with the correct number of CPUs needed. These only count the CPUs used per Linda single worker.
Job script example (
betzy_g16.sh):
#!/bin/bash -l
#SBATCH --account=nnXXXXk
#SBATCH --job-name=example
#SBATCH --time=0-00:10:00
#SBATCH --nodes=4
#SBATCH --ntasks-per-node=1 ## Linda does not use this variable
#SBATCH --output=slurm.%j.log
# make the program and environment visible to this script
module --quiet reset
module load Gaussian/16.C.01-AVX2
# name of input file without extension
input=water
# set the heap-size for the job to 20GB
export GAUSS_LFLAGS2="--LindaOptions -s 20000000"
export PGI_FASTMATH_CPU=avx2
# create the temporary folder
export GAUSS_SCRDIR=/cluster/work/users/$USER/$SLURM_JOB_ID
mkdir -p $GAUSS_SCRDIR
# add all nodes to list of known hosts
for HN in $(scontrol show hostnames "$SLURM_JOB_NODELIST")
do
mkdir -p ~/.ssh
touch ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts
ssh-keygen -R "$HN" 2>/dev/null || true
done
# copy input file to temporary folder and cd into it
cp $SLURM_SUBMIT_DIR/$input.com $GAUSS_SCRDIR
cd $GAUSS_SCRDIR
# Add line specifying the amount of Linda Workers per node to a temporary copy of the input file
# This starts one Linda worker per node.
NodeList=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | while read n ; do echo $n:1 ; done | paste -d, -s)
{
printf '%%LINDAWORKERS=%s\n' "$NodeList"
cat $input.com
} > job_runtime.com
#running the calculation
time g16 < job_runtime.com > $input.out
# copy result files back to submit directory
cp $input.out $input.chk $SLURM_SUBMIT_DIR
exit 0
Note
Since the minimum number of nodes per job is 4 in betzy, only heavy calculations should be ran such that each node’s CPU utilization is maximized. Saga and Olivia are better suited for smaller calculations.
Running Gaussian on Olivia
Here is an example of a script for running Gaussian on Olivia. The same input file is used.
The input file (“water_Linda.com`):
%chk=water
%mem=500MB
%NPROCSHARED=4
#p b3lyp/cc-pVDZ opt
structure optimization of water
0 1
O
H 1 0.96
H 1 0.96 2 109.471221
Job script example (
olivia_g16.sh):
#!/bin/bash -l
#SBATCH --account=nnXXXXk
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --time=0-00:15:00
#SBATCH --cpus-per-task=8 # change this when more cores are needed
#SBATCH --mem-per-cpu=2GB
#SBATCH --job-name=example
#SBATCH --output=slurm.%j.log
# make the program and environment visible to this script
module restore
module load NRIS/CPU
module load Gaussian/16.C.01-AVX2
module list
# name of input file without extension
input=water
# set the heap-size for the job to 20GB
export GAUSS_LFLAGS2="--LindaOptions -s 20000000"
export PGI_FASTMATH_CPU=avx2
# create the temporary folder
export GAUSS_SCRDIR=/cluster/work/projects/nnXXXXk/$USER/$SLURM_JOB_ID
mkdir -p $GAUSS_SCRDIR
# copy input file to temporary folder and cd into the temporary folder
cp $SLURM_SUBMIT_DIR/$input.com $GAUSS_SCRDIR
cd $GAUSS_SCRDIR
# add all nodes to list of known hosts
for HN in $(scontrol show hostnames "$SLURM_JOB_NODELIST")
do
mkdir -p ~/.ssh
touch ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts
ssh-keygen -R "$HN" 2>/dev/null || true
done
# Add line specifying the amount of Linda Workers per node to a temporary copy of the input file
# this starts 4 linda workers per node.
NodeList=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | while read n ; do echo $n:4 ; done | paste -d, -s)
{
printf '%%LINDAWORKERS=%s\n' "$NodeList"
cat $input.com
} > job_runtime.com
# run the program
time g16 < job_runtime.com > $input.out
# copy result files back to submit directory
cp $input.out $input.chk $SLURM_SUBMIT_DIR
exit 0