Difference between revisions of "HowTo:gaussian"

From CAC Wiki
Jump to: navigation, search
(Gaussian)
(Licensing)
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Gaussian =
+
== Gaussian ==
  
 
Gaussian is arguably the most commonly used computational quantum-chemistry program. It offers a wide range of features on the field of computational chemistry, ranging from atomic and molecular structure to thermochemical computations. [[HowTo:gaussian:release|See these release notes for features.]]
 
Gaussian is arguably the most commonly used computational quantum-chemistry program. It offers a wide range of features on the field of computational chemistry, ranging from atomic and molecular structure to thermochemical computations. [[HowTo:gaussian:release|See these release notes for features.]]
Line 7: Line 7:
 
{|  style="border-spacing: 8px;"
 
{|  style="border-spacing: 8px;"
 
| valign="top" width="50%" style="padding:1em; border:1px solid #aaaaaa; background-color:#e1eaf1; border-radius:7px" |  
 
| valign="top" width="50%" style="padding:1em; border:1px solid #aaaaaa; background-color:#e1eaf1; border-radius:7px" |  
== Features ==
+
=== Features ===
  
 
Gaussian does electronic-structure calculations and standard quantum chemical calculations. Among the methods available are simple molecular mechanics (such as Amber force field), semi-empirical methods (such as CNDO), Hartree-Fock (restricted and unrestricted), MPn (Mollar-Plesset perturbation theory of order n=2,3,4), CI (Configuration-Interaction), CC (Coupled-Cluster), Multi-configurational SCF (such as CAS-SCF) and various DFT (Density-Functional Theory) methods. Specific to Gaussian are high-accuracy energy methods (G2, CBS). It can be used to obtain electronic properties, molecular geometries, vibrational frequencies, orbitals, reaction profiles, and much more.  [[HowTo:gaussian:release|Check out the capabilities here.]]
 
Gaussian does electronic-structure calculations and standard quantum chemical calculations. Among the methods available are simple molecular mechanics (such as Amber force field), semi-empirical methods (such as CNDO), Hartree-Fock (restricted and unrestricted), MPn (Mollar-Plesset perturbation theory of order n=2,3,4), CI (Configuration-Interaction), CC (Coupled-Cluster), Multi-configurational SCF (such as CAS-SCF) and various DFT (Density-Functional Theory) methods. Specific to Gaussian are high-accuracy energy methods (G2, CBS). It can be used to obtain electronic properties, molecular geometries, vibrational frequencies, orbitals, reaction profiles, and much more.  [[HowTo:gaussian:release|Check out the capabilities here.]]
  
== Location of the program and setup ==
+
=== Location of the program and setup ===
  
The program resides in '''/opt/gaussian'''. Multiple versions and revisions of the program are located in different sub-directories. The name of the root executable is '''g16'''.
+
The program resides in '''/global/software/gaussian'''. Multiple versions and revisions of the program are located in different sub-directories. The name of the root executable is '''g16'''.
  
 
The source code of Gaussian is not publicly accessible since Gaussian is a licensed product. However, Gaussian grants the permission to alter the code under certain conditions. If you want to do so, contact us to learn more. You are '''not''' allowed to copy the executable or any part of the distribution onto your local machine.
 
The source code of Gaussian is not publicly accessible since Gaussian is a licensed product. However, Gaussian grants the permission to alter the code under certain conditions. If you want to do so, contact us to learn more. You are '''not''' allowed to copy the executable or any part of the distribution onto your local machine.
  
At present, we are using the '''usepackage system''' to set up Gaussian. This means that typing
+
On Frontenac, we are using the '''module''' (lmod) system to set up Gaussian. This means that typing
  
<pre> use g16 </pre>
+
<pre> module load gaussian </pre>
  
 
is automatically adding all required settings to your shell set-up.
 
is automatically adding all required settings to your shell set-up.
Line 27: Line 27:
 
One of the settings is the environment variable '''GAUSS_SCRDIR''' which is required to redirect the temporary files that Gaussian uses to the proper scratch space, presently  
 
One of the settings is the environment variable '''GAUSS_SCRDIR''' which is required to redirect the temporary files that Gaussian uses to the proper scratch space, presently  
  
<pre>export GAUSS_SCRDIR=/scratch/hpcXXXX</pre>
+
<pre>
 +
export GAUSS_SCRDIR=/global/scratch/hpcXXXX  
 +
</pre>
  
 
where hpcXXXX stands for your username. If for some reason Gaussian does not terminate normally (e.g. a job gets cancelled), it leaves behind large '''scratch files''' which you may have to delete manually. To check if such files exist, type
 
where hpcXXXX stands for your username. If for some reason Gaussian does not terminate normally (e.g. a job gets cancelled), it leaves behind large '''scratch files''' which you may have to delete manually. To check if such files exist, type
  
<pre>ls -lt /scratch/hpcXXXX</pre>
+
<pre>
 +
$ ls $GAUSS_SCRDIR
 +
Gau-88477.chk  Gau-88477.int  Gau-88477.skr 
 +
Gau-88477.d2e  Gau-88477.rwf 
 +
</pre>
  
 
Once you have determined that the scratch files are no longer needed (because the program that used them is not running any more), you can delete them by typing
 
Once you have determined that the scratch files are no longer needed (because the program that used them is not running any more), you can delete them by typing
  
<pre>rm /scratch/hpcxxxx/Gau-*</pre>  
+
<pre>
 +
$ rm $GAUSS_SCRDIR/Gau-*
 +
$ ls $GAUSS_SCRDIR
 +
$
 +
</pre>  
  
 
Cleaning up the scratch space is the user's responsibility. If it is not done regularly, it can cause jobs to terminate, and much work to be lost.
 
Cleaning up the scratch space is the user's responsibility. If it is not done regularly, it can cause jobs to terminate, and much work to be lost.
 
|}
 
|}
 
