Skip to main content

SAGA

CI PyPI version Python 3.11+

SAGA: Scheduling Algorithms Gathered.

Open in GitHub Codespaces

Introduction

SAGA – Scheduling Algorithms Gathered – is a Python toolkit/library for designing, comparing, and visualising DAG-based computational workflow-scheduler performance on heterogeneous compute networks (also known as dispersed computing). It ships with a collection of scheduling algorithms, including classic heuristics (HEFT, CPOP), brute-force baselines, SMT-based optimisers, and more, all under one cohesive API.

The algorithms are all implemented in Python using a common interface. Scripts for validating and comparing the performance of the algorithms are also provided.

Prerequisites

Python Version

All components of this repository have been tested with Python 3.11. To ensure compatibility and ease of environment management, we recommend using uv, a fast Python package and project manager.

To create a new virtual environment with Python 3.11 (uv will download Python 3.11 for you if it isn't already installed):

uv venv --python 3.11
source .venv/bin/activate

For more information on managing Python versions with uv, refer to the uv documentation.

Usage

Installation

Local Installation

Clone the repository and install the requirements:

git clone https://github.com/ANRGUSC/saga.git
cd saga
uv pip install -e .

Running the Tests

Unit tests generate random task graphs and networks to verify scheduler correctness. They also check the RandomVariable utilities used for stochastic scheduling.

Locally

You can run the tests using pytest:

pytest ./tests

You may want to skip some of the tests that are too slow. You can do this ddirectly:

pytest ./tests -k "not (branching and (BruteForceScheduler or SMTScheduler))"

or by setting a timeout for the tests:

pytest ./tests --timeout=60

To run a specific test or scheduler-task combination, use the -k option. For example, to run the HeftScheduler tests on the diamond task graph:

pytest ./tests -k "HeftScheduler and diamond"

Linting and Type Checking

The CI pipeline also runs a linter and type checker. You can run these locally:

# Lint with ruff
ruff check src/saga

# Check formatting with ruff
ruff format --check src/saga

# Type check with mypy
mypy src/saga --ignore-missing-imports

To auto-fix lint issues or reformat code:

ruff check src/saga --fix
ruff format src/saga

Running the Algorithms

The algorithms are implemented as Python modules. The following example shows how to run the HEFT algorithm on a workflow:

from saga.schedulers import HeftScheduler

scheduler = HeftScheduler()
network: Network = ...
task_graph: TaskGraph = ...
scheduler.schedule(network, task_graph)

Examples

The repository contains several example scripts illustrating different algorithms and scenarios. You can find them under scripts/examples. To run an example, use:

python scripts/examples/<example_name>/main.py

The table of contents in scripts/examples/Readme.md lists examples ranging from basic usage to dynamic networks and scheduler comparisons.

Experiments

To reproduce the experiments from papers using SAGA, see the experiments directory.

Reference

A research paper that goes with this repo and that contains useful details is available online at ArXiV.

Acknowledgements

This work was supported in part by Army Research Laboratory under Cooperative Agreement W911NF-17-2-0196.

This material is based upon work supported by the National Science Foundation under Award No. 2451267.

Release files for anrg-saga 2.1.0

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

Source distribution (sdist)

Source distribution for anrg-saga 2.1.0
File Size Uploaded
anrg_saga-2.1.0.tar.gz 111.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anrg-saga 2.1.0
File Interpreter ABI Platform
anrg_saga-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 249.3 kB

Release files / anrg_saga-2.1.0.tar.gz

Download URL anrg_saga-2.1.0.tar.gz
Size 111.1 kB
Tags Source
SHA-256 checksum
How to use checksums
12147f97d9849b7f0a077db828b1c590d9c38cca99cc97670003682bfb33094c
BLAKE2b-256 checksum
How to use checksums
53ddf273893c278d3d067113e845a2581908b2e3d41843590c8fbc122406b327
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release files / anrg_saga-2.1.0-py3-none-any.whl

Download URL anrg_saga-2.1.0-py3-none-any.whl
Size 138.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c0113d6a78198cbc45a3a6bfdf1a03a909f1c5e602d578776ca1162738d6bcc
BLAKE2b-256 checksum
How to use checksums
d8dba41196cdc2a8a6943a7e9efb768d72eba21313a4d496612c90908559d5dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.6

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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