Skip to main content

WrapSlurm

WrapSlurm is a powerful and user-friendly wrapper for SLURM job management, designed to simplify job submission, resource querying, and log monitoring in SLURM environments. With a suite of commands like wrun, wlog, wqueue, and winfo, WrapSlurm enhances productivity for researchers and engineers working in high-performance computing (HPC) clusters.


Features

  • Simplified Job Submission (wr):

    • Automatically detect optimal resources (nodes, partitions, CPUs, memory, GPUs) based on the cluster's configuration.
    • Support for interactive and non-interactive SLURM jobs.
    • Customizable SLURM settings like time, tasks per node, and exclusions.
  • Log Monitoring (wl):

    • Watch real-time SLURM logs for specific job IDs or the latest job.
  • Queue Visualization (wq):

    • View and analyze job queues in a prettified table format with color-coded states.
  • Node Resource Querying (wi):

    • Display detailed SLURM node information, including memory, CPU, and GPU usage.

Installation

WrapSlurm is available on PyPI and can be installed using pip:

pip install wrapslurm

Post-Installation Notes

If the scripts wrun, wlog, wqueue, and winfo are installed in a directory not included in your system's PATH (e.g., ~/.local/bin), you may need to update your PATH environment variable:

  1. Add the following line to your shell configuration file (~/.bashrc or ~/.zshrc):

    export PATH="$PATH:$HOME/.local/bin"
    
  2. Reload your shell:

    source ~/.bashrc  # or source ~/.zshrc
    

Usage

1. Submit a Job (wrun)

Basic Usage:

Submit a script with auto-detected resources:

wr ./train_script.py

Specify Resources:

Submit a job with explicit resources:

wr --nodes 2 --partition gp4d --account ENT212162 --cpus-per-task 8 --memory 200G --gpus 4 ./train_script.py

Interactive Mode:

Start an interactive session:

wr

Full Help:

View all available options:

wr --help

2. Monitor Logs (wlog)

Watch the Latest Log File:

wl

Watch Logs for a Specific Job ID:

wl --job-id 12345678

3. View Job Queue (wqueue)

Display the job queue in a table format:

wqueue

4. Query Node Resources (winfo)

Basic Usage:

winfo

Include Down or Drained Nodes:

winfo --include-down

Example Workflow

  1. Query available resources:

    wi
    
  2. Submit a job:

    wr --account xxxxxx --time 2-00:00:00 ./train_script.py
    
  3. Monitor job logs:

    wl
    
  4. Check the queue:

    wq
    

Development

Cloning the Repository

git clone https://github.com/yourusername/wrapslurm.git
cd wrapslurm

Install Dependencies

Install the required Python packages:

pip install -r requirements.txt

Run Tests

Execute unit tests:

pytest

Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository.
  2. Create a feature branch:
    git checkout -b feature-name
    
  3. Commit your changes:
    git commit -m "Add feature-name"
    
  4. Push to your fork:
    git push origin feature-name
    
  5. Submit a pull request.

License

This project is licensed under the MIT License.


Acknowledgments

Special thanks to the SLURM community for making HPC resource management accessible to researchers worldwide.


Metadata

Release files for WrapSlurm 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for WrapSlurm 0.0.7
File Size Uploaded Provenance Actions
wrapslurm-0.0.7.tar.gz 8.3 kB Without provenance Details for wrapslurm-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for WrapSlurm 0.0.7
File Interpreter ABI Platform Actions
WrapSlurm-0.0.7-py3-none-any.whl Python 3 none any Details for WrapSlurm-0.0.7-py3-none-any.whl

Total release size: 18.3 kB

Release files / wrapslurm-0.0.7.tar.gz

Download URL wrapslurm-0.0.7.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
81e26b1c343e7d028a98092af6354c72b758ede305328d5e7f92f43813b02273
BLAKE2b-256 checksum
How to use checksums
8c89ed3816e5cc681a677accad10ae0bf0a736e0b23eaf946656e214b664f1bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.1

Release files / WrapSlurm-0.0.7-py3-none-any.whl

Download URL WrapSlurm-0.0.7-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3ebc0313281dac67f0a2a07b1e30033ea4b3fe40ce0631905d239897d4a72e2
BLAKE2b-256 checksum
How to use checksums
95bb17441e9a7d5db9143354125b636e935d8888d9738a4c5e7e5999e54c5e97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.1

Security for WrapSlurm 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page