diff --git a/NAMESPACE b/NAMESPACE index bdce233..9856d3f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/get-jobs.R b/R/get-jobs.R index 60dae6e..b3fe601 100644 --- a/R/get-jobs.R +++ b/R/get-jobs.R @@ -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) diff --git a/README.md b/README.md index 1a588ba..460ba4d 100644 --- a/README.md +++ b/README.md @@ -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…¹ + +1 3 COMPLETED 1 cpu2mem4gb /dev/null /cluster-data/user-homes/devin/test-training/scm_dir1/base_modelfit_dir1/NM_run… 2024-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/nmf… 2024-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/nmf… 2024-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/nmf… 2024-02-20 17:24:03 2024-02-20 17:24:03 devin /cluster-data/user-ho… +# ℹ abbreviated name: ¹​current_working_directory +``` diff --git a/man/get_slurm_jobs.Rd b/man/get_slurm_jobs.Rd new file mode 100644 index 0000000..d3af574 --- /dev/null +++ b/man/get_slurm_jobs.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get-jobs.R +\name{get_slurm_jobs} +\alias{get_slurm_jobs} +\title{get slurm jobs} +\usage{ +get_slurm_jobs(user = NULL) +} +\arguments{ +\item{user}{user filter} +} +\description{ +get slurm jobs +}