Skip to main content

Batch Operations Guide

Efficiently manage multiple jobs simultaneously with S9S's batch operation capabilities.

Overview

Batch operations allow you to:

  • Manage multiple jobs with a single command
  • Apply operations to filtered jobs
  • Perform bulk job maintenance tasks
  • Export output from multiple jobs

Selection Methods

Visual Selection

Use visual selection mode to choose multiple items:

KeyActionDescription
Space
Toggle selectionSelect/deselect current item
v
Visual modeEnter visual selection mode
V
Visual line modeSelect entire rows
Ctrl+A
Select allSelect all visible items
Ctrl+D
Deselect allClear all selections
Ctrl+I
Invert selectionInvert current selection

Filter-Based Selection

Select items using filters:

# Select all failed jobs
/state:FAILED

# Select jobs by user
/user:alice

# Combine multiple filters
/state:PENDING user:bob

Available Batch Operations

S9S supports the following batch operations on selected jobs:

Cancel Jobs

Cancel all selected jobs:

# Select jobs and press 'c' or choose "Cancel Jobs" from the menu
# Confirmation dialog will appear before execution

Operation: Calls

scancel
for each selected job Use Case: Stop running or pending jobs that are no longer needed

Hold Jobs

Put selected jobs on hold:

# Select jobs and press 'H' or choose "Hold Jobs" from the menu
# Jobs will be prevented from starting

Operation: Calls

scontrol hold
for each selected job Use Case: Temporarily prevent pending jobs from starting without canceling them Note: Only works on pending jobs; cannot hold running jobs

Release Jobs

Release held jobs:

# Select held jobs and press 'r' or choose "Release Jobs" from the menu
# Jobs will be eligible to run again

Operation: Calls

scontrol release
for each selected job Use Case: Allow previously held jobs to start

Requeue Jobs

Requeue selected jobs:

# Select jobs and press 'q' or choose "Requeue Jobs" from the menu
# Jobs will be requeued for execution

Operation: Calls

scontrol requeue
for each selected job Use Case: Restart failed jobs or re-run completed jobs

Export Job Output

Export job output for all selected jobs:

# Select jobs and press 'e' or choose "Export Output" from the menu
# Choose output format: Text, JSON, CSV, or Markdown
# Files saved to ~/slurm_exports/ by default

Formats Available:

  • Text: Plain text with header information
  • JSON: Structured JSON with metadata
  • CSV: CSV format (line-by-line for analysis)
  • Markdown: Markdown format with code blocks

Operation: Retrieves job output and saves to local files Use Case: Archive job results, analyze output across multiple jobs

Interactive Batch Operations

Using the Batch Operations Menu

  1. Select Jobs: Use visual selection (
    Space
    key) or filters to select multiple jobs
  2. Open Batch Menu: Press
    b
    (or configured batch key) to open the batch operations menu
  3. Choose Operation: Navigate the menu or use keyboard shortcuts:
    • c
      - Cancel Jobs
    • H
      - Hold Jobs
    • r
      - Release Jobs
    • q
      - Requeue Jobs
    • e
      - Export Output
  4. Confirm: Review the confirmation dialog showing affected jobs
  5. Execute: Confirm to execute the batch operation
  6. Monitor Progress: Watch the progress bar as operations are applied to each job

Progress Tracking

The batch operations interface shows:

  • Number of jobs being processed
  • Current job being processed
  • Success/failure count
  • Overall completion status

Common Workflows

Cleanup Failed Jobs

# Step 1: Filter failed jobs
/state:FAILED

# Step 2: Review the filtered list
# Step 3: Press 'c' to cancel all failed jobs
# Step 4: Confirm the operation

Hold User Jobs for Maintenance

# Step 1: Filter user's pending jobs
/user:alice state:PENDING

# Step 2: Press 'H' to hold all jobs
# Step 3: Perform maintenance
# Step 4: Filter held jobs and press 'r' to release them

Requeue Failed Jobs

# Step 1: Filter failed jobs
/state:FAILED

# Step 2: Press 'q' to requeue
# Step 3: Jobs will be requeued and eligible to run again

Export Results from Completed Jobs

# Step 1: Filter completed jobs
/state:COMPLETED user:alice

# Step 2: Press 'e' to export
# Step 3: Choose export format (Text, JSON, CSV, or Markdown)
# Step 4: Files saved to ~/slurm_exports/

Safety and Validation

Confirmation Dialogs

All destructive batch operations (cancel, hold, requeue) require confirmation:

  • Shows the number of jobs affected
  • Lists job IDs that will be modified
  • Requires explicit "Yes" to proceed
  • Can be canceled with "No" or
    Esc

Progress Feedback

Batch operations provide real-time feedback:

  • Progress bar showing completion percentage
  • Current job being processed
  • Success and failure counts
  • Final summary of results

Error Handling

If a batch operation fails on individual jobs:

  • Operation continues with remaining jobs
  • Errors are counted and reported
  • Final summary shows successful vs. failed operations

Configuration

Export Settings

Configure default export behavior:

# Default export path (defaults to ~/slurm_exports)
export:
  defaultPath: ~/my_job_exports

# Default export format
  defaultFormat: json

Troubleshooting

Common Issues

"No jobs selected for batch operations"

  • Solution: Select at least one job using
    Space
    or visual selection mode

"Permission denied" errors during batch operations

  • Solution: You can only perform operations on your own jobs (unless admin)

"Operation failed" for some jobs

  • Cause: Job state may have changed, or job may not support the operation
  • Solution: Review the final summary to identify which jobs failed

Export files not found

  • Solution: Check
    ~/slurm_exports/
    directory or configured export path
  • Note: Directory is created automatically on first export

Keyboard Reference

KeyOperationDescription
b
Open batch menuOpen batch operations on selected jobs
Space
Toggle selectionSelect/deselect individual jobs
c
Cancel jobsCancel all selected jobs
H
Hold jobsPut selected jobs on hold
r
Release jobsRelease held jobs
q
Requeue jobsRequeue selected jobs
e
Export outputExport job output
Esc
Close menuClose batch operations menu

Next Steps