# First time you run a Gaussian job?¶

This page contains info aimed at first time users of Gaussian on Stallo, but may also be usefull to more experienced users. Please look carefully through the provided examples. Also note that the job-script example is rather richly commented to provide additional and relevant info.

If you want to run this testjob, copy the input example and the job script example shown below into your test job folder (which I assume you have created in advance).

## Gaussian input example¶

%chk=caffeine
%mem=500MB
#p b3lyp/cc-pVDZ opt

No comment specified. Default Comment: From NewCaffeine.xyz

0 1
N     3.831536     0.000000     0.062646
C     2.359623     0.000000     0.016662
C     2.346242     0.000000     1.466600
N     3.391185     0.000000     1.965657
C     4.217536     0.000000     1.154419
N     1.092573     0.000000     2.175061
C     0.000000     0.000000     1.440000
N     0.000000     0.000000     0.000000
C     1.179579     0.000000    -0.825950
C    -1.305083     0.000000    -0.608570
O    -1.345306     0.000000     1.827493
O     1.192499     0.000000    -2.225890
C     1.079284     0.000000     3.614999
C     4.767291     0.000000    -1.031868
H    -2.067983     0.000000     0.168543
H    -1.417118     0.889165    -1.227242
H    -1.417118    -0.889165    -1.227242
H     0.049258     0.000000     3.968508
H     1.589271    -0.889165     3.982721
H     1.589271     0.889165     3.982721
H     4.222791     0.000000    -1.974970
H     5.393373     0.889165    -0.974180
H     5.393373    -0.889165    -0.974180
H     5.288201     0.000000     1.353412


NB: Pay special attention to the %mem defined in the beginning of the file. Also note that there are no mentioning of Linda and shared memory cores. This is addressed here: About the Gaussian install on Stallo

You can also download the input file here: Caffeine-input

## Gaussian runscrip example¶

#!/bin/bash -l

################### Gaussian Job Batch Script Example ###################
# Section for defining queue-system variables:
#-------------------------------------
# This script asks for a given set of nodes and cores. Stallo has got 16 or 20 cores/node,
# so you need to know what you want.
# Runtime for this job is 59 minutes; syntax is hh:mm:ss.
# Memory is set to the maximum advised for a full node, 1500MB/core - giving a total
# of 30000MB/node and leaving some for the system to use. Memory
# can be specified pr core, virtual or total pr job (be carefull).
#-------------------------------------
# SLURM-section
#SBATCH --job-name=g09_runex
#SBATCH --nodes=2
#SBATCH --time=00:59:00
#SBATCH --mem-per-cpu=1500MB
#SBATCH --output=g09_runex.log
#SBATCH --mail-type=ALL
#SBATCH --exclusive
#SBATCH --partition=gaussian # This is a particular gasussian partition due to some technicalities with SLURM.

######################################
# Section for defining job variables and settings:

input=caffeine # Name of input without extention
ext=com # We use the same naming scheme as the software default extention

# We load all the default program system settings with module load:

module --quiet purge

# Now we create working directory and temporary scratch for the job(s):
# Necessary variables are defined in the notur and the software modules.

export GAUSS_SCRDIR=/global/work/$USER/$SLURM_JOB_ID

mkdir -p $GAUSS_SCRDIR # Preparing and moving inputfiles to tmp: submitdir=$SLURM_SUBMIT_DIR
tempdir=$GAUSS_SCRDIR cp$submitdir/${input}.${ext} $tempdir cd$tempdir

# Preparation of inputfile is done by G09.prep in folder $g09tooldir # If you want to inspect it, cd$g09tooldir after loading the gaussian module

Gaussian.prep $input ###################################### # Section for running the program and cleaning up: # Running the program: time g09 <${input}.${ext} > gaussian_$input.out

# Cleaning up and moving files back to home/submitdir:
# Make sure to move all essential files specific for the given job/software.

cp gaussian_$input.out$submitdir
cp $input.chk$submitdir

# To zip some of the output might be a good idea!
#gzip $resultszip #mv$resultzip.gz $SUBMITDIR/ # Investigate potentially other files to keep: echo$(pwd)
echo $(ls -ltr) # ALWAYS clean up after yourself. Please do uncomment the following line #cd$submitdir
#rm  $tempdir/* #rmdir$tempdir

echo "Job finished at"
date
################### Job Ended ###################
exit 0


NB: Note that we for Gaussian advice to specify both nodes and core/node. This is due to the special way Gaussian sets up parallel jobs!

You can also download the runscript here: Gaussian run script

## The runscript example and the input file are also on Stallo¶

Type:

module load Gaussian/9.d01
cd <whereevertestfolderyouhave> # For instance testgau
cp -R /global/hds/software/notur/apprunex/Gaussian/* .


When you have all the necessary files in the correct folders, submit the job by typing:

sbatch job_g09.sh


To verify that nothing has gone wrong, compare the energy of g09_caffeine.out with the correct energy of HF=-680.4153661 for this calculation. The energy should ideally be identical or close to identical. After that, you may alter the variables in the shell script as much as you like to adapt to your own jobs. Good luck.