{|  style="border-spacing: 8px;"
 
{|  style="border-spacing: 8px;"
| valign="top" width="50%" style="padding:1em; border:1px solid #aaaaaa; background-color:#f7f7f7; border-radius:7px" |  
+
| valign="top" width="50%" style="padding:1em; border:1px solid #aaaaaa; background-color:#f7f7f7; border-radius:7px" |
 +
 
 
== Running Gaussian from a command line==
 
== Running Gaussian from a command line==
  
To run Gaussian on our systems, you have to belong to a '''user group g98''' (it's called that for historical reason, but it applies to all versions of Gaussian). You need to read our license agreement and [http://cac.queensu.ca/wp-content/files/cac-gaussian-statement.pdf signed a statement] to be included in this user group. Once you are, you can access the executables.
+
To run Gaussian on our systems, you have to belong to a '''user group g98''' (it's called that for historical reason, but it applies to all versions of Gaussian). You need to read our license agreement and [https://info.cac.queensu.ca/wiki/files/cac-gaussian-statement.pdf signed a statement] to be included in this user group. Once you are, you can access the executables.
  
 
A computation is performed by preparing an input file and pipe it to standard input of the program '''g16'''. Standard output should be caught in a log-file. We suggest you use the '''extensions''' ''.g16 for input'' files and ''.log for results''.
 
A computation is performed by preparing an input file and pipe it to standard input of the program '''g16'''. Standard output should be caught in a log-file. We suggest you use the '''extensions''' ''.g16 for input'' files and ''.log for results''.
Line 75: Line 86:
 
'''Note:''' It is absolutely essential to have a good idea about the size and complexity of your calculations before you start a Gaussian job. Many of the methods mentioned above have terrible scaling properties, i.e. the computational cost grows very quickly with the number of electrons, degrees of freedom, or number of basis functions used. We suggest you start with a small basis set and a cheap method, and then slowly increase those parameters.
 
'''Note:''' It is absolutely essential to have a good idea about the size and complexity of your calculations before you start a Gaussian job. Many of the methods mentioned above have terrible scaling properties, i.e. the computational cost grows very quickly with the number of electrons, degrees of freedom, or number of basis functions used. We suggest you start with a small basis set and a cheap method, and then slowly increase those parameters.
  
== Submitting (parallel) Gaussian jobs ==
+
=== Submitting (parallel) Gaussian jobs ===
  
 
If you want to run Gaussian on several processors on our machines, you have to include a line in your input file:
 
If you want to run Gaussian on several processors on our machines, you have to include a line in your input file:
Line 83: Line 94:
 
where we assume that you want to use 8 processors (cores, threads).
 
where we assume that you want to use 8 processors (cores, threads).
  
'''It is mandatory to submit a Gaussian job script through our scheduling software''' (see our [[HowTo:Scheduler|Scheduler Help File]] for details).  
+
'''It is mandatory to submit a Gaussian job script through our scheduling software'''.
  
Here is a "bare bones" sample of a Gaussian submission script:
+
==== On Frontenac ====
 +
 
 +
On Frontenac, you need to submit your Gaussian parallel production job through the SLURM scheduler (see our [[SLURM|Scheduler Help File]] for details).
 +
This is done in the form of a script file. Here is a "bare bones" sample:
  
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
#$ -S /bin/bash
+
#SBATCH --job-name=Gaussian_test
#$ -V
+
SBATCH --mail-type=ALL
#$ -cwd
+
#SBATCH --mail-user=myEmail@whatever.com
#$ -M email.adress@whatever.com
+
#SBATCH --output=STD.out
#$ -m be
+
#SBATCH --error=STD.err
#$ -pe glinux.pe 4
+
#SBATCH --nodes=1
#$ -o STD.out
+
#SBATCH --ntasks=1
#$ -e STD.err
+
#SBATCH --cpus-per-task=8
. /opt/gaussian/setup.sh
+
#SBATCH --time=30:00
g16 < sample.g16 > sample.log
+
#SBATCH --mem=1000
 +
module load gaussian
 +
export GAUSS_SCRDIR=$TMPDIR
 +
g16 < test.g16 > test.log
 
</pre>
 
</pre>
  
* The first 6 lines of the script make sure the right shell is used, the program executes on the correct cluster, and all necessary setup is done.
+
* The "module" line makes sure the necessary setup is done.
* An email address for notifications is specified in the '''#$ -M''' line. We suggest "hpcXXXX@localhost" (hpcXXXX stands for the username). Place a file '''.forward''' containing your actual email address into your home directory.   
+
* Email notifications are set up in the "--mail-type" and "--mail-user lines". We suggest "hpcXXXX@localhost" (hpcXXXX stands for the username). Place a file '''.forward''' containing your actual email address into your home directory.   
* The '''-o''' and '''-e''' lines are used to tell the system where to write "standard output" and "standard error", i.e. the screen output.
+
* The '''--ooutput''' and '''--error''' lines are used to tell the system where to write "standard output" and "standard error", i.e. the screen output.
* The '''#$ -pe glinux.pe 4''' line specifies the number of processors the scheduler will allocate (4 in this example). It is crucial to choose the same number as specified in the '''%nrocs=''' line of the input file.  
+
* The '''--ntasks''' and '''--nodes''' options are kept at 1 and indicate that only one main process is running on a single node.
 +
* The '''--cpus-per-task''' line specifies the number of cores the scheduler will allocate (4 in this example). It is crucial to choose the same number as specified in the '''%nrocs=''' line of the input file.
 +
* The "export" line resets the scratch space to a temporary directory that is created at run time. This ensures that left-over scratch files are erased if the program terminates.
  
The script (let's call it g16.sh) is submitted by the qsub command:
+
The script (let's call it g16.sh) is submitted by the sbatch command:
  
<pre>qsub g16.sh</pre>
+
<pre>sbatch g16.sh</pre>
  
This must be done from the working directory, i.e. the directory that contains the input file and is supposed to contain the output. Also make sure that you have set up Gaussian ('''use g16''') before you submit a job and that you are working from the Linux logion node swlogin1.
 
 
'''Important''': The Gaussian software has recently moved from the Solaris to the Linux platform. Submission of jobs '''must''' be done from swlogin1, not from sflogin0.
 
 
|}
 
|}
 
{|  style="border-spacing: 8px;"
 
{|  style="border-spacing: 8px;"
 
| valign="top" width="50%" style="padding:1em; border:1px solid #aaaaaa; background-color:#e1eaf1; border-radius:7px" |
 
| valign="top" width="50%" style="padding:1em; border:1px solid #aaaaaa; background-color:#e1eaf1; border-radius:7px" |
  
== Migration from Sparc/Solaris ==
+
== Migration from SW cluster to Frontenac ==
  
Until August 2016, the Gaussian software was being run on the Sparc/Solaris platform, on our M9000 servers (specifically, m9k0002) which are now de-commissioned. The following is a list of changes that took place when running on the x86/Linux platform.
+
The following is a list of differences concerning Gaussian usage on the SW cluster vs the new Frontenac cluster. The main impact comes from the different scheduler.
  
 
{| class="wikitable" style="float:left; margin-right: 25px;"
 
{| class="wikitable" style="float:left; margin-right: 25px;"
!colspan="3"| '''Changes when migrating from Sparc/Solaris to x86/Linux'''
+
!colspan="3"| '''Changes when migrating from SW cluster (SGE) to Frontenac (SLURM)'''
 
|-
 
|-
 
|  
 
|  
|'''Sparc/Solaris'''  
+
|'''SW (swlogin1)'''  
|'''x86/Linux'''
+
|'''Frontenac (caclogin01)'''
 
|-
 
|-
 
| '''Version'''
 
| '''Version'''
| G09 Rev.D01
+
| g16 (rev. A03)
| G16 Rev.A03
+
| g16 (rev. B01)
 
|-
 
|-
| '''Queue name'''
+
| '''Scheduler'''
| m9k.q (old default, deprecated)
+
| Sun Grid Engine (SGE)
| abaqus.q (new default)
+
| SLURM
|-
+
| '''Node names'''
+
| m9k000*
+
| cac0**
+
|-
+
| '''Relative Execution Speed'''
+
| 1
+
| 3
+
 
|-
 
|-
 
| '''GUI available'''
 
| '''GUI available'''
Line 151: Line 159:
 
| none
 
| none
 
| none
 
| none
|-
 
| '''Parallel environment'''
 
| <pre>#$ -pe gaussian.pe</pre>
 
| <pre>#$ -pe glinux.pe</pre>
 
|-
 
| '''Setup line'''
 
| <pre>. /opt/gaussian/setup.sh</pre>
 
| <pre>. /opt/gaussian/setup.sh</pre>
 
 
|-
 
|-
 
| '''Login node for <br> submission'''
 
| '''Login node for <br> submission'''
| sflogin0
 
 
| swlogin1
 
| swlogin1
 +
| caclogin02
 
|-
 
|-
 
| '''Setup command'''
 
| '''Setup command'''
| use g09
+
| use gaussian
| use g16
+
| module load gaussian
 
|}
 
|}
  
Line 173: Line 173:
 
Gaussian is a licensed program. The license held by the Centre for Advanced Computing is limited to our computers at our main site. That means that any of our users can use the program on our machines (but nowhere else), whether they are located at Queen's or not.
 
Gaussian is a licensed program. The license held by the Centre for Advanced Computing is limited to our computers at our main site. That means that any of our users can use the program on our machines (but nowhere else), whether they are located at Queen's or not.
  
We require users of Gaussian to [http://cac.queensu.ca/wp-content/files/cac-gaussian-statement.pdf sign a statement] in which they state that they are informed about the [http://www.hpcvl.org/sites/default/files/g09-licence.pdf terms of the license] to be included in the Gaussian user group named "g98". Please fax the completed statement to (613) 533-2015 or scan/email to [mailto:cac.admin@queensu.ca cac.admin@queensu.ca].
+
We require users of Gaussian to [https://info.cac.queensu.ca/wiki/files/cac-gaussian-statement.pdf sign a statement] in which they state that they are informed about the [http://www.hpcvl.org/sites/default/files/g09-licence.pdf terms of the license] to be included in the Gaussian user group named "g98". Please fax the completed statement to (613) 533-2015 or scan/email to [mailto:cac.admin@queensu.ca cac.admin@queensu.ca].
  
 
== Where can I get more detailed information ? ==
 
== Where can I get more detailed information ? ==
  
* To learn the basics about Gaussian input and output, refer to the [http://www.gaussian.com/g_tech/g_ur/g09help.htm Gaussian 09 User's Reference].  
+
* To learn the basics about Gaussian input and output, refer to the [http://www.gaussian.com/g_tech/g_ur/g09help.htm Gaussian 16 User's Reference].  
 
* For templates, and to get many examples, check out /opt/gaussian/g09/bsd/examples.
 
* For templates, and to get many examples, check out /opt/gaussian/g09/bsd/examples.
 
* The [http://www.gaussian.com Gaussian web page] contains a lot of information.  
 
* The [http://www.gaussian.com Gaussian web page] contains a lot of information.  
* For hardcore computational chemists, there is the [http://www.gaussian.com/g_tech/g09iop.htm Gaussian IOPs Reference], useful if you want to tinker with default settings and internal parameters.  
+
* For hardcore computational chemists, there is the [http://gaussian.com/iops/ Gaussian IOPs Reference], useful if you want to tinker with default settings and internal parameters.  
 
* These [http://www.gaussian.com/g_prod/books.htm can be purchased from Gaussian Inc.].
 
* These [http://www.gaussian.com/g_prod/books.htm can be purchased from Gaussian Inc.].
 
* '''Send [mailto:cac.help@queensu.ca|email to cac.help@queensu.ca]'''. We're happy to help.
 
* '''Send [mailto:cac.help@queensu.ca|email to cac.help@queensu.ca]'''. We're happy to help.
 
|}
 
|}

Latest revision as of 17:25, 21 August 2023

Gaussian

Gaussian is arguably the most commonly used computational quantum-chemistry program. It offers a wide range of features on the field of computational chemistry, ranging from atomic and molecular structure to thermochemical computations. See these release notes for features.

Important: Like other software packages, Gaussian is available on both the current "SW" production cluster and the new "Frontenac" platform. Here we document both. If you don't know which of the two platforms you are currently using, it is likely the "SW cluster".

Features

Gaussian does electronic-structure calculations and standard quantum chemical calculations. Among the methods available are simple molecular mechanics (such as Amber force field), semi-empirical methods (such as CNDO), Hartree-Fock (restricted and unrestricted), MPn (Mollar-Plesset perturbation theory of order n=2,3,4), CI (Configuration-Interaction), CC (Coupled-Cluster), Multi-configurational SCF (such as CAS-SCF) and various DFT (Density-Functional Theory) methods. Specific to Gaussian are high-accuracy energy methods (G2, CBS). It can be used to obtain electronic properties, molecular geometries, vibrational frequencies, orbitals, reaction profiles, and much more. Check out the capabilities here.

Location of the program and setup

The program resides in /global/software/gaussian. Multiple versions and revisions of the program are located in different sub-directories. The name of the root executable is g16.

The source code of Gaussian is not publicly accessible since Gaussian is a licensed product. However, Gaussian grants the permission to alter the code under certain conditions. If you want to do so, contact us to learn more. You are not allowed to copy the executable or any part of the distribution onto your local machine.

On Frontenac, we are using the module (lmod) system to set up Gaussian. This means that typing

 module load gaussian 

is automatically adding all required settings to your shell set-up.

Scratch files

One of the settings is the environment variable GAUSS_SCRDIR which is required to redirect the temporary files that Gaussian uses to the proper scratch space, presently

export GAUSS_SCRDIR=/global/scratch/hpcXXXX 

where hpcXXXX stands for your username. If for some reason Gaussian does not terminate normally (e.g. a job gets cancelled), it leaves behind large scratch files which you may have to delete manually. To check if such files exist, type

$ ls $GAUSS_SCRDIR
Gau-88477.chk  Gau-88477.int  Gau-88477.skr  
Gau-88477.d2e  Gau-88477.rwf  

Once you have determined that the scratch files are no longer needed (because the program that used them is not running any more), you can delete them by typing

$ rm $GAUSS_SCRDIR/Gau-*
$ ls $GAUSS_SCRDIR
$

Cleaning up the scratch space is the user's responsibility. If it is not done regularly, it can cause jobs to terminate, and much work to be lost.

Running Gaussian from a command line

To run Gaussian on our systems, you have to belong to a user group g98 (it's called that for historical reason, but it applies to all versions of Gaussian). You need to read our license agreement and signed a statement to be included in this user group. Once you are, you can access the executables.

A computation is performed by preparing an input file and pipe it to standard input of the program g16. Standard output should be caught in a log-file. We suggest you use the extensions .g16 for input files and .log for results.

Interactively, the command line to invoke Gaussian is thus:

 g16 < test.g16 >test.gout 

This will only work if you are a member of the g98 group and have set the environment correctly. Note that the interactive execution of Gaussian is only meant for test runs.

Gaussian input files are explained in the "User's Reference". It is impossible to give an outline here. Here is a small sample input file for test purposes:

%mem=512MB
#B3LYP/6-31G* opt

Test calculation

0 1
H1
O2 H1 R
H3 O2 R H1 A

R 1.1
A 107.

Important: Since Gaussian has recently moved from Solaris to Linux, the above command will work only on the Linux login node swlogin1, not (as before) on the Solaris-based sflogin0.

Note: It is absolutely essential to have a good idea about the size and complexity of your calculations before you start a Gaussian job. Many of the methods mentioned above have terrible scaling properties, i.e. the computational cost grows very quickly with the number of electrons, degrees of freedom, or number of basis functions used. We suggest you start with a small basis set and a cheap method, and then slowly increase those parameters.

Submitting (parallel) Gaussian jobs

If you want to run Gaussian on several processors on our machines, you have to include a line in your input file:

%nproc=8

where we assume that you want to use 8 processors (cores, threads).

It is mandatory to submit a Gaussian job script through our scheduling software.

On Frontenac

On Frontenac, you need to submit your Gaussian parallel production job through the SLURM scheduler (see our Scheduler Help File for details). This is done in the form of a script file. Here is a "bare bones" sample:

#!/bin/bash
#SBATCH --job-name=Gaussian_test
SBATCH --mail-type=ALL
#SBATCH --mail-user=myEmail@whatever.com
#SBATCH --output=STD.out
#SBATCH --error=STD.err
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --time=30:00
#SBATCH --mem=1000
module load gaussian
export GAUSS_SCRDIR=$TMPDIR
g16 < test.g16 > test.log
  • The "module" line makes sure the necessary setup is done.
  • Email notifications are set up in the "--mail-type" and "--mail-user lines". We suggest "hpcXXXX@localhost" (hpcXXXX stands for the username). Place a file .forward containing your actual email address into your home directory.
  • The --ooutput and --error lines are used to tell the system where to write "standard output" and "standard error", i.e. the screen output.
  • The --ntasks and --nodes options are kept at 1 and indicate that only one main process is running on a single node.
  • The --cpus-per-task line specifies the number of cores the scheduler will allocate (4 in this example). It is crucial to choose the same number as specified in the %nrocs= line of the input file.
  • The "export" line resets the scratch space to a temporary directory that is created at run time. This ensures that left-over scratch files are erased if the program terminates.

The script (let's call it g16.sh) is submitted by the sbatch command:

sbatch g16.sh

Migration from SW cluster to Frontenac

The following is a list of differences concerning Gaussian usage on the SW cluster vs the new Frontenac cluster. The main impact comes from the different scheduler.

Changes when migrating from SW cluster (SGE) to Frontenac (SLURM)
SW (swlogin1) Frontenac (caclogin01)
Version g16 (rev. A03) g16 (rev. B01)
Scheduler Sun Grid Engine (SGE) SLURM
GUI available no no
Queue specification
in submit script
none none
Login node for
submission
swlogin1 caclogin02
Setup command use gaussian module load gaussian

Licensing

Gaussian is a licensed program. The license held by the Centre for Advanced Computing is limited to our computers at our main site. That means that any of our users can use the program on our machines (but nowhere else), whether they are located at Queen's or not.

We require users of Gaussian to sign a statement in which they state that they are informed about the terms of the license to be included in the Gaussian user group named "g98". Please fax the completed statement to (613) 533-2015 or scan/email to cac.admin@queensu.ca.

Where can I get more detailed information ?