#!/bin/tcsh
#  Sample Batch Script for running serial/parallel Ansys-Fluent 12.1.4 jobs on HPC cluster

#  Please save this script into a file called (Fluent121.script) and 
#  Submit this script using the command: qsub Fluent121.script
#
#  Use the "qstat" command to check the status of a job.
#
# The following are embedded QSUB options. The syntax is #PBS (the # does
# _not_  denote that the lines are commented out so do not remove).
#
# walltime : maximum wall clock time (hh:mm:ss)
#PBS -l walltime=00:15:00
#
# nodes: number of 8-core nodes
#   ppn: how many cores per node to use (1 through 8)
#       (you are always charged for the entire node)
#PBS -l nodes=2:ppn=3
#
# export all my environment variables to the job
#PBS -V
#
# job name (default = name of script file)
#PBS -N testjob
#
#
# filename for standard output (default = .o)
# at end of job, it is in directory from which qsub was executed
# remove extra ## from the line below if you want to name your own file
###PBS -o testjob.out
#
# filename for standard error (default = .e)
# at end of job, it is in directory from which qsub was executed
# remove extra ## from the line below if you want to name your own file
###PBS -e testjob.err
#
# End of embedded QSUB options
#
# set echo               # echo commands before execution; use for debugging
#
# Change from "Submit" directory to the "Scratch" for executing the run.
# Doing all work in scratch to guarantees enough space available for data storage.
#
setenv subdir $PBS_O_WORKDIR
cd $SCR
mkdir  fluent_batch                     # Create a directory for your runs
cd  fluent_batch                        # cd to the MyRun directory
cp -p $subdir/* ./                      # Copy all files from your submit dir to batch working dir
#
#
# Creating a "pnodes" file which lists all processors of the nodes assigned
# for the run which are available for spawning the nodes.
# This could be done automatically by submitting the following commands;
#
rm -f pnodes
cat  $PBS_NODEFILE | sort > pnodes
set ncpus=`cat pnodes | wc -l`
#
#The following is a generic command. In order to get this command working;
#please decide if you want to run the 2d, 2ddp, 3d OR 3ddp solver and
#please use ONLY one of the options in the <> shown below
#The option (-g) supresses running the GUI in the background.
#The Option (-t6) specifies the no. of processors to be used.
#The options (-pib  -cnf=pnodes -ssh) allows fluent to spawn processors between the nodes. 
# o	"-pib" directs Fluent to use infiniband fabric.
# o	"-cnf=pnodes" lists all processors available for spawning. This file was already created above.
# o     "-ssh" directs Fluent to use ssh protocol between nodes.
#The option (-i) directs Fluent to read an input file (Fluent121.in).
#A sample inputfile could be found on /usr/apps/cfd/Ansys-12.1/ansys_inc/NCSA-Example-Scripts
#The option (>&) directs Fluent to print out a copy of all the activities
#that would have been printed out on the console of the GUI, if it were active,
#on an output file (Fluent121.out) for checking out your calculations.

fluent121 <2d|2ddp|3d|3ddp>  -g -t6 -pib -cnf=pnodes -ssh -i Fluent121.in >& Fluent121.out

# After run finishes, Copy all contents of your scratch space "batch host" to the submit directory.

cp * $subdir
#

Matlab Examples

R Examples

Softare Links

Ansys

Ansys Documentation

Matlab

Matlab Distributed Toolbox and Torque Scheduler

Matlab Distributed Toolbox and Generic Scheduler

PBS

University of Alberta PBS Guide

R

Acadia University

R Project