#!/bin/csh
# First Line must be the Shell used.  Should be node LOCAL
# Modify: qsub cpgm8.job; execute in batch on TCS; generic C source: cpgm.c
# also needs cdata input and send output to cpgm8.output using 8 processors
# These first few lines set Portable Batch System (PBS) scheduler directives.
# set h:mm:ss
#PBS -l walltime=4:00 
# set number nodes:procs: 1:1,1:4,2:8,...,nodes:procs
#PBS -l rmsnodes=2:8 
# set project-name for MCS572S03
#PBS -l rmsproject=sc70jjp 
#PBS -e cpgm8.error
#PBS -o cpgm8.output
#
# turn on echo
set echo           
#
# This job requires the program source cpgm.c and data file cdata
# copy source to local $SCRATCH
cp ${SCRATCH}/cpgm.c  .    
# copy cdata to local $SCRATCH
cp ${SCRATCH}/cdata  .    
#
# Compile the program:  compiles and links  cpgm
cc -O -lmpi -lelan -arch ev67 -o cpgm cpgm.c  
# using parallel optimization and the mpi library
#
# runs executable called cpgm 
prun -N ${RMS_NODES} -n ${RMS_PROCS} ./cpgm < cdata
# within mpprun environment and full path "./cpgm" is needed. 
# output using nprocs=8 should be in ${SCRATCH}/cpgm8.output where qsub run
#
