User Tools

Site Tools


howto:gaussian

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:gaussian [2016/05/04 13:48]
alopis [Gaussian Job Array Script for running on Multiple Nodes]
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 ======
  
-Gaussian can be run over single nodes or more than one node (see examples below), with an example input file below these. These two cases 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) and which are much easier for the PBSPro scheduler to handle than the same number of individual jobs. Hence you will be able to submit many jobs and not be constrained by the 10 job limit for each user and this won't be a problem for the system either!+This license can only be used by CHPC registered userswhich are associated with either **South African** or **SKA partner** higher education institutions 
 + 
 +Gaussian can be run over 1 or 2 nodes (see example below)  
 + 
 +====Easy Gaussian09 and Gaussian16 PBS creation and submission==== 
 + 
 +In order to see all available Easy Scripts, first include/load this module even better if your add this line to your .bashrc: 
 + 
 +  module load chpc/easy_scripts 
 + 
 +Execute **qg09_E01** or **qg16_A03** or **qg16_B01** or **qg16_C01**
  
-====Easy Gaussian PBS creation and submission==== 
-Execute **qg09_D01** or **qg09_E01** 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 temporary GAU files when job is completed/killed. Examples of these scripts are provided below. Also takes care of jobs running over more than one node with LINDA and does cleanup of temporary GAU files when job is completed/killed. Examples of these scripts are provided below.
Line 38: Line 46:
   Do you wish to submit job to cluster (y/n)   Do you wish to submit job to cluster (y/n)
   y   y
- 
- 
- 
- 
-====Gaussian Job Array Script for running on Single Nodes: Requires Modification for our new Lengau cluster==== 
      
-  #! /bin/sh 
-  #PBS -N My.job 
-  #PBS -l select=1:ncpus=12:jobtype=westmere,place=free:group=nodetype:excl 
-  #PBS -l walltime=0:10:00 
-  #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. +If you wish to use the utility **formchk** (to create readable format files for visualisers) please do the following.
-  # 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" is an appropriate way to check on your job array status, each subjob will be listed  +
-  # as [1], [2] etc. You can do a qdel on a sub-job, just use job number including square brackets+
      
-  #PBS -J 1-3   +  module load chpc/gaussian16/C01 
 +  source $g16root/g16/bsd/g16.profile
      
-  # This is to clean up temporary files which are left behind if Gaussian crashes. No changes required below.    +Then the command **formcheck** should be available for useOther Gaussian commands should also be availablesuch as **freqchk** and **chkchk**
-  cleanup_scratch() { + 
-    echo "Deleting inside signal handler, meaning I probably either hit the walltime, or deleted the job using qdel" +
-   +
-    cd "$PBS_O_WORKDIR" +
-    rm -rfv "$GAUSS_SCRDIR" +
-    echo "---" +
-    echo "Signal handler ending time:" +
-    date +
-    exit 0 +
-  } +
-   +
-  # Associate the function "cleanup_scratch" with the TERM signal, which is usually how jobs get killed +
-  trap 'cleanup_scratch' TERM +
-   +
-  source /etc/profile.d/modules.sh +
-  module add gaussian/g09.anton +
-  source /opt/gridware/applications/gaussian/g09/bsd/g09.profile +
-   +
-  mkdir  /lustre/SCRATCH5/gau/$USER +
-  mkdir  /lustre/SCRATCH5/gau/$USER/$PBS_JOBID +
-   +
-  # Change to your work directory (usually more reliable than using "$PBS_O_WORKDIR"). Write your exact work +
-  # directory in the format below using /lustre +
-  cd /lustre/SCRATCH5/users/aslopis/Job_Array_Testing +
-   +
-  # 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/sub-jobs as you like (more than +
-  # 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: ' $PBS_ARRAY_INDEX:wq +
-     +
-  cd ${directory[$PBS_ARRAY_INDEX]} +
-  echo ' directory: ' ${directory[$PBS_ARRAY_INDEX]} +
-  pwd +
-  echo '${directory[$PBS_ARRAY_INDEX]}.inp:' ${directory[$PBS_ARRAY_INDEX]}.inp +
-   +
-  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: /lustre/SCRATCH5/gau/$USER/$PBS_JOBID +
-  # If abnormal termination (walltime or job killed) then subroutine cleanup_scratch will clear temporary files. +
-   +
-   rm -rfv "$GAUSS_SCRDIR" +
-   +
-   echo "Normal execution ending time:" +
-   date +
-      +
-    +
-====Gaussian Job Array Script for running on Multiple Nodes: Requires Modification for our new Lengau cluster====+
  
