This function is used within the R script written by slurmR to get the current value of SLURM_ARRAY_TASK_ID, an environment variable that Slurm creates when running an array. In the case that opts_slurmR$get_debug() == TRUE, the function will return a 1 (see opts_slurmR).

Slurm_env(x = "SLURM_ARRAY_TASK_ID")

Arguments

x

Character scalar. Environment variable to get.

Value

If slurm is available and the R session is running under a job array, meaning that SLURM_ARRAY_TASK_ID is defined, then it returns that value, otherwise it will return 1.

See also

Other utilities: Slurm_clean(), Slurm_log(), WhoAmI(), parse_flags(), snames(), status()