gflow - A lightweight, single-node job scheduler
English | 简体中文
gflow is a lightweight, single-node job scheduler written in Rust, inspired by Slurm. It is designed for efficiently managing and scheduling tasks, especially on machines with GPU resources.
Core Features
- Daemon-based Scheduling: A persistent daemon (
gflowd) manages the job queue and resource allocation. - Rich Job Submission: Supports dependencies, priorities, job arrays, and time limits via the
gbatchcommand. - Time Limits: Set maximum runtime for jobs (similar to Slurm's
--time) to prevent runaway processes. - Service and Job Control: Provides clear commands to inspect the scheduler state (
ginfo), query the job queue (gqueue), and control job states (gcancel). tmuxIntegration: Usestmuxfor robust, background task execution and session management.- Output Logging: Automatic capture of job output to log files via
tmux pipe-pane. - Simple Command-Line Interface: Offers a user-friendly and powerful set of command-line tools.
Component Overview
The gflow suite consists of several command-line tools:
gflowd: The scheduler daemon that runs in the background, managing jobs and resources.ginfo: Displays scheduler and GPU information.gbatch: Submits jobs to the scheduler, similar to Slurm'ssbatch.gqueue: Lists and filters jobs in the queue, similar to Slurm'ssqueue.gjob: Job inspection and control (logs, attach, update, redo, ...).gctl: Daemon/runtime control utilities (e.g. GPU restriction).gcancel: Cancels jobs.
Installation
Install via PyPI (Recommended)
Install gflow using pipx (recommended for CLI tools):
Or using uv:
Or using pip:
This will install pre-built binaries for Linux (x86_64, ARM64, ARMv7) with both GNU and MUSL libc support.
Install Nightly Build
To try the latest development version, install from TestPyPI:
Install via cargo
cargo install(main branch)
This will install all the necessary binaries (gflowd, ginfo, gbatch, gqueue, gcancel, gjob, gctl).
Build Manually
-
Clone the repository:
-
Build the project:
The executables will be available in the
target/release/directory.
Quick Start
-
Start the scheduler daemon:
Run this in a dedicated terminal or
tmuxsession and leave it running. You can check its health at any time withgflowd statusand inspect resources withginfo. -
Submit a job: Create a script
my_job.sh:#!/bin/bashSubmit it using
gbatch: -
Check the job queue:
You can also watch the queue update live:
watch --color gqueue. -
Stop the scheduler:
This shuts down the daemon and cleans up the tmux session.
Documentation
- Website: https://andpuqing.github.io/gflow/
- Installation:
docs/src/getting-started/installation.md - Quick start:
docs/src/getting-started/quick-start.md - Job submission:
docs/src/user-guide/job-submission.md - Time limits:
docs/src/user-guide/time-limits.md - Configuration:
docs/src/user-guide/configuration.md - Command quick reference:
docs/src/reference/quick-reference.md
Star History
Contributing
If you find any bugs or have feature requests, feel free to create an Issue and contribute by submitting Pull Requests.
License
gflow is licensed under the MIT License. See LICENSE for more details.