← Back

# Task Scheduler Manager DSL

Mon Apr 13 2026

DSL User Manual

Overview

This DSL is designed to simulate and evaluate task scheduling algorithms on multi-core systems. It allows you to configure hardware constraints, define tasks with complex dependencies, write custom routing logic, and generate performance reports across various scheduling heuristics.

Github

Getting Started

1. Define System Configuration

set_cores(4);
set_memory(256.0);

2. Define Tasks

3. Variables, Math & If/Else Statements

If/Else Statements

if(myTask.memory >= max(100.0, system_threshold)){
    print("High Memory Task");
}else if(myTask.memory >= 50.0){
    print("Medium Memory Task");
}else{
    print("Low Memory Task");
}

*Note: You can chain as many else if statements as needed.

4. Loops

The DSL offers two specific loop structures:

  1. Range Loop: Iterates over numbers using loop (start, stop, step) as index.
loop (3, 0, -1) as i {
    print(i); // Prints 3, 2, 1
}
  1. Enumeration Loop: Iterates over a list or a task’s dependencies.
loop tasks as t {
    print(t.name);
}

5. Functions

Used for general-purpose calculations. Functions can return any data type.

def calculate_priority(base_prio, mem_req){
    if(mem_req >= 100.0){
        return base_prio - 10.0;
    }
    return base_prio;
}

6. Custom Heuristics

A specialized function used strictly by the scheduler to resolve ties or dictate priority. A heuristic must accept exactly two tasks as arguments and must return a boolean (true if the first task should be prioritized over the second, false otherwise).

heuristic smart_balance(t1, t2) {
    if (t1.memory != t2.memory) {
        return t1.memory < t2.memory;
    } else {
        return t1.priority > t2.priority || t1.duration < t2.duration;
    }
}

7. Simulation & Reporting

Before execution, the evaluator runs a strict validation pass on your task graph. The simulation will halt and throw an error if it detects:

  1. Duplicate task names within the pool.
  2. A single task requesting more memory than set_memory() allows.
  3. Undeclared dependencies.
  4. Cyclic Dependencies (Deadlocks): The system uses Kahn’s Algorithm and DFS to trace and report the exact cycle path preventing execution.

Built-in Heuristics:

Generating a Full Report

report(ml_pipeline, [FCFS, ROUND_ROBIN(10.0), smart_balance]);

Generating Specific Metrics If you only want specific performance numbers instead of the full timeline, you can query individual metrics:

makespan(tasks, [FCFS, SJF]);
average_waiting(tasks, [ROUND_ROBIN(10.0), MAX_PRIORITY]);
average_flow(tasks, [FCFS, smart_balance]);
utilization(tasks, [FCFS, SJF]);
throughput(tasks, [FCFS, ROUND_ROBIN(10.0)]);