#!/bin/tcsh # NOTE: Lines starting with "#SBATCH" are valid SLURM commands or statements, # while those starting with "#" and "##SBATCH" are comments. Uncomment # "##SBATCH" line means to remove one # and start with #SBATCH to be a # SLURM command or statement. #SBATCH -J g09job #Slurm job name # Set the maximum runtime and uncomment if you need it. ##SBATCH -t 60:00:00 #Maximum runtime of 60 hours #SBATCH -o g09job.log #Slurm output file # Enable email notifications when job begins and ends, uncomment if you need it. ##SBATCH --mail-user= #Update your email address. ##SBATCH --mail-type=begin ##SBATCH --mail-type=end # Choose partition #SBATCH -p standard #For example, choose partition "standard" #SBATCH -N 1 #Request 1 node #SBATCH -n 24 #Request 24 cores ###GAUSSIAN INPUT FILENAME ###e.g. test.com setenv g09InputFile test.com ###GAUSSIAN OUTPUT FILENAME setenv g09OuputFile test.output ###GAUSSIAN CHECKPOINT FILENAME setenv g09ChkFile test.chk # When(in hours) to copy the chkfile if timeout: max queue walltime + 1 hr # e.g, standard:73, himem:73 setenv g09RunTimeCheckpoint 73 ########################################### ######DO NOT MODIFY BEYOND THIS LINE####### ########################################### cp $g09InputFile tmpg09Input.com /ust/bin/replace "$g09ChkFile" "/tmp/$USER/g09-scratch/$SLURM_JOBID/$g09ChkFile" -- tmpg09Input.com setenv g09root "/usr/local" setenv PATH "${PATH}:/usr/local/g09/linda8.2/opteron-linux/bin" source /usr/local/g09/bsd/g09.login setenv GAUSS_SCRDIR /tmp/$USER/g09-scratch/$SLURM_JOBID mkdir -p /tmp/$USER/g09-scratch/$SLURM_JOBID #mkdir to collect chkfile in case of program interruption. mkdir $SLURM_JOBID-chkfiledir ###Copy existing chkfile(if any) to local disk of working compute node if (-e $g09ChkFile) then cp $g09ChkFile /tmp/$USER/g09-scratch/$SLURM_JOBID/$g09ChkFile endif at now + $g09RunTimeCheckpoint hours << EOF cp -p /tmp/$USER/g09-scratch/$SLURM_JOBID/$g09ChkFile $SLURM_JOBID-chkfiledir/$HOSTNAME.$g09ChkFile rm -rf /tmp/$USER/g09-scratch/$SLURM_JOBID EOF atq | tail -1 | awk '{print $1}' > /tmp/$USER/g09-scratch/$SLURM_JOBID/atjobid #Next lines are for linda to know what nodes to run on. srun hostname -s | sort -u > tsnet.nodes.$SLURM_JOBID setenv GAUSS_LFLAGS '-nodefile tsnet.nodes.$SLURM_JOBID -opt "Tsnet.Node.lindarsharg: ssh"' # Next lines are to run Gaussian and get rid of the scratch after the run. # It will save a copy of checkpoint file in the job submission directory for disposal. time g09 tmpg09Input.com $g09OuputFile rm tsnet.nodes.$SLURM_JOBID cp /tmp/$USER/g09-scratch/$SLURM_JOBID/$g09ChkFile $HOSTNAME.$g09ChkFile rm tmpg09Input.com atrm `cat /tmp/$USER/g09-scratch/$SLURM_JOBID/atjobid` rm -rf /tmp/$USER/g09-scratch/$SLURM_JOBID