Skip to content

Add classic structured DAG example (Gaussian elimination, FFT) - #71

Open
rodrigodg1 wants to merge 1 commit into
ANRGUSC:mainfrom
rodrigodg1:feature/classic-dags-example
Open

Add classic structured DAG example (Gaussian elimination, FFT)#71
rodrigodg1 wants to merge 1 commit into
ANRGUSC:mainfrom
rodrigodg1:feature/classic-dags-example

Conversation

@rodrigodg1

@rodrigodg1 rodrigodg1 commented Aug 19, 2026

Copy link
Copy Markdown

Summary

Adds scripts/examples/classic_dags, an example with generators for the two classic structured task-graph families used to evaluate list schedulers in the heterogeneous-scheduling literature: Gaussian elimination and FFT, with the exact topologies specified in the HEFT/CPoP paper (Topcuoglu, Hariri and Wu, IEEE TPDS 13(3), 2002, doi:10.1109/71.993206, Figs. 8 and 10). The same families appear in the evaluation of PEFT (Arabnejad and Barbosa, IEEE TPDS 25(3), 2014, doi:10.1109/TPDS.2013.57).

  • Each generator (gaussian_elimination_dag, fft_dag) asserts the paper's closed-form task count and acyclicity on every run.
  • The script schedules each instance with seven schedulers (HEFT, CPoP, PEFT, Min-Min, Max-Min, Sufferage, ETF) and prints a makespan comparison.
  • Task-graph and Gantt drawings are sized by instance count so labels stay legible on both small and large graphs (the default drawing parameters overlap badly past ~20 tasks).
  • Drawings omit SAGA's internal __super_source__/__super_sink__ (added automatically since the FFT graph has multiple exit tasks) so they match the papers' figures; the dummy tasks are still scheduled and never affect makespans.
  • Instances are reproducible via a fixed numpy seed. Two schedulers currently break ties by Python set-iteration order (ETF in general, PEFT on highly symmetric graphs such as FFT), so their rows in the comparison may vary between runs — noted in the example's Readme.
  • Adds the corresponding entry to scripts/examples/Readme.md.

Type of change

  • Bug fix
  • New scheduler
  • New feature (other)
  • Refactor / maintenance
  • Docs / CI only

Checklist

  • Branched off main and up to date with it (no conflicts)
  • uv run pytest tests/ --timeout=120 passes locally (124 passed)
  • uv run mypy src/saga --ignore-missing-imports is clean (unaffected; src/saga is untouched by this PR — also ran mypy directly against the new file, clean)
  • uv run ruff check src/saga and uv run ruff format --check src/saga are clean (unaffected; also ran both directly against the new file, clean)
  • New or changed behavior is covered by tests
  • Public functions/classes are typed and documented in the existing docstring style
  • No stray files, debug prints, unintended pyproject.toml/uv.lock changes, or version bump

Notes for reviewers

  • Left "covered by tests" unchecked: this is an example script under scripts/, which is outside the pytest/CI-linted src/saga scope (consistent with the other examples in scripts/examples/, none of which have dedicated pytest coverage). The generators self-verify structurally (task-count formula + acyclicity) on every run instead.
  • Only the topologies follow the cited papers; task costs and dependency sizes are drawn from SAGA's existing random-weight utilities rather than the papers' cost-assignment protocol (e.g. the HEFT paper assigns level-uniform costs to FFT tasks).
  • While preparing this example I noticed ETFScheduler (and PEFTScheduler on symmetric graphs) produce different makespans across runs on identical instances, due to unsorted set iteration in tie-breaking. Happy to open a separate issue/PR for that if useful — didn't want to scope-creep this one.

Adds scripts/examples/classic_dags: generators for the two structured
task-graph families used to evaluate list schedulers in the HEFT/CPoP
paper (Topcuoglu, Hariri and Wu 2002, Figs. 8 and 10) and, later, PEFT
(Arabnejad and Barbosa 2014) -- Gaussian elimination and FFT. Each
generator verifies the paper's closed-form task count on every run.
The script schedules each instance with seven schedulers, prints a
makespan comparison, and saves task-graph and Gantt-chart drawings
sized to stay legible at both small and large instance counts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant