If I understand correctly the SLURM_JOBID environment variable has been "obsolete" since about 2009 or before. However, it has been retained for compatibility with older scripts. I would consider SLURM_JOB_ID as the best env var to be looking for, but also checking for SLURM_JOBID wouldn't hurt.
-Paul On Tue, Jun 14, 2016 at 2:30 PM, Gregory M. Kurtzer <[email protected]> wrote: > Hello, > > I've been working on a container system called Singularity ( > http://singularity.lbl.gov), and one of the features of Singularity is to > automatically figure out which Linux namespaces to separate on an as needed > basis. For several reasons it is beneficial to conditionally disable some > features when being executed via the resource manager (e.g. the PID > namespace virtualization). > > So my questions is..., is there an environment variable I can reliably > count on to detect the invocation of a process via SLURM? > > What I have found so far is that SLURM_JOB_ID and SLURM_JOBID both seem to > be present (and redundant). Between these two (or maybe other), is there a > particular envar that is *always* "guaranteed" to be present within a SLURM > (sbatch/srun/pmix) job context? > > Thank you! > > -- > Gregory M. Kurtzer > High Performance Computing Services (HPCS) > University of California > Lawrence Berkeley National Laboratory > One Cyclotron Road, Berkeley, CA 94720 > -- Paul H. Hargrove [email protected] Computer Languages & Systems Software (CLaSS) Group Computer Science Department Tel: +1-510-495-2352 Lawrence Berkeley National Laboratory Fax: +1-510-486-6900
