{"id":551,"date":"2020-11-30T11:10:43","date_gmt":"2020-11-30T11:10:43","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf4\/?page_id=551"},"modified":"2025-01-21T08:30:02","modified_gmt":"2025-01-21T08:30:02","slug":"gaussian16","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/software\/applications\/gaussian16\/","title":{"rendered":"Gaussian16"},"content":{"rendered":"<p>Gaussian is a general purpose suite of electronic structure programs. Versions g16c01 is installed. It is available as binaries only. The source code is not available on the CSF.<\/p>\n<p>Gaussian 09 is not currently installed on CSF4. Please contact us via our <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/hpc-help\">help form<\/a> if you require access to this version (it <em>is<\/em> installed on CSF3).<\/p>\n<h2>Restrictions on use<\/h2>\n<p>The University of Manchester site license allows access for all staff and students of the university, however strict licensing restrictions are in place. Access to this software is not automatic.<\/p>\n<p>Please contact us via our <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/hpc-help\">help form<\/a> to request access to Gaussian 16.<\/p>\n<h2>Set up procedure<\/h2>\n<p>G16 has been been installed on CSF with optimized versions for the different Intel compute node architectures. In general a less optimized version will run on more compute nodes. But a more optimized version requires newer architectures and so will not run on older compute nodes.<\/p>\n<p>The <code>detectcpu<\/code> modulefile will use the best version for the compute node your job is running on. This modulefile must be loaded inside your jobscript, not on the login node. If you prefer to use exactly the same for all of your job runs, there are also modulefiles to select a specific version.<\/p>\n<p>After being added to the relevant unix group, you will be able to access the executables by loading the modulefile<\/p>\n<p>For G16 C01:<\/p>\n<pre># NOTE: CSF4 ONLY CONTAINS CASCADE LAKE NODES. WE RECOMMEND USING THE _detectcpu\r\n#       OR THE _haswell MODULEFILES FOR BEST PERFORMANCE. The other modulefiles\r\n#       match those available on CSF3 and will use the same level of optimization\r\n#       as used on CSF3.\r\n\r\n# This can ONLY be loaded inside your jobscript. It won't load on the login node.\r\nmodule load gaussian\/g16c01_em64t_detectcpu    # Detects the CPU type and uses the\r\n                                               # fastest version for that CPU\r\n\r\n# These can be loaded on the login node and inherited by your job or loaded\r\n# in the jobscript (recommended). Less optimized to most optimized:\r\nmodule load gaussian\/g16c01_em64t              # Nehalem\/Westmere (SSE4.2) any node\r\n\r\nmodule load gaussian\/g16c01_em64t_nehalem      # (as above)\r\n\r\nmodule load gaussian\/g16c01_em64t_sandybridge  # For Sandybridge (AVX), Ivybridge, Haswell,\r\n                                               # Broadwell, Skylake, Cascade Lake nodes\r\n\r\nmodule load gaussian\/g16c01_em64t_haswell      # For Haswell (AVX2), Broadwell, Skylake\r\n                                               # and Cascade Lake nodes\r\n<\/pre>\n<p>We recommend you do this in your jobscript, see examples below (not on the command line before job submission as per the previous CSF2).<\/p>\n<p>Gaussian <strong>MUST ONLY<\/strong> be run in batch. Please <strong>DO NOT<\/strong> run <code>g16<\/code> on the login nodes. Computational work found to be running on the login nodes will be killed <strong>WITHOUT WARNING<\/strong>.<\/p>\n<h2>Gaussian Scratch<\/h2>\n<p>Gaussian uses an environment variable <code>$GAUSS_SCRDIR<\/code> to specify a directory path for where to write <em>scratch<\/em> (temporary) files (two-electron integral files, integral derivative files and a <em>read-write<\/em> file for temporary workings).<\/p>\n<p>It is set to your <em>scratch<\/em> directory (<code>~\/scratch<\/code>) when you load the modulefile (<em>scratch<\/em> is a fast filesystem with good I\/O performance.)<\/p>\n<p>Please either leave the <code>$GAUSS_SCRDIR<\/code> at the default setting or, if you wish to set it to a job-specific directory, ensure you use a directory inside your scratch area (see below for how to do this.) DO NOT use your CSF <em>home directory<\/em> or any additional Research Data Storage that you may have access to for the <code>$GAUSS_SCRDIR<\/code>.<\/p>\n<p>A faster, but smaller, local <code>\/tmp<\/code> on each compute node is available should users prefer to use that. It can be more efficient if you have a need to create lots of small files, but space is limited. The size of <code>\/tmp<\/code> on all compute nodes is 800GB.<\/p>\n<p>Gaussian <em>should<\/em> delete scratch files automatically when a job completes successfully or dies cleanly. However, it often fails to do this. Scratch files are also <em>not<\/em> deleted when a job is killed externally or terminates abnormally so that you can use the scratch files to restart the job (if possible). Consequently, leftover files may accumulate in the scratch directory, and it is your responsibility to delete these files. Please <strong>check periodically<\/strong> whether you have a lot of temporary Gaussian files that can be deleted.<\/p>\n<h3>Using a Scratch Directory per Job<\/h3>\n<p>We now recommend using a different scratch directory for each job. This improves file access times if you run many jobs &#8211; writing 1000s of scratch files to a single directory can slow down your jobs. It is much better to create a directory <em>for each<\/em> job within your <code>scratch<\/code> area. It is also then easy to delete the entire directory if Gaussian has left unwanted scratch files behind.<\/p>\n<p>The example jobscripts below show how to use this method (it is simple &#8211; just two extra lines in your jobscript). The two lines are:<\/p>\n<pre>export GAUSS_SCRDIR=\/scratch\/$USER\/gau_temp_$SLURM_JOB_ID\r\nmkdir -p $GAUSS_SCRDIR\r\n<\/pre>\n<h3>Very large Gaussian scratch files<\/h3>\n<p>Occasionally some jobs create <code>.rwf<\/code> files which are very large (several TB). The batch system will not permit a job to create files bigger than 4TB. If your gaussian job fails and the <code>.rwf<\/code> file is 4TB then it may be that this limit has prevented your job from completing. You should re-run the job and in your input file request that the <code>.rwf<\/code> file be split into multiple files. For example to split the file into two 3TB files:<\/p>\n<pre>%rwf=\/scratch\/$USER\/myjob\/one.rwf,3000GB,\/scratch\/$USER\/myjob\/two.rwf,3000GB\r\n<\/pre>\n<h2>Serial batch job<\/h2>\n<p>In the examples below we give example jobscripts using the BASH shell (the default used by most CSF users) and also the C shell, which is popular amongst computational chemists.<\/p>\n<h3>Example job submission<\/h3>\n<p>It is recommended you run from within your <code>scratch<\/code> area and use one directory per job:<\/p>\n<pre>cd ~\/scratch\r\nmkdir job1\r\ncd job1\r\n<\/pre>\n<p>Create a job script, for example:<\/p>\n<ul>\n<li>BASH shell verison:\n<pre>#!\/bin\/bash --login\r\n#SBATCH -p serial      # (or --partition) Single-core job\r\n#SBATCH -n 1           # (or --ntasks=) Number of cores (always 1)\r\n\r\n# Load g16 for the CPU type our job is running on\r\nmodule load gaussian\/g16c01_em64t_detectcpu\r\n\r\n## Set up scratch dir (please do this!)\r\nexport GAUSS_SCRDIR=\/scratch\/$USER\/gau_temp_$SLURM_JOB_ID\r\nmkdir -p $GAUSS_SCRDIR\r\n\r\n## Say how much memory to use (max on CSF4 is 4GB per core)\r\nexport GAUSS_MDEF=$((SLURM_NTASKS*4))GB\r\n\r\n$g16root\/g16\/g16 &lt; file.inp &gt; file.out\r\n<\/pre>\n<\/li>\n<li>C shell version:\n<pre>#!\/bin\/csh\r\n#SBATCH -p serial    # (or --partition) Single-core job\r\n#SBATCH -n 1         # (or --ntasks=) Number of cores (always 1)\r\n\r\n# Load g16 for the CPU type our job is running on\r\nmodule load gaussian\/g16c01_em64t_detectcpu\r\n\r\n# Set up scratch dir (please do this!)\r\nsetenv GAUSS_SCRDIR \/scratch\/$USER\/gau_temp_$SLURM_JOB_ID\r\nmkdir -p $GAUSS_SCRDIR\r\n\r\n## Say how much memory to use (max on CSF4 is 4GB per core)\r\n@ mem = ( $SLURM_NTASKS * 4 )\r\nsetenv GAUSS_MDEF ${mem}GB\r\n\r\n$g16root\/g16\/g16 &lt; file.inp &gt; file.out\r\n<\/pre>\n<\/li>\n<\/ul>\n<p>Submit with the command:<\/p>\n<pre>sbatch <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your job script.<\/p>\n<p>When the job has finished check whether Gaussian has left behind unwanted scratch files (you&#8217;ll need to know the job id). For example, assuming your job id was 456789:<\/p>\n<pre>cd ~\/scratch\/gau_temp_456789\r\nls\r\nGau-21738.inp  Gau-21738.chk  Gau-21738.d2e  Gau-21738.int  Gau-21738.scr\r\n\r\n# Example: Remove a specific scratch file\r\nrm Gau-21738.scr\r\n\r\n# Example: Remove all files in the directory (use with caution)\r\nrm Gau*\r\n\r\n# Example: go up and remove the empty directory\r\ncd ..\r\nrmdir gau_temp_456789\r\n<\/pre>\n<h2>Parallel batch job<\/h2>\n<p>On the CSF Gaussian is a multi-threaded application (shared memory) only, so a job will <strong>not<\/strong> run across multiple compute nodes. Hence you are limited to a maximum of 40 cores. This means that you <em>must<\/em> run in the <code>multicore<\/code> <em>partition<\/em> to confine your job to a single node.<\/p>\n<p>Follow the steps below to submit a parallel Gaussian job.<\/p>\n<h3>Important Information About Requesting cores<\/h3>\n<div class=\"hint\">You MUST declare the number of cores for your job twice &#8211; via the <code>#SBATCH -n<\/code> request in your jobscript <em>and<\/em> using a Gaussian specific environment variable, also set in the jobscript. See below for further details and examples.<\/div>\n<p><strong>Old method<\/strong>: We <em>used<\/em> to advise setting the number of cores to use for a job in the Gaussian input file using <code>%NProcsShared<\/code> or <code>%nprocs<\/code>. But this can easily lead to mistakes &#8211; if you change the number of cores in the jobscript but forget to also change it in the Gaussian input file you will either use too few cores (some of the cores your job requested are sat idle) or too many cores (your job is trying to use cores it shouldn&#8217;t, possibly trampling on another user&#8217;s job).<\/p>\n<p><strong>New method<\/strong>: We now recommend setting the <code>GAUSS_PDEF<\/code> environment variable in your jobscript (set it to <code>$SLURM_NTASKS<\/code>) so that it always tells Gaussian the correct number of cores to use. This also means you don&#8217;t have to keep editing your Gaussian input file each time you want to run the input deck with a different number of cores.<\/p>\n<p>For example, depending which <em>shell<\/em> you use (look at the first line of your jobscript to find out):<\/p>\n<pre># If using BASH (the default shell used by most CSF users):\r\nexport GAUSS_PDEF=$SLURM_NTASKS\r\n\r\n# If using CSH (the 'traditional' shell used by chemistry users):\r\nsetenv GAUSS_PDEF $SLURM_NTASKS\r\n<\/pre>\n<p>Remember that <code>$SLURM_NTASKS<\/code> is automatically set by the batch system to the number of cores you requested on the <code>#SBATCH -n<\/code> line in the jobscript. Hence there is only one number-of-cores to change if you want to run the job with a different number of cores.<\/p>\n<p>Note: <code>%NProcShared<\/code> in the input file takes precedence over <code>GAUSS_PDEF<\/code>, so one could override the latter by setting <code>%NProcShared<\/code> in the input file. If you are using our recommended method of setting <code>GAUSS_PDEF<\/code> in the jobscript, please remove any <code>%NProcShared<\/code> line from your Gaussian input files.<\/p>\n<h3>Example job submission<\/h3>\n<div class=\"hint\">You MUST declare the number of cores for your job twice &#8211; via the <code>#SBATCH -n<\/code> request in your jobscript and using a Gaussian specific variable, also set in the jobscript. See the above explanation for further details.<\/div>\n<p>It is recommended you run from within your <code>scratch<\/code> area and use one directory per job:<\/p>\n<pre>cd ~\/scratch\r\nmkdir job1\r\ncd job1\r\n<\/pre>\n<p>Create a job script, for example:<\/p>\n<ul>\n<li>BASH shell verison:\n<pre>#!\/bin\/bash --login\r\n#SBATCH -p multicore      # (or --partition) Single-node multicore\r\n#SBATCH -n 20             # (or --ntasks=) Number of cores (2--40)\r\n\r\n# Load g16 for the CPU type our job is running on\r\nmodule load gaussian\/g16c01_em64t_detectcpu\r\n\r\n## Set up scratch dir (please do this!)\r\nexport GAUSS_SCRDIR=\/scratch\/$USER\/gau_temp_$SLURM_JOB_ID\r\nmkdir -p $GAUSS_SCRDIR\r\n\r\n## Say how much memory to use (4GB per core)\r\nexport GAUSS_MDEF=$((SLURM_NTASKS*4))GB\r\n\r\n## Inform Gaussian how many cores to use\r\nexport GAUSS_PDEF=$SLURM_NTASKS\r\n\r\n$g16root\/g16\/g16 &lt; file.inp &gt; file.out\r\n<\/pre>\n<\/li>\n<li>C shell version:\n<pre>#!\/bin\/csh         \r\n#SBATCH -p multicore      # (or --partition) Single-node multicore\r\n#SBATCH -n 20             # (or --ntasks=) Number of cores (2--40)\r\n\r\n# Load g16 for the CPU type our job is running on\r\nmodule load gaussian\/g16c01_em64t_detectcpu\r\n\r\n# Set up scratch dir (please do this!)\r\nsetenv GAUSS_SCRDIR \/scratch\/$USER\/gau_temp_$SLURM_JOB_ID\r\nmkdir -p $GAUSS_SCRDIR\r\n\r\n## Say how much memory to use (4GB per core)\r\n@ mem = ( $SLURM_NTASKS * 4 )\r\nsetenv GAUSS_MDEF ${mem}GB\r\n\r\n## Inform Gaussian how many cores to use\r\nsetenv GAUSS_PDEF $SLURM_NTASKS\r\n\r\n$g16root\/g16\/g16 &lt; file.inp &gt; file.out\r\n<\/pre>\n<\/li>\n<\/ul>\n<p>Submit with the command:<\/p>\n<pre>sbatch <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your job script.<\/p>\n<h3>GAUSS_PDEF vs GAUSS_CDEF<\/h3>\n<p>Gaussian has two environment variables that can be used to say how many cores to use. We saw the <code>GAUSS_PDEF<\/code> variable above. Alternatively the <code>GAUSS_CDEF<\/code> variable can be set but this must <em>only<\/em> be used when you are using <em>all<\/em> of the cores on a compute node. If you are unsure whether your job does this, please use the <code>GAUSS_PDEF<\/code> variable as shown above.<\/p>\n<p>The <code>GAUSS_CDEF<\/code> variable <em>may<\/em> give increased performance because it pins <code>g16<\/code> <em>threads<\/em> (used to do the parallel processing in Gaussian) to specific CPU cores. Without pinning Linux is free to move the threads between cores, although it tries not to do this. When a thread is moved it invalidates the low-level memory caches which may reduce performance.<\/p>\n<p>The <code>GAUSS_CDEF<\/code> variable uses a slightly different format to the <code>GAUSS_PDEF<\/code> variable, as shown below:<\/p>\n<pre>#SBATCH -p multicore      # (or --partition) Single-node multicore\r\n#SBATCH -n 40             # (or --ntasks=) Use all 40 cores in a cascade lake node\r\n\r\n# Say which cores to use, e.g., 0-39 (BASH shell):\r\nexport GAUSS_CDEF=0-$((SLURM_NTASKS-1))\r\n\r\n# Say which cores to use, e.g., 0-39 (C shell):\r\n@ maxcore = ( $SLURM_NTASKS - 1 )\r\nsetenv GAUSS_CDEF 0-$maxcore\r\n<\/pre>\n<p>Reminder: the <code>GAUSS_CDEF<\/code> variable should only be used when you are using <em>all<\/em> cores on a compute node. Jobs found to be using this variable incorrectly will be killed without warning because you will be slowing down other users&#8217; jobs.<\/p>\n<h2>Further info<\/h2>\n<ul>\n<li>The <a href=\"http:\/\/www.applications.itservices.manchester.ac.uk\/show_product.php?id=22\">IT Services Gaussian webpage<\/a> contains important information applicable to all users of the software.<\/li>\n<li>Gaussian Inc. <a href=\"http:\/\/www.gaussian.com\/man\">g16 Users Reference pages<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Gaussian is a general purpose suite of electronic structure programs. Versions g16c01 is installed. It is available as binaries only. The source code is not available on the CSF. Gaussian 09 is not currently installed on CSF4. Please contact us via our help form if you require access to this version (it is installed on CSF3). Restrictions on use The University of Manchester site license allows access for all staff and students of the university,.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/software\/applications\/gaussian16\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"parent":49,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-551","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":17,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/551\/revisions"}],"predecessor-version":[{"id":1382,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/551\/revisions\/1382"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/49"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/media?parent=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}