How to set the default SLURM project account#
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 bysrun
commandSALLOC_ACCOUNT
- interpreted bysalloc
commandSBATCH_ACCOUNT
- interpreted bysbatch
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
or ~/.tcshrc
file:
setenv SLURM_ACCOUNT xz0123
setenv SALLOC_ACCOUNT $SLURM_ACCOUNT
setenv SBATCH_ACCOUNT $SLURM_ACCOUNT
Warning
The environment variable SBATCH_ACCOUNT takes precedence over account settings made in a batch script via
#SBATCH --account=yz0456