API Reference¶
Allocation
dataclass
¶
User-declared resource request, mirroring typical Slurm flags.
Source code in src/prevc/checks.py
Finding
dataclass
¶
A single diagnostic message produced by a check.
Source code in src/prevc/report.py
Snapshot
dataclass
¶
One sample of the whole process tree at a point in time.
Source code in src/prevc/report.py
prevalidate(command, *, cwd=None, env=None, timeout=60.0, sample_interval=0.2, cpus_allocated=None, mem_allocated_gb=None, gpu_allocated=False, print_report=True)
¶
Run command as a subprocess, sample its whole process tree while it
runs, and return a Report with peak resource usage and diagnostic
Findings relevant to running this on a shared Slurm cluster.
command can be a shell string or an argv list -- this is what makes
the tool language-agnostic: it wraps any executable via the OS process
tree, not a specific language runtime.
Parameters mirroring Slurm allocation flags (cpus_allocated, mem_allocated_gb, gpu_allocated) are optional but strongly recommended: without them, prevc can only report what happened, not whether it fits your intended #SBATCH request.