pytc.solver.isdf_xtc_ccsd._cgroup_memory_available_bytes¶
- pytc.solver.isdf_xtc_ccsd._cgroup_memory_available_bytes(root='/sys/fs/cgroup', proc_cgroup='/proc/self/cgroup')[source]¶
Available bytes under the most restrictive enclosing cgroup limit, or None.
A SLURM job’s
--memcap is enforced by the cgroup OOM killer, so node-wide RAM (psutil) overstates what a tier-2 host lift may use. The limit lives on the job’s OWN cgroup (e.g..../slurmstepd.scope/job_<id>/), not at the hierarchy root. Discovers the process’s cgroup(s) from/proc/self/cgroupand walks each path UP to the root, taking the minimum oflimit - currentover every level that sets one (cgroup v2memory.max/memory.current; v1memory.limit_in_bytes/memory.usage_in_bytes). Returns None when no limited level is found (e.g. macOS, non-cgroup hosts) and logs every level it inspected so the tier line is auditable.root/proc_cgroupexist for tests.