clusterFunctionsSlurm.R returns incorrect "batch.id"
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 184
- Forks
- 53
- Avg merge
- 7d 2h
- Merged PRs (30d)
- 1
Description
On a cluster that I'm using, sbatch prints multiple outputs. So, e.g., reg$status$batch.id always returns incorrect batch.id which further causes some difficulties (e.g., cannot distinguish running jobs and expired jobs).
To illustrate my issue, please see below my simple syntax taken from clusterFunctionsSlurm.R.
res = runOSCommand("sbatch", "~/test.slurm")
# > res
# $sys.cmd
# [1] "sbatch"
# $sys.args
# [1] "~/test.slurm"
# $exit.code
# [1] 0
# $output
# [1] "sbatch: This job will be charged to the account \"liu\". Base Allocation:500,000.00 hours, Current Balance:497,218.77 hours (99% remaining)"
# [2] "Submitted batch job 1556425"
output = stri_flatten(stri_trim_both(res$output), "\n")
# > output
# [1] "sbatch: This job will be charged to the account \"liu\". Base Allocation:500,000.00 hours, Current Balance:497,218.77 hours (99% remaining)\nSubmitted batch job 1556425"
id = stri_split_fixed(output[1L], " ")[[1L]][4L]
# > id
# [1] "will"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect clusterFunctionsSlurm.R and reproduce the reported sbatch output with multiple lines. Check how res$output is flattened and parsed; the fix is done when batch.id extracts 1556425 from the submission line instead of "will", allowing running and expired jobs to be distinguished.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100