#!/bin/bash
#PBS -S /bin/bash
# run paraview 3.8 job in parallel 

# set default resource requirements for job 
# - these can be overridden on the qsub command line
#PBS -l nodes=1:ppn=4
#PBS -l walltime=2:00:00

#Change to directory from which job was submitted
cd $PBS_O_WORKDIR

# set number of processors to run on (using list of node names in file $PBS_NODEFILE)
nprocs=`wc -l $PBS_NODEFILE | awk '{ print $1 }'`

# load modules so that we find the pvbatch command
module load gcc
module load openmpi/1.3.3/gcc
module load use.own
module load pvbatch38-patch

mpirun -n $nprocs pvbatch --use-offscreen-rendering Q38.py
