Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Scripts for controlling job times sbatch

Open
#35 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
shell
Domain
cli, devops

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.

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
}
Dominant language
Python
Stars
1
Forks
9
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uabrc/devops-docs

All issues in uabrc/devops-docs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.