#!/bin/bash

#####################################################################
## Template for PBS Batch Script Generated by PBS Resource Manager
## Launch Tab
## 
## This template contains all the currently recognized Job Attributes.
## 
## Placeholders (@NAME@) are included for the PBS Job Attribute 
## names as specified by qsub, plus the following internal variables:
##
## - env                     : place for defining extra environment
##                             variables (NB: should not be removed)
## - prependedBash           : dynamically change arbitrary bash 
##                             commands which should precede the 
##                             execution of the main application code
## - mpiCommand mpiOptions   : run under MPI
## - executablePath progArgs : the actual application
## - postpendedBash          : dynamically change arbitrary bash 
##                             commands which should follow the 
##                             execution of the main application code
##
## A template can also directly contain arbitrary shell scripting (not 
## to be replaced via the 'prepended' and 'postpended' placeholders);
## these lines will remain fixed and will not be exposed through
## the Launch Tab for modification (they can however be altered by 
## using the Resource Manager Properties "Edit" Tab).
##
## NOTE: We advise removing either the ncpus or the nodes resource,
##       depending on the PBS configuration (nodes is more common);
##       otherwise, the correct value must be set on both redundantly
##       in order for the MPI computation to be correct (and 
##       some systems might reject a script with both set).
#####################################################################

#PBS -A @Account_Name@
#PBS -c @Checkpoint@
#PBS -C @directive@
#PBS -e @Error_Path@
#PBS -h @Hold_Types@
#PBS -j @Join_Path@
#PBS -k @Keep_Files@
#PBS -l arch=@Resource_List.arch@
#PBS -l cput=@Resource_List.cput@
#PBS -l file=@Resource_List.file@
#PBS -l host=@Resource_List.host@
#PBS -l mem=@Resource_List.mem@
#PBS -l ncpus=@Resource_List.ncpus@
#PBS -l nice=@Resource_List.nice@
#PBS -l nodes=@Resource_List.nodes@
#PBS -l ompthreads=@Resource_List.ompthreads@
#PBS -l pcput=@Resource_List.pcput@
#PBS -l pmem=@Resource_List.pmem@
#PBS -l pvmem=@Resource_List.pvmem@
#PBS -l vmem=@Resource_List.vmem@
#PBS -l walltime=@Resource_List.walltime@
#PBS -m @Mail_Points@
#PBS -M @Mail_Users@
#PBS -N @Job_Name@
#PBS -o @Output_Path@
#PBS -p @Priority@
#PBS -q @destination@
#PBS -r @Rerunnable@
#PBS -S @Shell_Path_List@
#PBS -u @User_List@
#PBS -v @Variable_List@
#PBS -V @export_all@
#PBS -W depend=@depend@
#PBS -W group_list=@group_list@
#PBS -W stagein=@stagein@
#PBS -W stageout=@stageout@
@env@
@prependedBash@
cd @directory@
@mpiCommand@ @mpiOptions@ @executablePath@ @progArgs@
@postpendedBash@
