Skip to content

Commit

Permalink
export get slurm jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
dpastoor committed Feb 20, 2024
1 parent af828ca commit 93f438d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(get_slurm_jobs)
export(get_slurm_partitions)
export(submit_nonmem_model)
importFrom(brio,read_file)
Expand Down
3 changes: 3 additions & 0 deletions R/get-jobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ parse_jobs_json <- function(.json) {
purrr::list_rbind(purrr::map(.json$jobs, parse_job_to_row))
}

#' get slurm jobs
#' @param user user filter
#' @export
get_slurm_jobs <- function(user = NULL){
cmd <- list(cmd = "squeue", args = "--json")
res <- processx::run(cmd$cmd, args = cmd$args)
Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
## Installation

## Usage
`submit_nonmem_model` is a replacement for the old `submit_model` function.


slurmtools
==================

`slurmtools` is a collection of utility functions suitable for interacting with slurm and submitting nonmem jobs.

## Usage

``` r
> library(slurmtools)
> get_slurm_jobs()
# A tibble: 4 × 10
job_id job_state cpus partition standard_input standard_output submit_time start_time user_name current_working_dire…¹
<int> <chr> <int> <chr> <chr> <chr> <dttm> <dttm> <chr> <chr>
1 3 COMPLETED 1 cpu2mem4gb /dev/null /cluster-data/user-homes/devin/test-training/scm_dir1/base_modelfit_dir1/NM_run2024-02-20 17:19:30 2024-02-20 17:23:15 devin /cluster-data/user-ho
2 4 RUNNING 1 cpu2mem4gb /dev/null /cluster-data/user-homes/devin/test-training/scm_dir1/modelfit_dir1/NM_run1/nmf2024-02-20 17:24:03 2024-02-20 17:24:03 devin /cluster-data/user-ho
3 5 RUNNING 1 cpu2mem4gb /dev/null /cluster-data/user-homes/devin/test-training/scm_dir1/modelfit_dir1/NM_run2/nmf2024-02-20 17:24:03 2024-02-20 17:24:03 devin /cluster-data/user-ho
4 6 CONFIGURING 1 cpu2mem4gb /dev/null /cluster-data/user-homes/devin/test-training/scm_dir1/modelfit_dir1/NM_run3/nmf2024-02-20 17:24:03 2024-02-20 17:24:03 devin /cluster-data/user-ho
# ℹ abbreviated name: ¹​current_working_directory
```
14 changes: 14 additions & 0 deletions man/get_slurm_jobs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 93f438d

Please sign in to comment.