Difference between revisions of "R Job Script"

From UFRC
Jump to navigation Jump to search
m (Moskalenko moved page R PBS to R Job Script)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Category:Software]]
 +
[[R|back to the main R page]]
 +
 
<source lang=bash>
 
<source lang=bash>
 
#!/bin/bash
 
#!/bin/bash
#PBS -N R-demo
+
#SBATCH --job-name=R_test  #Job name
#PBS -M YOUREMAIL@ufl.edu
+
#SBATCH --mail-type=END,FAIL  # Mail events (NONE, BEGIN, END, FAIL, ALL)
#PBS -m abe
+
#SBATCH --mail-user=ENTER_YOUR_EMAIL_HERE  # Where to send mail
#PBS -o R_demo.$PBS_JOBID.out
+
#SBATCH --ntasks=1
#PBS -j oe
+
#SBATCH --mem=1gb   # Per processor memory
#PBS -l nodes=1:ppn=1
+
#SBATCH --time=00:05:00   # Walltime
#PBS -l pmem=1gb
+
#SBATCH --output=r_job.%j.out  # Name output file
#PBS -l walltime=00:05:00
 
#Change to the current working directory if inside a job
 
if [[ -d $PBS_O_WORKDIR ]]; then cd $PBS_O_WORKDIR; fi
 
 
 
 
#Record the time and compute node the job ran on
 
#Record the time and compute node the job ran on
date; hostname
+
date; hostname; pwd
 
#Use modules to load the environment for R
 
#Use modules to load the environment for R
 
module load R
 
module load R
Line 19: Line 18:
 
#Run R script  
 
#Run R script  
 
Rscript myRscript.R
 
Rscript myRscript.R
 +
 +
date
 
</source>
 
</source>

Latest revision as of 15:47, 19 November 2018

back to the main R page

#!/bin/bash
#SBATCH --job-name=R_test   #Job name	
#SBATCH --mail-type=END,FAIL   # Mail events (NONE, BEGIN, END, FAIL, ALL)
#SBATCH --mail-user=ENTER_YOUR_EMAIL_HERE   # Where to send mail	
#SBATCH --ntasks=1
#SBATCH --mem=1gb   # Per processor memory
#SBATCH --time=00:05:00   # Walltime
#SBATCH --output=r_job.%j.out   # Name output file 
#Record the time and compute node the job ran on
date; hostname; pwd
#Use modules to load the environment for R
module load R

#Run R script 
Rscript myRscript.R

date