ParallelManager.jl
HPC experiment runtime for Julia — multi-master safe, crash-recoverable, Pkg.test()-fast.
Wraps ParamIO.jl and DataVault.jl with a unified run! that handles parallel dispatch, advisory locking, .done rollups, structured event logging, and retry.
Pages
Highlights
- Multi-master safe — several
juliaprocesses can hit the same vault root without double-executing any key (DataVault.runningadvisory lock). - Crash recovery —
kill -9a master mid-run and the nextrun!picks up where it left off via heartbeat-based stale lock reclaim. - Early skip — full-done re-runs take O(1) filesystem operations (a single
manifest.jld2read), not O(N) per-key.donestats. 3600-key warm re-run ≈ 3.5 ms. - Structured events — JSONL event log atomic across concurrent writers; per-item
printlnis a non-goal, by design. - One entry point for all parallel modes —
init_workers!(mode=:auto)dispatches to:sequential/:threads/:distributed/:slurmdepending on environment. - Pure work functions — your physics is a plain
(DataKey) -> Dict, IO/locking/logging live in the runtime.
30-second tour
using ParamIO, DataVault, ParallelManager
spec = ParamIO.load("config.toml")
keys = ParamIO.expand(spec)
vault = DataVault.Vault("config.toml"; run="phase1")
ParallelManager.init_workers!(mode=:auto)
work_fn = key -> Dict{String,Any}("x" => compute(key))
ParallelManager.run!(work_fn, vault, keys)Re-running the same script after completion emits :skip_complete and exits in milliseconds regardless of length(keys).
Pain points it answers
| Pain | Answer |
|---|---|
.done files rescanned every job (3600 files, ~10 min) | Manifest rollup, one JLD2 read |
300 MB of per-item println logs | EventLog (JSONL); per-item println is not part of the API |
| Killed samples silently wedge the queue | Heartbeat + stale-lock reclaim (DataVault .running) auto-recover |
| Multiple masters double-execute the same key | Per-key .running advisory lock (acquire_running!) + post-lock is_done re-check |
| Half-written JLD2 files after crash | atomic_write (tmp + fsync + rename) |
| Every project reinvents SLURM / Distributed bootstrap | init_workers!(mode=:auto) |
See also
- ParamIO.jl — config TOML parsing and
DataKeyenumeration - DataVault.jl —
Vaultstruct, atomic JLD2 save,.donemarkers - templateHPC.jl — clone-to-start scaffold that wires all three together