How to see submitted jobs
This guide describes how to view jobs submitted to slurm using the get_slurm_jobs
function.
Prerequisites
- Submit a job to slurm (see How to submit a NONMEM job to slurm)
Viewing slurm jobs
Here’s the code you’ll use to view slurm jobs currently running
library(slurmtools)
get_slurm_jobs()
This will return a tibble where each row corresponds to a job and the columns give information about the jobs.
# A tibble: 3 × 12 job_id partition user_name job_state time cpus standard_input standard_output submit_time start_time end_time current_working_directory <int> <chr> <chr> <chr> <time> <int> <chr> <chr> <dttm> <dttm> <dttm> <chr>1 152 cpu2mem4gb user_x RUNNING 140:35:25 1 /dev/null /cluster-data/user-homes/user_x/.local/share/rstudio/launcher/ 2024-11-02 18:39:23 2024-11-02 18:44:37 2025-11-02 18:44:37 /cluster-data/user-homes/user_x2 265 cpu2mem4gb user_y CONFIGURING 01:13:01 1 /dev/null /cluster-data/user-homes/user_y/Packages/slurmtools/slurm-265.out 2024-11-04 17:08:24 2024-11-04 17:08:24 2024-11-04 18:21:25 /cluster-data/user-homes/user_y/Packages/slurm…3 329 cpu2mem4gb user_z CANCELLED 00:19:56 1 /dev/null /cluster-data/user-homes/user_z/Packages/slurmtools/slurm-329.out 2024-11-04 19:39:34 2024-11-04 19:39:34 2024-11-04 19:59:30 /cluster-data/user-homes/user_z/Packages/slurm…
Viewing user specific jobs
If you only want to see the jobs associated with user_y
you can supply this via the user
argument to filter the tibble to only rows with that user.
library(slurmtools)
get_slurm_jobs(user = "user_y")
# A tibble: 1 × 12 job_id partition user_name job_state time cpus standard_input standard_output submit_time start_time end_time current_working_directory <int> <chr> <chr> <chr> <time> <int> <chr> <chr> <dttm> <dttm> <dttm> <chr>1 265 cpu2mem4gb user_y CONFIGURING 01:13:01 1 /dev/null /cluster-data/user-homes/user_y/Packages/slurmtools/slurm-265.out 2024-11-04 17:08:24 2024-11-04 17:08:24 2024-11-04 18:21:25 /cluster-data/user-homes/user_y/Packages/slurm…