Job scheduler · Cluster simulator · Python

miniHPC

A small job scheduler and cluster simulator. Submit a workload, run it under a scheduling policy, and read back the schedule plus the metrics a real cluster cares about — makespan, throughput, wait, turnaround, utilisation. There's also a real multiprocessing executor, so it's more than a sim.

PythonFIFO · SJF · PriorityRound-Robin · Backfill Discrete-event simmultiprocessing executor

Try it

Watch a policy build the schedule

The engine is real Python (minihpc — model, policies, discrete-event simulator, CLI, tests). This widget is a faithful in-browser port of the same logic so you can see the schedule build; the table below it shows the numbers from the actual Python run on the default workload.
metricvalue

Real run

How the policies compare

From python demo.py — a fixed 8-job workload on 1 worker × 4 cores / 8 memory. The tight capacity is what makes the policies diverge.

policymakespanthroughputavg waitavg turnutil %
FIFO210.3819.1212.5083.3
SJF190.4211.885.2592.1
Priority200.4002.385.7587.5
Round-Robin180.4448.6212.0097.2
Backfill190.4211.885.2592.1

The model

From a submitted job to a finished one

job

Job

id, arrival, runtime, cores, memory, priority — and an optional callable payload for the real executor.

worker

Worker

A node with fixed cores/memory; runs several jobs at once if they fit. reserve/release make over-allocation impossible.

cluster

Cluster

A pool of workers with aggregate capacity book-keeping — what the metrics layer reads from.

policy

5 policies

FIFO, SJF, Priority, Round-Robin and EASY-style Backfill — each just an ordering rule over the ready queue.

sim

Discrete-event sim

Tick clock that releases, admits, schedules first-fit, and jumps to the next event — no empty ticks.

run

Real executor

Dispatches job payloads across a process pool in the policy's order, capped at cluster cores. More than a sim.

The loop

One tick of the cluster

  1. Release

    Free the cores and memory of every job whose finish tick has arrived.

  2. Admit

    Move newly arrived jobs into the ready queue.

  3. Schedule

    Ask the policy to order the ready queue; place each job first-fit. Strict policies stop at a blocked head; backfill looks past it.

  4. Advance

    Jump the clock to the next arrival or completion and repeat.

# the whole engine, from Python
from minihpc import demo_workload, compare

cmp = compare(demo_workload(), n_workers=1, cores=4, memory=8)
print(cmp.table())   # makespan / throughput / wait / turnaround / util