#!/bin/bash -l # Example script for submitting Turbomole 7.4 calculations # on BU SCC using the $TMPDIR to avoid network problems. # Using the OpenMP parallelization of Gaussian # and environment variables to set options matching script. # Turbomole input files are expected. # Output directly from this script is in $JOB_ID-qsub.out, # Output from Turbomole is in # $JOB_ID/ # The job is executed in a scratch directory, only the important # files are copied back. Besides avoiding network/backup/mirroring/indexing # problems relating to scratch files, there is a smaller memory # footprint in the directory containing the job submission and output. # Many user specific qsub options such as -M user_email have been # removed, see link for their description to add them back # https://www.bu.edu/tech/support/research/system-usage/running-jobs/submitting-jobs/ # Being paranoid, the time limit is at 8 hours, feel free to adjust. # Turbomole jobs should be run with the AVX option. # Questions on exactly what this does should be directed to SCC help. # Script collated by: # Luke Nambi Mohanam, lmohanambu.edu #$ -N g16_omp #$ -pe omp 8 #$ -l h_rt=8:00:00 #$ -l mem_per_core=8G #$ -l avx #$ -cwd #$ -j y #$ -o $JOB_ID-qsub.out #$ -e $JOB_ID-qsub.err # get code to exit if error encountered #set -e # Identify submission directory, matching -cwd option. # this is the simplest way to ensure files are copied from and back from # the correct path. And locks the standard output file path. SUBMIT_DIR=$PWD # create output directory OUTPUT_DIR=$PWD/$JOB_ID mkdir $OUTPUT_DIR # Function to always call upon script termination function end_job_steps { #Copy back output files cp $TMPDIR/* $OUTPUT_DIR/. wait } trap end_job_steps EXIT # check scratch directory TMP_FREE_SPACE=$(df $TMPDIR | awk '{print $4}' | tail -n 1) #free space on $TMPDIR in KB if (( $TMP_FREE_SPACE < 150000000 )); then # make sure there is 150GB of space echo "not enough space on TMPDIR" exit 1 fi echo "qsub output for Gaussian16 job" echo "" echo "SPACE ON TMPDIR:" echo $TMP_FREE_SPACE # cp is used instead of rsync to avoid extra scanning -- # failed copying can not be restarted! #populate scratch directory ## input files cp $SUBMIT_DIR/* $TMPDIR/. wait echo "Scratch input created!" cd $TMPDIR echo "tmp dir contents at start:" ls -al #load turbomole and run calculation module load turbomole/7.4 if (( $NSLOTS > 1 )); then # use SMP export PARNODES=$NSLOTS export OMP_NUM_THREADS=$NSLOTS export TTYPE="SMP" else # use serial unset PARNODES export TTYPE="SERIAL" fi echo "Turbomole qsub call with environment variables:" echo "Job ID: $JOB_ID" echo "Job Name: $JOB_NAME" echo "Host Name: $HOSTNAME" echo "Submit Dir: $SUBMIT_DIR" echo "Output Dir: $OUTPUT_DIR" echo "Tmp Dir: $TMPDIR" echo "Ttype: $TTYPE" ridft > ridft-$JOB_ID.out 2>&1 echo "" echo "Job Done" echo "" echo "tmp dir contents at end:" ls -al