slurm account
1. Slurm account
On a Slurm cluster, an account (or project) is used to track resource usage and control access to partitions. Specifying a valid account is mandatory when submitting a job.
2. Checking Available Accounts
sacctmgr show user $USER
This command show your default account.
result
User Def Acct Admin
---------- ---------- ---------
john-d+ monlabo None
You want more information… here is a command that will be useful to you |
sacctmgr list associations user=$USER format=User,Account,QOS -P |
result
User|Account|QOS
john-d@univ-nantes.fr|monlabo|debug,long,medium,normal,quick,short
john-d@univ-nantes.fr|prj1|debug,gpus,long,medium,normal,quick,short
john-d@univ-nantes.fr|prj2|debug,gpus,long,medium,normal,priority,quick,short
....
Here the account is "monlabo" it’s my laboratory and prj1 (of which I am a member in clam ).
Also, i have priority hours on prj2 (qos priority available),see site glicid I can use them by specifying account=prj2 in my slurm jobs
3. Submit a job with --account
Once you know your account name, specify it when submitting jobs with sbatch or srun.
sbatch --account=prj1 job_script.sh
#!/bin/bash
#SBATCH --job-name=test_job
#SBATCH --output=job_output_%j.txt
#SBATCH --time=01:00:00
#SBATCH --partition=standard
#SBATCH --account=prj1
echo "This job is running under account: $SLURM_JOB_ACCOUNT"
hostname
result :
This job is running under account: prj1 cnode340
If you don’t specify #SBATCH --account, SLURM will set SLURM_JOB_ACCOUNT to your default account. |