====== Cuentas de SLURM Para IPAC ======
Cada IPAC concursó para una cantidad de horas CPU finita para el lapso de 1 año.
* PADS: Proyectos de Avances Decisivos con Supercómputo
* PCI: Proyectos de Cálculo Intensivo
* PISCA: Proyectos de Iniciación en Supercómputo en Argentina
Cada una de las categorías tiene asignadas distinta cantidad de horas.
* PADS: hasta 4.000.000 de horas de CPU y/o 250.000 h GPU.
* PCI; hasta 1.000.000 de horas de CPU y/o 60.000 h GPU.
* PISCA: hasta 100.000 de horas de CPU y/o 1.000 h GPU.
En un principio vamos a limitar únicamente las horas CPU (entiéndase horas/core) debido a que Slurm no está identificando correctamente las GPU.
Como cada proyecto va a tener asignados múltiples usuarios, creamos una account de slurm por usuario.
Para limitar las horas de esa account, creamos una qos por separado ya que la misma necesita la opción NoDecay. Si seteáramos el límite NoDecay directamente sobre la Account, en teoría afectaría el FairShare.
Esto se debe a que NoDecay hace que no entre en efecto PriorityDecayHalfLife de slurm.conf, utilizado para regenerar el fairshare de cada usuario a lo largo del tiempo. Si esto fuera así, el GrpTresMins se regeneraría.
Entonces se configura:
* Una Account por IPAC.
* Una QOS por IPAC para limitar la cantidad de horas disponibles.
* Usuarios associados a la Account.
Los comandos a utilizar son los siguentes:
__PAD__
sacctmgr add account PAD_
sacctmgr create qos qos_pad_ set flags=DenyOnLimit,NoDecay GrpTRESMins=cpu=240000000
sacctmgr modify account pad_ set qos=qos_pad_
sacctmgr create user name= account=pad_
__PCI__
sacctmgr add account PCI_
sacctmgr create qos qos_pci_ set flags=DenyOnLimit,NoDecay GrpTRESMins=cpu=60000000
sacctmgr modify account pci_ set qos=qos_pci_
sacctmgr create user name= account=pci_
__PISCA__
sacctmgr add account PISCA_
sacctmgr create qos qos_pisca_ set flags=DenyOnLimit,NoDecay GrpTRESMins=cpu=6000000
sacctmgr modify account pisca_ set qos=qos_pisca_
sacctmgr create user name= account=pisca_
Documentación de las opciones elegidas:
**DenyOnLimit** If set, jobs using this QOS will be rejected at submission time if they do not conform to the QOS 'Max' limits as stand-alone jobs. Jobs that go over these limits when other jobs are considered, but conform to the limits when considered individually will not be rejected. Instead they will pend until resources are available (as by default without DenyOnLimit). Group limits (e.g. GrpTRES) will also be treated like 'Max' limits (e.g. MaxTRESPerNode) and jobs will be denied if they would violate the limit as stand-alone jobs. This currently only applies to QOS and Association limits.
**NoDecay** If set, this QOS will not have its GrpTRESMins, GrpWall and UsageRaw decayed by the slurm.conf PriorityDecayHalfLife or PriorityUsageResetPeriod settings. This allows a QOS to provide aggregate limits that, once consumed, will not be replenished automatically. Such a QOS will act as a time-limited quota of resources for an association that has access to it. Account/user usage will still be decayed for associations using the QOS. The QOS GrpTRESMins and GrpWall limits can be increased or the QOS RawUsage value reset to 0 (zero) to again allow jobs submitted with this QOS to run (if pending with QOSGrp{TRES}MinutesLimit or QOSGrpWallLimit reasons, where {TRES} is some type of trackable resource).
**GrpTRESMins** The total number of TRES minutes that can possibly be used by past, present and future jobs running from an association and its children. If any limit is reached, all running jobs with that TRES in this group will be killed, and no new jobs will be allowed to run. This usage is decayed (at a rate of PriorityDecayHalfLife). It can also be reset (according to PriorityUsageResetPeriod) in order to allow jobs to run against the association tree. This limit only applies when using the Priority Multifactor plugin.
====== Monitoreo de uso ======
Para ver la cantidad usada por cada account, usar el comando de sacctmgr:
sacct -A -X --starttime=2025-01-01 --noheader --parsable2 --format=AllocCPUs,ElapsedRaw | awk -F"|" '{sum+=$2*$1} END {print sum/3600, "CPU Hours"}'
==== Ver consumo parcial de QOS ====
scontrol show assoc_mgr | grep "QOS=qosprueba(32)" -A 21
Buscar la línea ''GrpTRESMins=cpu=780(815)''
Donde 780 es el límite de minutos que puede usar de CPU la qos, y 815 es el tiempo utilizado (la qos está excedida, esto ocurrió porque antes de lanzar el último job, todavía quedaban minutos disponibles, pero no los suficientes).