Here is a sample of PBS Scripts that can be used for R. This is just a suggested PBS script. Modify and comment at will. The script below is named as R.sh
#!/bin/bash #PBS -N R-job #PBS -j oe #PBS -V #PBS -m bea #PBS -M myemail@hotmail.com #PBS -l nodes=1:ppn=8 # comment these out if you wish echo "qsub host = " $PBS_O_HOST echo "original queue = " $PBS_O_QUEUE echo "qsub working directory absolute = " $PBS_O_WORKDIR echo "pbs environment = " $PBS_ENVIRONMENT echo "pbs batch = " $PBS_JOBID echo "pbs job name from me = " $PBS_JOBNAME echo "Name of file containing nodes = " $PBS_NODEFILE echo "contents of nodefile = " $PBS_NODEFILE echo "Name of queue to which job went = " $PBS_QUEUE # Pre-processing script cd $PBS_O_WORKDIR NCPUS=`cat $PBS_NODEFILE | wc -l` echo "Number of requested processors = " $NCPUS # Load R Module module load mpi/intel_1.4.3 module load intel/12.0.2 module load R/R-2.15.1 # ############### # Execute Program # ################ /usr/local/R-2.15.1/bin/R CMD BATCH $file
The corresponding qsub command and its parameter should be something like
$ qsub -q dqueue -l nodes=1:ppn=8 R.sh -v file=Rjob.r