Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jokergoo/bsub

Send R code/R scripts/shell commands to LSF cluster without leaving R
https://github.com/jokergoo/bsub

Last synced: 3 days ago
JSON representation

Send R code/R scripts/shell commands to LSF cluster without leaving R

Awesome Lists containing this project

README

        

# Submitter and Monitor of the LSF Cluster

[![R-CMD-check](https://github.com/jokergoo/bsub/workflows/R-CMD-check/badge.svg)](https://github.com/jokergoo/bsub/actions)
[![CRAN](https://www.r-pkg.org/badges/version/bsub)](https://cran.r-project.org/web/packages/bsub/index.html)

It sends R code/R scripts/shell commands to LSF cluster without leaving R.

### Install

Directly from CRAN:

```r
install.packages("bsub")
```

Or from GitHub:

```r
if (!requireNamespace("devtools", quietly = TRUE))
install.packages("devtools")
devtools::install_github("jokergoo/bsub")
```

### Documentation

The online documentation is available at https://jokergoo.github.io/bsub/.

### Submit jobs

Directly submit R chunk:

```r
library(bsub)

# R code
bsub_chunk(name = "example", memory = 10, hours = 10, cores = 4,
{
fit = NMF::nmf(...)
# you better save `fit` into a permanent file
saveRDS(fit, file = "/path/of/fit.rds")
})
```

Submit an R script:

```r
# R script
bsub_script(name = "example",
script = "/path/of/foo.R", ...)
```

Submit shell commands:

```r
# shell commands
bsub_cmd(name = "example",
cmd = "samtools view ...", ...)
```

Kill jobs:

```r
bkill(job_id)
```

### Job dependencies

```r

job1 = bsub_chunk(...)
job2 = bsub_chunk(...)
bsub_chunk(..., dependency = c(job1, job2))
```

### View job info

View job summaries:

```r
bjobs
brecent
bjobs_running
bjobs_pending
bjobs_done
bjobs_exit
```

An example of the job queries is as follows:

![](https://user-images.githubusercontent.com/449218/71292253-2577ad00-2374-11ea-9402-855e7f01652c.png)

View job log:

```r
job_log(job_id)
```

### Interactive job monitor

```r
monitor()
```

The job summary table:

monitor

Job log:

job_log

Job dependency diagram:

dependency_graph

### License

MIT @ Zuguang Gu