Get Available Resources
Build a conservative picture of resources available to the current process. Keep host inventory, process affinity, cgroup/container limits, scheduler allocation, and accelerator runtime usability separate.
Safety contract
Follow these rules:
- Run detection when the user requests it or a specific workload needs resource planning. Do not persist a fingerprint for every scientific task.
- Use stdout by default. Persist only when the user chooses an explicit generic local filename.
- Do not run stress tests, benchmarks, large allocations, write probes, device resets, driver installation, or clock/power changes.
- Do not dump the environment. Read only the named Slurm and accelerator variables implemented by the detector.
- Do not report hostnames, absolute paths, cgroup paths, job IDs, device UUIDs, PCI addresses, or raw visibility-variable values.
- Treat a missing observation as unknown. Never convert unknown to unlimited.
- Never infer that a visible host CPU, memory pool, or GPU is usable inside a scheduler allocation or container.
The bundled detector uses only fixed executable/argument tuples, no shell, short timeouts, bounded st…