Skip to content

Environment variables

sbatch, salloc and srun (output)

These variables are intended to use with commands mentiond in caption. This is just a small selection of the possible options, taken from sbatch user documentation where you can get a lot more ones.

Variable Description
SLURM_ARRAY_JOB_ID Job array’s master job ID number
SLURM_ARRAY_TASK_ID Job array ID (index) number.
SLURM_CPUS_PER_TASK Number of cpus requested per task. Only set if either the –cpus-per-task option or the –tres-per-task=cpu=# option is specified.
SLURM_JOB_END_TIME The UNIX timestamp for a job’s projected end time.
SLURM_JOB_ID The ID of the job allocation.
SLURM_JOB_NODELIST List of nodes allocated to the job.
SLURM_JOB_NUM_NODES Total number of nodes in the job’s resource allocation.
SLURM_NTASKS Set to value of the –ntasks option, if specified. Or, if either of the –ntasks-per-node or –ntasks-per-gpu options are specified, set to the number of tasks in the job.

helper vars

On our hpc systems, build 2024 or later, there are also some env-vars set to help you keep things portable beetween clusters.

Variable Description
UBT_CLUSTER_INTEL_MARCH_CXXFLAGS CXX architecture flags for intel classic compilers
UBT_CLUSTER_GNU_MARCH_CFLAGS C architecture flags for gnu compilers
UBT_CLUSTER_INTERN_LABEL Its internal system name
UBT_CLUSTER_NAME festus
UBT_CLUSTER_GNU_MARCH_FCFLAGS Fortran arch flags for gnu compilers
UBT_CLUSTER_NORMAL_NODE_MEM Memory in GB on basic cpu node
UBT_CLUSTER_GNU_EARLIEST_VERS Earliest recommended gnu compiler version
UBT_CLUSTER_LLVM_MARCH_CFLAGS C architecture flags for llvm
UBT_CLUSTER_INTEL_MARCH_CFLAGS C architecture flags for intel classic compilers
UBT_CLUSTER_GNU_MARCH_CXXFLAGS CXX architecture flags for gnu compilers
UBT_CLUSTER_LLVM_MARCH_FCFLAGS Fortran architecture flags for llvm
UBT_CLUSTER_LLVM_MARCH_CXXFLAGS Fortran architecture flags for llvm
UBT_CLUSTER_LLVM_EARLIEST_VERS Earliest recommended llvm compiler frontend version
UBT_CLUSTER_INTEL_MARCH_FCFLAGS Fortran architecture flags for intel classic compilers
UBT_CLUSTER_NORMAL_NODE_NCORES Number of cores on basic cpu node
UBT_CLUSTER_SCRATCH_DIR common directory for computations