diff --git a/turing/calculations/g09/g09.slurm b/turing/calculations/g09/g09.slurm new file mode 100755 index 0000000..d91fd90 --- /dev/null +++ b/turing/calculations/g09/g09.slurm @@ -0,0 +1,18 @@ +#!/bin/tcsh + +setenv g09root /cm/shared/apps/gaussian/g09revD.01 + +if ($?USETMPFS ) then + setenv tmpG09 /tmp/${SLURM_JOB_NAME}.o${SLURM_JOB_ID}.tmp +else + setenv tmpG09 /${SLURM_SUBMIT_DIR}/${SLURM_JOB_NAME}.o${SLURM_JOB_ID}.tmp +endif + +mkdir $tmpG09 +setenv GAUSS_SCRDIR $tmpG09 + +source $g09root/g09/bsd/g09.login + +g09 < $1 + +rmdir --ignore-fail-on-non-empty $tmpG09 diff --git a/turing/calculations/g09/g09slurm b/turing/calculations/g09/g09slurm new file mode 100755 index 0000000..43274b5 --- /dev/null +++ b/turing/calculations/g09/g09slurm @@ -0,0 +1,53 @@ +#!/bin/bash + +if [ $# -lt 1 ]; then + echo "Error: Missing Gaussian G09 input file" + exit -1 +fi + +if [ $# -lt 2 ]; then + echo "Error: require a filename for Gaussian G09 output" + exit -1 +fi + +if [ ! -r $1 ]; then + echo "Error: Unable to open Gaussian G09 input file" + exit -1 +fi + +input_file=$1 +output_file=$2 +begin_date=$3 + +ncpus=$(grep -w nprocshared ./$1|awk '{print gensub("%nprocshared=","","G")}'|grep -v !) + +if [ -z "$ncpus" ]; then + ncpus=$(grep -w nproc ./$1|awk '{print gensub("%nproc=","","G")}'|grep -v !) +fi + +if [ -z "$ncpus" ]; then + ncpus=1 +fi + +if [ -z "$begin_date" ]; then + begin_date=now +fi + +if [ -f "$output_file" ]; then + read -p "Output file $output_file already exists, do you want overwrite? [N/y]" confirm + + if [ "$confirm" = "y" ]; then + > "$output_file" + fi +fi + +#--partition=phi \ + +/shared/apps/common/slurm/current/bin/sbatch \ + --job-name=G09-$input_file \ + --ntasks=1 \ + --cpus-per-task=$ncpus \ + --output=$output_file \ + --begin=$begin_date \ + /cm/shared/apps/gaussian/g09revD.01/script/g09/script/g09.slurm $input_file +