-  #!/bin/bash +You can use a **checkpoint file (.chk)** which will allow you to continue with a 2nd (or subsequentcalculation from close to where the initial/previous calculation endedThis is especially helpful for jobs which exceed walltime limits or have stopped for another reasonThere is info online including from Gaussian websitethese links may be helpful too: 
-   + 
-  # Any of these comment lines can remain in place and won't interfere with the script - or removed if you prefer. +https://gaussian.com/faq2
-  # (1) These are standard type lines for PBS job specificationModify them for your own requirements - choice of  + 
-  # nodes; walltime; your directory on scratch for standard out and error files ; email of job starting,  +https://gaussian.com/restart
-  # ending and errors. + 
-   +https://gaussian.com/tip4
-  #PBS -N My.job + 
-  #PBS -l select=2:ncpus=12:jobtype=westmere,place=free:group=nodetype:excl +https://www.researchgate.net/post/How-can-I-res... 
-  #PBS -l walltime=0:20:00 + 
-  #PBS -q workq      +Very occassionally  checkpoint file may be corrupted, so keeping the most recent backup copy of a good checkpoint (.chkfile can be helpfulOtherwise in these circumstances the calculation may need to be started from scratch or the most recent molecular geometry (the coordinated of all the atomscould be used from the Gaussian output (.log) file.  
-  #PBS -m abe + 
-  #PBS -M MY_Email_Address +Please **recheck** your molecular **geometry very carefully** to ensure there are no issues - this will result in calculations which take much longer than necessary.
-  # End of comments (1 Make changes above. +
-   +
-  # (2The line below defined the job arrayIn 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" is an appropriate way to check on your job array status, each subjob will be listed +
-  # 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 "Deleting inside signal handlermeaning probably either hit walltime, or deleted the job using qdel" +
-   +
-    cd "$PBS_O_WORKDIR" +
-    rm -rfv "$GAUSS_SCRDIR" +
-    echo "---" +
-    echo "Signal handler ending time:+
-    date +
-    exit 0 +
-  } +
-    +
-  # Associate function "cleanup_scratch" with the TERM signal (and others), which is usually how jobs get killed.  +
-  trap 'cleanup_scratch' SIGTERM SIGHUP SIGINT SIGQUIT SIGFPE SIGKILL SIGALRM +
-   +
-  # 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  /lustre/SCRATCH5/gau/$USER +
-   +
-  # (5) Please leave this line unchangedCreating a subdirectory with your jobid for temporary Gaussian files +
-  # which are removed after job. Previously everyone's Gaussian temporary files were written in /SCRATCH5/gau +
-  mkdir  /lustre/SCRATCH5/gau/$USER/$PBS_JOBID +
-   +
-  # (6) Change to your work directory (usually more reliable than using "$PBS_O_WORKDIR"). Write your exact +
-  # work directory in the format below using /lustre +
-  cd /lustre/SCRATCH5/users/aslopis/Job_Array_Testing +
-   +
-  # (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 hereHence each sub-job will be in  +
-  # separate directories and more clearly organised. The names are arbitrary, so you should name them in  +
-  # meaningful way for you. Please notethe input files must also have the exact same name as the directory  +
-  # containing them so the script can then find and run using themIn the current example only 3 jobs are  +
-  # specified (PBS -J 1-3), but you can specify as many directories/sub-jobs as you like (more than 23 if  +
-  # 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: ' $PBS_ARRAY_INDEX +
-   +
-  cd ${directory[$PBS_ARRAY_INDEX]} +
-  echo ' directory: ' ${directory[$PBS_ARRAY_INDEX]} +
-  pwd +
-  echo '${directory[$PBS_ARRAY_INDEX]}.inp:' ${directory[$PBS_ARRAY_INDEX]}.inp +
-   +
-   +
-  # (9) Please leave unchanged. This new module specifies the new directory for Gaussian variable GAUSS_SCRDIR  +
-  # for temporary files directory. +
-  source /etc/profile.d/modules.sh +
-  module add gaussian/g09.anton +
-  source /opt/gridware/applications/gaussian/g09/bsd/g09.profile +
-   +
-  # (10) Please leave unchanged. The directory/filename will be transferred automatically here. +
-  LINDA=`cat $PBS_NODEFILE | uniq | tr '\n' "," | sed 's|,$||'+
-  echo linda: $LINDA +
-  cat ${directory[$PBS_ARRAY_INDEX]}.com | sed "s/LINDA/$LINDA/" > temp$$.inp +
-  g09 < temp$$.inp > ${directory[$PBS_ARRAY_INDEX]}.log +
-   +
-  # (11Leave 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    +
-  #  /lustre/SCRATCH5/gau/$USER/$PBS_JOBID +
-  # If abnormal termination (walltime or job killed) then function subroutine cleanup_scratch will clear  +
-  # temporary files. +
-   +
-  rm -rfv "$GAUSS_SCRDIR" +
-   +
-  echo "Normal execution ending time:" +
-  date+
/app/dokuwiki/data/attic/howto/gaussian.1462362535.txt.gz · Last modified: 2021/12/09 16:42 (external edit)