This function imports the output of 'squeue' into tibble, also adding
information about maximal virtual memory and RSS used by jobs of this user
(you).
job_info(user = Sys.getenv("USER"), partition = "shared")
Arguments
- user
A character(1)
vector specifying the username of the jobs to
query. Set NULL to return info about all users' jobs.
- partition
A character(1)
vector specifying the partition of the jobs
to query. Set NULL to return info about jobs of all partitions.
Value
A tibble with job information about currently running jobs.
Author
Nicholas J. Eagles
Examples
# Must be run in a SLURM environment where a 'shared' partition exists
if (system("which sbatch") == 0) {
job_df <- job_info(partition = "shared")
# Sum up requested CPUs across all running jobs
print(sprintf("I'm using %s CPUs total right now.", sum(job_df$cpus)))
}