#!/bin/csh
#
#  Sample Batch Script for a p=8 Platinum cluster job 
#     without Unitree and msscmd
#
#  Submit this script using the command: qsub cpgm8.job
#
#  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).
#
# resource limits  walltime: maximum wall clock time (hh:mm:ss)
#                  nodes: number of 2-processor nodes
#                  ppn: how many processors per node to use (1 or 2)
#                      (always charged for the entire node, so use 2)
#                  prod: resource = production Platinum cluster nodes
#PBS -l walltime=00:30:00,nodes=4:ppn=2:prod
#
# queue name
#PBS -q standard
#
# export all my environment variables to the job
#PBS -V
#
# Charge job to project MCS572 nfa
#PBS -A nfa
# 
# job name (default = name of script file)
#PBS -N cpgm8
#
# filename for standard output (default = <job_name>.o<job_id>)
#PBS -o cpgm8.out
#
# filename for standard error (default = <job_name>.e<job_id>)
#PBS -e cpgm8.err
# 
# send mail when the job begins and ends (optional: remove "# " below to use)
# #PBS -m be
# End of embedded QSUB options

#set echo               # echo commands before execution; use for debugging

# Create the scratch directory for the job and cd to it
setenv SCR `set_SCR`
if ($SCR != "") cd $SCR

cp ${HOME}/cdata  .
cp ${HOME}/cpgm8  .

# Run the MPI program on all nodes/processors requested by the job
# (program reads from cdata and writes to file cpgm8.output)

vmirun "cpgm8 < cdata >& cpgm8.output"

# Copy output to Home directory:

cp cpgm8.output ${HOME}
