[R] To submit R jobs via SLURM

Dominik Schneider dosc3612 at colorado.edu
Mon Oct 3 21:10:34 CEST 2016

I typically call Rscript inside an sbatch file.

#! /bin/bash

cd /home/<myusername>/aso_regression_project #make sure you change to your
correct working directory
Rscript scripts/run_splitsample-modeling.R

and on the commandline of the login node:
sbatch batch_r.sh

There are lots of slurm configurations you can specify. Google for them.
Just add these under the first line and modify as needed:
#SBATCH --qos=
#SBATCH --mem=
#SBATCH --mail-type=begin,end,abort
#SBATCH --mail-user=userid at email.com
#SBATCH --time=
#SBATCH --nodes=
#SBATCH --job-name=myjob
#SBATCH --output=/home/<username>/run-%A_%a.Sout #special output filename


On Mon, Oct 3, 2016 at 3:03 AM, Sema Atasever <s.atasever at gmail.com> wrote:

> Dear Authorized Sir / Madam,
> I have an R script file in which it includes this lines:
> How can i to submit this R jobs via SLURM? Thanks in advance.
> *testscript.R*
> data=read.table("seqDist.50", header=FALSE)[-1]
> attach(data)
> d=as.matrix(data)
> library(cluster)
> cluster.pam = pam(d,6)
> table(cluster.pam$clustering)
> filenameclu = paste("outputfile", ".txt")
> write.table(cluster.pam$clustering, file=outputfile,sep=",")
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list