# Test workflow for GrapheonRL scheduler plugin
# 5 tasks with dependencies forming a DAG

rule all:
    input: "results/final.txt"

rule task_a:
    output: "results/a.txt"
    resources: mem_mb=1024
    threads: 2
    shell: "echo 'Task A done' > {output}"

rule task_b:
    input: "results/a.txt"
    output: "results/b.txt"
    resources: mem_mb=2048
    threads: 4
    shell: "echo 'Task B done' > {output}"

rule task_c:
    input: "results/a.txt"
    output: "results/c.txt"
    resources: mem_mb=1024
    threads: 1
    shell: "echo 'Task C done' > {output}"

rule task_d:
    input: "results/b.txt", "results/c.txt"
    output: "results/d.txt"
    resources: mem_mb=4096
    threads: 2
    shell: "echo 'Task D done' > {output}"

rule task_final:
    input: "results/d.txt"
    output: "results/final.txt"
    resources: mem_mb=512
    threads: 1
    shell: "echo 'Final done' > {output}"
