Scripts for controlling job times sbatch
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
function slurm-job-add-timelimit() {
timelimit="$1"
jobids=("${@:2}")
for job in "${jobids[@]}"; do
echo "$job"
scontrol show job $job | grep TimeLimit | awk '{print " Before: " $2}'
scontrol update jobid=$job TimeLimit+="$timelimit"
scontrol show job $job | grep TimeLimit | awk '{print " After: " $2}'
done
}
function slurm-job-check-timelimit() {
jobids=("${@:1}")
for job in "${jobids[@]}"; do
echo "$job"
scontrol show job $job | grep TimeLimit | awk '{print " Time Limit: " $2}'
done
}
The following code could be useful in niche usecases, but it can also force a job to terminate if the input timelimit is shorter than the currently elapsed time.
function slurm-job-set-timelimit() {
timelimit="$1"
jobids=("${@:2}")
for job in "${jobids[@]}"; do
echo "$job"
scontrol show job $job | grep TimeLimit | awk '{print " Before: " $2}'
scontrol update jobid=$job TimeLimit="$timelimit"
scontrol show job $job | grep TimeLimit | awk '{print " After: " $2}'
done
}
Contributor guide
No contributing guide indexed for this repository
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
Start with the three proposed shell functions—slurm-job-add-timelimit, slurm-job-check-timelimit, and slurm-job-set-timelimit—and review their scontrol, grep, and awk commands. Done means determining where these helpers belong in devops-docs and adding or documenting the intended Slurm time-limit controls, including the stated shorter-than-elapsed-time risk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli, devops
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100