myxce/src/configs/limits.yaml
Rongsong Shen 58918a6a79
fix(scheduler): live-verify bug-1790 with a real global mem limit
Adds ug1_global_mem to limits.yaml: a permanent, real GLOBAL limit on
"mem" (a per-host resource, not "slots"), capping ug1's total
cluster-wide mem usage at 5GB. This is exactly the scenario bug-1790
fixed but only unit-tested until now -- no limit in the shipped example
config exercised a global cap on a non-slots per-host resource.

Live-verified via a fresh single-node deploy: 3 jobs submitted as user1
(ug1 member) each requesting rusage[mem=2000000000] (2GB) on queue
normal. Scheduler trace confirms ug1_global_mem correctly matches and,
for the first time, computes a real nonzero job-wide-total wanted value:

  unsatisfy_ resource 36 total 5000000000.000000 inuse 4000000000.000000
    uncomit 0.000000 wanted 2000000000.000000
  unsatisfy_ unmet resource 36 (limit=ug1_global_mem) shortfall
    1000000000.000000

The 3rd job (4GB inuse + 2GB wanted = 6GB > 5GB cap) correctly PENDed
until an earlier job's mem freed up. Deploy config validated with zero
new warnings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GLfB5uWRdmx2WiZSFC7Fm7
2026-09-08 08:49:17 +00:00

91 lines
2.1 KiB
YAML

---
limits:
# cap total slots for ug1 across the whole cluster
- name: ug1_slots
users:
members:
- ug1
resname: slots
value: 10
# per-user slot cap inside ug2 (each member gets up to 4, not a shared pool)
- name: ug2_slots_per_user
users:
members:
- ug2
exclude_members:
- user3
resname: slots
value: 4
per_user: true
# queue-scoped memory cap, percentage of total mem resource
- name: night_mem_pct
queues:
members:
- night
resname: mem
value: 50
percent: true
# host-scoped cap, applied per host in hg1
- name: hg1_slots_per_host
hosts:
members:
- hg1
resname: slots
value: 20
per_host: true
# combined scope: ug1 members on the normal queue
- name: ug1_normal_slots
users:
members:
- ug1
queues:
members:
- normal
resname: slots
value: 8
# migrated from src/controller/sched.c xcesched_push_configs()'s
# hardcoded limit1_config literal (all users except rshen, shared
# 3-slot cap)
- name: limit1
users:
members:
- all
exclude_members:
- rshen
resname: slots
value: 3.0
# global cap on ug1's total mem requested across the whole cluster
# (bug-1790 regression coverage: a GLOBAL limit on a per-host resource
# OTHER than "slots" -- exercises calc_wanted_host_resval_job_totals()'s
# generalization of bug-1789's fix to any per-host resource, proven live
# rather than left as untested config)
- name: ug1_global_mem
users:
members:
- ug1
resname: mem
value: 5000000000
# migrated from src/controller/sched.c xcesched_push_configs()'s
# hardcoded limit2_config literal (rshen on the xce queue, per-user/
# per-queue/per-project/per-host 20% mem cap)
- name: limits2
per_user: true
per_queue: true
per_project: true
per_host: true
users:
members:
- rshen
queues:
members:
- xce
resname: mem
value: 0.2
percent: true