-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
59 lines (45 loc) · 1.81 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# slurmtools
<!-- badges: start -->
[![R-CMD-check](https://github.com/A2-ai/slurmtools/actions/workflows/RunChecks.yaml/badge.svg)](https://github.com/A2-ai/slurmtools/actions/workflows/RunChecks.yaml)
<!-- badges: end -->
`slurmtools` is a collection of utility functions suitable for interacting with slurm and submitting nonmem jobs. There are three main functions of `slurmtools`
1. `submit_slurm_jobs` - submits a job to slurm via `sbatch`. The job is defined by a template file that is filled in during the call of this function
2. `get_slurm_jobs` - gives a tibble of currently runing jobs via `squeue`.
3. `cancel_slurm_jobs` - cancels a running slurm job via `scancel`.
## Installation
You can install the development version of slurmtools from [GitHub](https://github.com/) with:
``` r
# install.packages("pak")
pak::pkg_install("a2-ai/slurmtools")
```
## Examples
This block sets up options used by slurmtools:
```{r setup}
nonmem = file.path(here::here(), "vignettes", "model", "nonmem")
options('slurmtools.submission_root' = file.path(nonmem, "submission-log"))
options('slurmtools.bbi_config_path' = file.path(nonmem, "bbi.yaml"))
options('slurmtools.slurm_job_template_path' = file.path(nonmem, 'slurm-job-bbi.tmpl'))
library(slurmtools)
```
This block reads in a nonmem model with bbr and submits the job to slurm:
```{r submit}
mod_number <- "1001"
mod <- bbr::read_model(file.path(nonmem, mod_number))
submit_slurm_job(mod, overwrite = TRUE)
```
This block shows recently submitted and completed jobs:
```{r get}
knitr::kable(get_slurm_jobs(user = 'matthews'))
```