uabrc / uabrc/devops-docs

Scripts for controlling job times sbatch

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

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

  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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.