This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
howto:gaussian [2015/10/21 12:26] kgovender [Easy Gaussian PBS creation and submission] |
howto:gaussian [2025/10/17 09:51] (current) alopis [Easy Gaussian09 and Gaussian16 PBS creation and submission] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Gaussian at CHPC ====== | ====== Gaussian at CHPC ====== | ||
| - | | + | This license can only be used by CHPC registered users, which are associated with either |
| + | Gaussian can be run over 1 or 2 nodes (see example below) | ||
| - | Gaussian can be run over single nodes or more than one node (see examples below), with an example input file below these. These two case are also possible using **Job Arrays** (see example scripts further below) which allow multiple jobs to be submitted as if they were one job (containing sub-jobs) | + | ====Easy Gaussian09 |
| + | In order to see all available Easy Scripts, first include/ | ||
| - | There are two modules of Gaussian 09 at CHPC which can be used. | + | module load chpc/ |
| - | Here is an example on how to access them: | + | |
| - | embele@login01: | + | Execute **qg09_E01** |
| - | embele@login01: | + | |
| - | embele@login01: | + | |
| - | + | ||
| - | + | ||
| - | ====Example PBSPro job script for Single Node Jobs (multiple CPU' | + | |
| - | <file bash gaussian_single.qsub> | ||
| - | |||
| - | #! /bin/sh | ||
| - | | ||
| - | # (1) These are standard type lines for PBS job specification. Modify them for your own requirements - choice of | ||
| - | # nodes; walltime; your directory on scratch for standard out and error files ; email of job starting, | ||
| - | # ending and errors | ||
| - | | ||
| - | #PBS -N molecule.job | ||
| - | #PBS -l select=1: | ||
| - | #PBS -l walltime=2: | ||
| - | #PBS -q workq | ||
| - | #PBS -o / | ||
| - | #PBS -e / | ||
| - | #PBS -m abe | ||
| - | #PBS -M MY_EMAIL_ADDRESS.com | ||
| - | # End of comments (1) Make changes above. | ||
| - | | ||
| - | # (2) This is to clean up temporary files which are left behind if Gaussian crashes. No changes required below. | ||
| - | cleanup_scratch() { | ||
| - | echo " | ||
| - | | ||
| - | cd " | ||
| - | rm -rfv " | ||
| - | echo " | ||
| - | echo " | ||
| - | date | ||
| - | exit 0 | ||
| - | } | ||
| - | | ||
| - | # Associate function " | ||
| - | trap ' | ||
| - | | ||
| - | # End of comments (2) No changes required above. | ||
| - | | ||
| - | | ||
| - | # (3) You can remove this 1st line below after you've run the script once, but is no problem if it remains. | ||
| - | mkdir / | ||
| - | | ||
| - | # (4) Please leave this line unchanged. Creating a subdirectory with your jobid for Gaussian temporary files | ||
| - | # which are removed after job. | ||
| - | # Previously everone' | ||
| - | mkdir / | ||
| - | | ||
| - | # (5) Change to your work directory. Specify if explictly if you find issues. | ||
| - | cd $PBS_O_WORKDIR | ||
| - | | ||
| - | echo "My job starts here" | ||
| - | date | ||
| - | | ||
| - | # (6) Please leave unchanged. This new module specifies the new directory for Gaussian variable GAUSS_SCRDIR | ||
| - | # for temporary files directory. | ||
| - | source / | ||
| - | module add gaussian/ | ||
| - | source / | ||
| - | # (6) Please leave unchanged | ||
| - | | ||
| - | # (7) Edit your job input and log file names here. | ||
| - | g09 < molecule.com > molecule.log | ||
| - | | ||
| - | # (8) Leave following unchanged. | ||
| - | # Normal exit of script: clean up temporary files - Gaussian should do this anyway, but to be safe. | ||
| - | # Remove the Gaussian scratch directory where temporary files are written. It is | ||
| - | # / | ||
| - | # If abnormal termination (walltime or job killed) then function subroutine cleanup_scratch will clear | ||
| - | # temporary files. | ||
| - | | ||
| - | rm -rfv " | ||
| - | | ||
| - | echo " | ||
| - | date | ||
| - | ====Example PBSPro job script for 2 nodes or more:==== | ||
| - | |||
| - | Please include the following line at the top of your input file (an example .com is provided below): | ||
| - | |||
| - | %lindaworkers=LINDA | ||
| - | |||
| - | <file bash gaussian_multiple.qsub> | ||
| - | |||
| - | #!/bin/bash | ||
| - | | ||
| - | # (1) These are standard type lines for PBS job specification. Modify them for your own requirements - choice of | ||
| - | # nodes; walltime; your directory on scratch for standard out and error files ; email of job starting, | ||
| - | # ending and errors. | ||
| - | | ||
| - | #PBS -N molecule.job | ||
| - | #PBS -l select=2: | ||
| - | #PBS -l walltime=03: | ||
| - | #PBS -q workq | ||
| - | #PBS -m abe | ||
| - | #PBS -o / | ||
| - | #PBS -e / | ||
| - | #PBS -M MY_Email_Address.com | ||
| - | # End of comments (1) Make changes above. | ||
| - | | ||
| - | # (2) This is to clean up temporary files which are left behind if Gaussian crashes. No changes required below. | ||
| - | cleanup_scratch() { | ||
| - | echo " | ||
| - | | ||
| - | cd " | ||
| - | rm -rfv " | ||
| - | echo " | ||
| - | echo " | ||
| - | date | ||
| - | exit 0 | ||
| - | } | ||
| - | | ||
| - | # Associate function " | ||
| - | trap ' | ||
| - | | ||
| - | # End of comments (2) No changes required above. | ||
| - | | ||
| - | # (3) You can remove this first line below after you've run the script once, but won't be problem if it remains. | ||
| - | mkdir / | ||
| - | | ||
| - | # (4) Please leave this line unchanged. Creating a subdirectory with your jobid for temporary Gaussian files | ||
| - | # which are removed after job. | ||
| - | # Previously everone' | ||
| - | mkdir / | ||
| - | | ||
| - | # (5) Change to your work directory. Specify if explictly if you find issues. | ||
| - | # cd " | ||
| - | cd / | ||
| - | | ||
| - | echo "My job starts here" | ||
| - | date | ||
| - | pwd | ||
| - | | ||
| - | # (6) Please leave unchanged. This new module specifies the new directory for Gaussian variable GAUSS_SCRDIR | ||
| - | # for temporary files directory. | ||
| - | source / | ||
| - | module add gaussian/ | ||
| - | source / | ||
| - | # (6) Please leave unchanged | ||
| - | | ||
| - | # (7) Edit your job input and log file names here. In this these are molecule.com and molecule.log. | ||
| - | # Please leave remaining text unchanged. | ||
| - | LINDA=`cat $PBS_NODEFILE | uniq | tr ' | ||
| - | echo linda: $LINDA | ||
| - | cat molecule.com | sed " | ||
| - | g09 < temp$$.inp > molecule.log | ||
| - | # (7) Edit as specified above please. | ||
| - | | ||
| - | # (8) Leave following unchanged. | ||
| - | # Normal exit of script: clean up temporary files - Gaussian should do this anyway, but to be safe. | ||
| - | # Remove the Gaussian scratch directory where temporary files are written. It is | ||
| - | # / | ||
| - | # If abnormal termination (walltime or job killed) then function subroutine cleanup_scratch will clear | ||
| - | # temporary files. | ||
| - | | ||
| - | rm -rfv " | ||
| - | | ||
| - | echo " | ||
| - | date | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | ====Example of a Gaussian Input file, note the blank lines within the file:==== | ||
| - | | ||
| - | %nprocshared=12 | ||
| - | %nprocl=1 | ||
| - | #P HF/ | ||
| - | |||
| - | Title Card Required | ||
| - | | ||
| - | 0 1 | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | ====Gaussian Job Array Script for running on Single Nodes==== | ||
| - | | ||
| - | #! /bin/sh | ||
| - | #PBS -N My.job | ||
| - | #PBS -l select=1: | ||
| - | #PBS -l walltime=0: | ||
| - | #PBS -q workq | ||
| - | #PBS -m abe | ||
| - | #PBS -M MyEmailAddress | ||
| - | | ||
| - | # Any of these comment lines can remain in place and won't interfere with the script - or removed if you prefer. | ||
| - | # The line below defined the job array. In this example there are 3 sub-jobs. Each sub-job is essentially | ||
| - | # an individual job but which uses the same settings such as node, walltime and email about jobs. | ||
| - | # "qstat -ftu username" | ||
| - | # as [1], [2] etc. You can do a qdel on a sub-job, just use job number including square brackets. | ||
| - | | ||
| - | #PBS -J 1-3 | ||
| - | | ||
| - | # This is to clean up temporary files which are left behind if Gaussian crashes. No changes required below. | ||
| - | cleanup_scratch() { | ||
| - | echo " | ||
| - | | ||
| - | cd " | ||
| - | rm -rfv " | ||
| - | echo " | ||
| - | echo " | ||
| - | date | ||
| - | exit 0 | ||
| - | } | ||
| - | | ||
| - | # Associate the function " | ||
| - | trap ' | ||
| - | | ||
| - | source / | ||
| - | module add gaussian/ | ||
| - | source / | ||
| - | | ||
| - | mkdir / | ||
| - | mkdir / | ||
| - | | ||
| - | # Change to your work directory (usually more reliable than using " | ||
| - | # directory in the format below using /lustre | ||
| - | cd / | ||
| - | | ||
| - | # These are arbitrary subdirectory names for each sub-job, please set up all your input files (.com and | ||
| - | # .chk) in this subdirectory and your output files will be written here. Hence each sub-job will be in | ||
| - | # separate directories and more clearly organised. The names are arbitrary, so you should | ||
| - | # name them in a meaningful way for you. Please note, the input files must also have the exact same name as | ||
| - | # the directory containing them so the script can then find and run using them. In the current example only | ||
| - | # 3 jobs are specified (PBS -J 1-3), but you can specify as many directories/ | ||
| - | # 23 if desired). This bypasses the 10 queued job limit (counts as 1 job) but is not problematic for the | ||
| - | # system - in fact better! | ||
| - | | ||
| - | directory[1]=alpha | ||
| - | directory[2]=beta | ||
| - | directory[3]=gamma | ||
| - | directory[4]=delta | ||
| - | directory[5]=epsilon | ||
| - | directory[6]=eta | ||
| - | directory[7]=theta | ||
| - | directory[8]=iota | ||
| - | directory[9]=kappa | ||
| - | directory[10]=lamda | ||
| - | directory[11]=mu | ||
| - | directory[12]=nu | ||
| - | directory[13]=xi | ||
| - | directory[14]=omicron | ||
| - | directory[15]=pi | ||
| - | directory[16]=rho | ||
| - | directory[17]=sigma | ||
| - | directory[18]=tau | ||
| - | directory[19]=upsilon | ||
| - | directory[20]=phi | ||
| - | directory[21]=chi | ||
| - | directory[22]=psi | ||
| - | directory[23]=omega | ||
| - | | ||
| - | # Printing out some possibly useful about your sub-job into the standard .out file. You'll see this file is | ||
| - | # named according to your job number and sub-job number in square brackets. $PBS_ARRAY_INDEX is your sub-job | ||
| - | # number (1-3 in this example). No need to change anything below. | ||
| - | | ||
| - | echo "My job starts here" | ||
| - | date | ||
| - | uname -n | ||
| - | | ||
| - | echo ' PBS_ARRAY_INDEX: | ||
| - | | ||
| - | cd ${directory[$PBS_ARRAY_INDEX]} | ||
| - | echo ' directory: ' ${directory[$PBS_ARRAY_INDEX]} | ||
| - | pwd | ||
| - | echo ' | ||
| - | | ||
| - | g09 < ${directory[$PBS_ARRAY_INDEX]}.com > ${directory[$PBS_ARRAY_INDEX]}.log | ||
| - | | ||
| - | # Normal exit of script: clean up temporary files - Gaussian should do this anyway, but to be safe. Remove | ||
| - | # the Gaussian scratch directory where temporary files are written: / | ||
| - | # If abnormal termination (walltime or job killed) then subroutine cleanup_scratch will clear temporary files. | ||
| - | | ||
| - | rm -rfv " | ||
| - | | ||
| - | echo " | ||
| - | date | ||
| - | |||
| - | |||
| - | ====Gaussian Job Array Script for running on Multiple Nodes==== | ||
| - | |||
| - | #!/bin/bash | ||
| - | | ||
| - | # Any of these comment lines can remain in place and won't interfere with the script - or removed if you prefer. | ||
| - | # (1) These are standard type lines for PBS job specification. Modify them for your own requirements - choice of | ||
| - | # nodes; walltime; your directory on scratch for standard out and error files ; email of job starting, | ||
| - | # ending and errors. | ||
| - | | ||
| - | #PBS -N My.job | ||
| - | #PBS -l select=2: | ||
| - | #PBS -l walltime=0: | ||
| - | #PBS -q workq | ||
| - | #PBS -m abe | ||
| - | #PBS -M MY_Email_Address | ||
| - | # End of comments (1) Make changes above. | ||
| - | | ||
| - | # (2) The line below defined the job array. In this example there are 3 sub-jobs. Each sub-job is | ||
| - | # essentially an individual job but which uses the same settings such as node, walltime and email about job. | ||
| - | # "qstat -ftu username" | ||
| - | # as [1], [2] etc. You can do a qdel on a sub-job, just use job number including square brackets. | ||
| - | | ||
| - | #PBS -J 1-3 | ||
| - | | ||
| - | # (3) This is to clean up temporary files which are left behind if Gaussian crashes. No changes required below. | ||
| - | cleanup_scratch() { | ||
| - | echo " | ||
| - | | ||
| - | cd " | ||
| - | rm -rfv " | ||
| - | echo " | ||
| - | echo " | ||
| - | date | ||
| - | exit 0 | ||
| - | } | ||
| - | |||
| - | # Associate function " | ||
| - | trap ' | ||
| - | | ||
| - | # End of comments (2) No changes required above. | ||
| - | | ||
| - | # (4) You can remove this first line below after you've run the script once, but won't be problem if it remains. | ||
| - | mkdir / | ||
| - | | ||
| - | # (5) Please leave this line unchanged. Creating a subdirectory with your jobid for temporary Gaussian files | ||
| - | # which are removed after job. Previously everyone' | ||
| - | mkdir / | ||
| - | | ||
| - | # (6) Change to your work directory (usually more reliable than using " | ||
| - | # work directory in the format below using /lustre | ||
| - | cd / | ||
| - | | ||
| - | # (7) These are arbitrary subdirectory names for each sub-job, please set up all your input files (.com and | ||
| - | # .chk) in this subdirectory and your output files will be written here. Hence each sub-job will be in | ||
| - | # separate directories and more clearly organised. The names are arbitrary, so you should name them in a | ||
| - | # meaningful way for you. Please note, the input files must also have the exact same name as the directory | ||
| - | # containing them so the script can then find and run using them. In the current example only 3 jobs are | ||
| - | # specified (PBS -J 1-3), but you can specify as many directories/ | ||
| - | # desired). This bypasses the 10 queued job limit (counts as 1 job) but not problematic for the system - in | ||
| - | # fact better! | ||
| - | | ||
| - | directory[1]=alpha | ||
| - | directory[1]=alpha | ||
| - | directory[2]=beta | ||
| - | directory[3]=gamma | ||
| - | directory[4]=delta | ||
| - | directory[5]=epsilon | ||
| - | directory[6]=eta | ||
| - | directory[7]=theta | ||
| - | directory[8]=iota | ||
| - | directory[9]=kappa | ||
| - | directory[10]=lamda | ||
| - | directory[11]=mu | ||
| - | directory[12]=nu | ||
| - | directory[13]=xi | ||
| - | directory[14]=omicron | ||
| - | directory[15]=pi | ||
| - | directory[16]=rho | ||
| - | directory[17]=sigma | ||
| - | directory[18]=tau | ||
| - | directory[19]=upsilon | ||
| - | directory[20]=phi | ||
| - | directory[21]=chi | ||
| - | directory[22]=psi | ||
| - | directory[23]=omega | ||
| - | | ||
| - | # (8) Printing out some possibly useful about your sub-job into the standard .out file. You'll see this file | ||
| - | # is named according to your job number and sub-job number in square brackets. $PBS_ARRAY_INDEX is your | ||
| - | # sub-job number (1-3 in this example). | ||
| - | | ||
| - | echo "My job starts here" | ||
| - | date | ||
| - | uname -n | ||
| - | | ||
| - | echo ' PBS_ARRAY_INDEX: | ||
| - | | ||
| - | cd ${directory[$PBS_ARRAY_INDEX]} | ||
| - | echo ' directory: ' ${directory[$PBS_ARRAY_INDEX]} | ||
| - | pwd | ||
| - | echo ' | ||
| - | | ||
| - | | ||
| - | # (9) Please leave unchanged. This new module specifies the new directory for Gaussian variable GAUSS_SCRDIR | ||
| - | # for temporary files directory. | ||
| - | source / | ||
| - | module add gaussian/ | ||
| - | source / | ||
| - | | ||
| - | # (10) Please leave unchanged. The directory/ | ||
| - | LINDA=`cat $PBS_NODEFILE | uniq | tr ' | ||
| - | echo linda: $LINDA | ||
| - | cat ${directory[$PBS_ARRAY_INDEX]}.com | sed " | ||
| - | g09 < temp$$.inp > ${directory[$PBS_ARRAY_INDEX]}.log | ||
| - | | ||
| - | # (11) Leave following unchanged. | ||
| - | # Normal exit of script: clean up temporary files - Gaussian should do this anyway, but to be safe. | ||
| - | # Remove the Gaussian scratch directory where temporary files are written. It is | ||
| - | # / | ||
| - | # If abnormal termination (walltime or job killed) then function subroutine cleanup_scratch will clear | ||
| - | # temporary files. | ||
| - | | ||
| - | rm -rfv " | ||
| - | | ||
| - | echo " | ||
| - | date | ||
| - | |||
| - | ====Easy Gaussian PBS creation and submission==== | ||
| - | Execute qg09 on login node and follow the prompts. | ||
| This script handles PBS setup and submission. | This script handles PBS setup and submission. | ||
| - | Also takes care of jobs running over more than one node with LINDA and does cleanup of GAU files when job is completed/ | + | Also takes care of jobs running over more than one node with LINDA and does cleanup of temporary |
| - | | + | |
| + | Enter project name/ | ||
| + | CHEM0100 | ||
| Enter input file (with .com or .gjf extension) | Enter input file (with .com or .gjf extension) | ||
| test.gjf | test.gjf | ||
| Enter number of nodes on which to run job | Enter number of nodes on which to run job | ||
| 1 | 1 | ||
| - | | + | Enter total walltime (hour: |
| - | 12 | + | 2:00 |
| - | | + | Enter email address |
| - | 2:00:00 | + | |
| - | Enter name of queue on which to run job | + | |
| - | | + | |
| Generated pbs file for test | Generated pbs file for test | ||
| Do you wish to submit job to cluster (y/n) | Do you wish to submit job to cluster (y/n) | ||
| y | y | ||
| - | | + | |
| - | EXAMPLE2 | + | |
| + | | ||
| + | Enter project name/ | ||
| + | CHEM0100 | ||
| Enter input file (with .com or .gjf extension) | Enter input file (with .com or .gjf extension) | ||
| test.gjf | test.gjf | ||
| Enter number of nodes on which to run job | Enter number of nodes on which to run job | ||
| | | ||
| - | | + | Enter total walltime (hour: |
| - | + | ||
| - | | + | |
| - | + | ||
| - | Enter name of queue on which to run job | + | |
| | | ||
| + | Enter email address | ||
| + | testing@gmail.com | ||
| Generated pbs file for test | Generated pbs file for test | ||
| Do you wish to submit job to cluster (y/n) | Do you wish to submit job to cluster (y/n) | ||
| y | y | ||
| + | | ||
| + | | ||
| + | If you wish to use the utility **formchk** (to create readable format files for visualisers) please do the following. | ||
| + | | ||
| + | module load chpc/ | ||
| + | source $g16root/ | ||
| + | | ||
| + | Then the command **formcheck** should be available for use. Other Gaussian commands should also be available, such as **freqchk** and **chkchk**. | ||
| + | |||
| + | |||
| + | |||
| + | You can use a **checkpoint file (.chk)** which will allow you to continue with a 2nd (or subsequent) calculation from close to where the initial/ | ||
| + | |||
| + | https:// | ||
| + | |||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | Very occassionally | ||
| + | Please **recheck** your molecular **geometry very carefully** to ensure there are no issues - this will result in calculations which take much longer than necessary. | ||