---
title: "Gaussian G16"
canonical: "https://kb.uconn.edu/space/SH/26566623334/Gaussian%20G16"
format: markdown
---
Gaussian is a series of electronic structure programs that the Department of Chemistry has purchased and granted access to on HPC. 

Access to gaussian is limited to specific users that need to be added to a special gaussian group to be able to run gaussian.

If you would like to run gaussian, feel free to email HPC at [hpc@uconn.edu](mailto:hpc@uconn.edu) requesting access to the gaussian group.

This guide will provide the steps needed to run Gaussian G16 calculations on HPC.

## Setting up the Gaussian G16 environment

Gaussian requires a couple of environmental variables set to be able to point to the correct locations were certain required settings are located.

Edits would need to be added to a file called .gaussian_env or update the .bashrc file under a user’s home directory.

```
export g16root=/gpfs/software/RHEL9/gaussian
#export g16root=/gpfs/sharedfs1/admin/hpc2.0/apps/gaussian
source $g16root/g16/bsd/g16.profile
export GAUSS_SCRDIR=/gpfs/scratchfs1/gaussian16

#GaussView
#export GV_DIR=/gpfs/sharedfs1/admin/hpc2.0/apps/gaussian/gaussian16/gv
#export GV_DIR=/gpfs/sharedfs1/admin/hpc2.0/apps/gaussian/g16/gv
export GV_DIR=/gpfs/software/RHEL9/gaussian/g16/gv
alias gview='$GV_DIR/gview.sh'

```

To create and open the new .gaussian_env file through the VI editor, the following command can be used:

```
vi ~/.gaussian_env
```

When the .gaussian_env file loads, copy and paste the following lines:

```
#COMMANDS FOR GAUSSIAN AND NBO

#module purge
#module load gaussian/g16 nbo/7.0

export GAUSS_SCRDIR=/gpfs/scratchfs1/gaussian16
export g16root=/gpfs/software/RHEL9/gaussian
source $g16root/g16/bsd/g16.profile

export GV_DIR=/gpfs/software/RHEL9/gaussian/g16/gv
```

To save and quit out of Vi editor, type the following:

```
:wq!
```

Once the file is saved, the next section in this guide will provide an example job submission script that can be used to submit Gaussian g16 jobs on HPC

## Bash submission script

Here is an example to submit a Gaussian G16 job using 12 cores and submit to the general partition:

```
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=12
#SBATCH --partition=general

module purge
module load gaussian/g16
source /gpfs/homefs1/yournetidhere/.gaussian_env

g16 InputFileNameHere.com

```

If the output would like to be redirected to a different file name, the following g16 command can be used:

```
g16 < InputFileNameHere.com > OutputFile.out
```

## GaussView

Gaussian G16 has a separate GUI viewer that can be launched on HPC as well.

To allow for GaussView GUI functionality, a connection with X11 forwarding would need to be established to HPC.

When X11 is enabled and the connection to HPC is established, here are the steps to submit an interactive SLURM job on HPC:

Pick one of the following (not both): 

SRUN:

```
srun --x11 -N 1 -n 126 -p general --exclude=cn[473-479] --pty bash
....
....
Wait for a node to assign to the srun job.
```

Once a node is assigned to the srun interactive SLURM job, the gaussian/g16 module can be loaded and GaussView launched:

```
[netidhere@cnXX ~]$ module load gaussian/g16
[netidhere@cnXX ~]$ gview.exe
```

The GaussView GUI should load and look like the following:

![image](media://cf6bf1f8-5bdd-40e5-927f-f6bd0f76a802)

Once the GaussView calculation is finished, exit out of the GaussView window, type the word **exit** to exit out and end the interactive SLURM job to free up resources for other users.