hpc:numericserveruser:hpc_numericserver:batch_job_scripts:job_scripts_examples:script_gaussian

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
hpc:numericserveruser:hpc_numericserver:batch_job_scripts:job_scripts_examples:script_gaussian [2020/02/14 18:06] – kraushpc:numericserveruser:hpc_numericserver:batch_job_scripts:job_scripts_examples:script_gaussian [2020/02/14 18:08] (aktuell) – kraus
Zeile 1: Zeile 1:
 +====== Gaussian ======
  
 +
 +Launch this script shown below by typing: \\
 +
 +<file>qsub jobscript_gaussian16.sh [name_of_your_job]</file> \\
 +
 +OR substitute <file> NAME=$1 </file> by <file>NAME=[name_of_your_job]</file> and launch as: \\
 +
 +<file>qsub jobscript_gaussian16.sh</file> \\
 +
 +**Remark:**
 +<html>
 +<span style="color:red;font-size:110%;">Please ensure <span style="color:blue;font-family:monospace;font-size:130%;">the value for NProcShared</span> within the Gaussian input equals <span style="color:blue;font-family:monospace;font-size:130%;">the number of threads</span> you demand by <span style="color:blue;font-family:monospace;font-size:130%;">-pe mp [no_threads]</span> </span>
 +</html> \\
 +\\
 +
 +<code bash jobscript_gaussian16.sh>
 +#!/bin/bash --login
 +
 +##### example for an OpenMP Gaussian run with 4 CPU
 +#$ -cwd
 +##### please define your own job resources
 +# time in hh:mm:ss
 +#$ -l h_rt=00:30:00
 +
 +#$ -l mem_free=4G
 +# IMPORTANT: ensure that %NProcShared within
 +# gaussian input is set to same value
 +#$ -pe mp 4
 +
 +#$ -N jobname
 +#$ -e jobname_err.out
 +#$ -o jobname_stdout.out
 +#$ -j n
 +#$ -m n
 +##########
 +
 +
 +# saves current directory; where output goes
 +STOREDIR=$PWD
 +NAME=$1
 +# strip off file extension
 +COMNAME=${1/.*/}
 +
 +if [ ! -s $STOREDIR/$NAME ]; then
 + echo "Error: Job input file $STOREDIR/$NAME does not exist!"
 + exit 1
 +fi
 +
 +
 +# create temporary directory for .rwf and .chk files
 +
 +# create unique tmpdir with random name
 +#SCRATCHDIR=$(mktemp -d /scratch/$USER/gaussian.XXXXXXX)
 +
 +# tmpdir per job ID
 +if [ -n "$TASK_ID" ]
 +then
 +SCRATCHDIR=/scratch/$USER/gaussian_${JOB_ID}_$TASK_ID
 +else
 +SCRATCHDIR=/scratch/$USER/gaussian_$JOB_ID
 +fi
 +
 +# don't forget to create recursively
 +mkdir -p $SCRATCHDIR
 +
 +# export location for Gaussian scratch directory
 +export GAUSS_SCRDIR=$SCRATCHDIR
 +
 +
 +# copy job files to tmpdir
 +
 +# in case of one .chk file with same name, uncomment this
 +#if [ -e $STOREDIR/$COMNAME.chk ] ; then
 +#cp $STOREDIR/$COMNAME.chk $SCRATCHDIR
 +#fi
 +
 +# if several .chk files need to be copied
 +cp $STOREDIR/*.chk $SCRATCHDIR
 +# copy the job input file
 +cp $STOREDIR/$NAME $SCRATCHDIR
 +
 +
 +# job starts
 +
 +# change to tmpdir
 +cd $SCRATCHDIR
 +# and start of job run
 +module load g16
 +g16 < $NAME > $STOREDIR/$COMNAME.out
 +
 +# job ends
 +
 +
 +# gives some info about the space left on scratch
 +if [ -n "$TASK_ID" ]
 +then
 +df -B GB /scratch > scratch_info_${JOB_ID}_$TASK_ID.out
 +else
 +df -B GB /scratch > scratch_info_$JOB_ID.out
 +fi
 +
 +
 +# copy files and chdir to job directory
 +mv -f $SCRATCHDIR/*.chk $STOREDIR ; cd $STOREDIR
 +
 +# creation of formatted chk (if needed), use with caution for big chk files
 +# formchk $COMNAME.chk
 +
 +#clean up
 +rm -fr $SCRATCHDIR
 +</code>
 +
 +\\
 +<WRAP rightalign>
 +date of revision: 02-14-2020 © kraus
 +</WRAP>
  • hpc/numericserveruser/hpc_numericserver/batch_job_scripts/job_scripts_examples/script_gaussian.txt
  • Zuletzt geändert: 2020/02/14 18:08
  • von kraus