Skip to content

Commit

Permalink
Mapped missing Slurm job state codes
Browse files Browse the repository at this point in the history
  • Loading branch information
stuvet committed Jul 24, 2021
1 parent 23f5a98 commit 145100a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions R/clusterFunctionsSlurm.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,26 @@ makeClusterFunctionsSlurm = function(template = "slurm", array.jobs = TRUE, node
if (length(clusters)) tail(res$output, -1L) else res$output
}


# Full List of Slurm job state codes:
# https://slurm.schedmd.com/squeue.html
# BF,CA,CD,CF,CG,DL,F,NF,OOM,PD,PR,R,RD,RF,RH,RS,RV,SI,SE,SO,ST,S,TO


listJobsQueued = function(reg) {
args = c(quote("--user=$USER"), "--states=PD")
args = c(quote("--user=$USER"), "--states=PD,CF,RD,RF,RH,RQ,SE")
listJobs(reg, args)
}

listJobsRunning = function(reg) {
args = c(quote("--user=$USER"), "--states=R,S,CG")
args = c(quote("--user=$USER"), "--states=R,S,CG,RS,SI,SO,ST")
listJobs(reg, args)
}

# Slurm job state codes that will result in an expired status:
# BF,CA,CD,DL,F,NF,OOM,PR,RV,TO


killJob = function(reg, batch.id) {
assertRegistry(reg, writeable = TRUE)
assertString(batch.id)
Expand Down

0 comments on commit 145100a

Please sign in to comment.