How to Set the default SLURM project account#
On Mistral, specification of the project account (via option -A or –account) is necessary to submit a job or make a job allocation, otherwise your request will be rejected. To set the default project account you can use the following SLURM input environment variables
SLURM_ACCOUNT - interpreted by srun command
SALLOC_ACCOUNT - interpreted by salloc command
SBATCH_ACCOUNT - interpreted by sbatch command
Once the variables are defined, the option -A or –account can be dropped (in this case the compute time consumption is charged to the default account) or used to override environment variables settings.
If you use bash as your login shell, you can place the following settings in your ~/.bashrc file and source this file in the ~/.bash_profile or in the ~/.profile file:
export SLURM_ACCOUNT=xz0123
export SALLOC_ACCOUNT=$SLURM_ACCOUNT
export SBATCH_ACCOUNT=$SLURM_ACCOUNT
If you use tcsh as your login shell, you can put the following settings in your ~/.cshrc file:
setenv SLURM_ACCOUNT xz0123
setenv SALLOC_ACCOUNT $SLURM_ACCOUNT
setenv SBATCH_ACCOUNT $SLURM_ACCOUNT
NOTE: The environment variable SBATCH_ACCOUNT takes precedence over account settings made in a batch script via
#SBATCH --account=yz0456