Temporary Directories

Revision as of 19:58, 1 September 2017 by Moskalenko (talk | contribs)
Jump to navigation Jump to search

When a SLURM job starts the scheduler creates a temporary directory for the job on the local hard drive on the compute node. This directory is owned by the user running the job. The path to the temporary directory is made available as the $SLURM_TMPDIR variable. The temporary job directory is automatically removed at the end of the job. The $SLURM_TMPDIR directory is very useful for jobs that need to use or generate a large number of small files since the '/ufrc' parallel filesystem is optimized for large file streaming and is less suitable for small files.

Use the '${SLURM_TMPDIR}' variable in job scripts to copy temporary data to the temporary job directory or as an argument for an application that accepts a temporary directory argument if necessary.

Note that many applications and programming languages use the '$TMPDIR' environment variable, if available, as the default temporary directory path. If this variable is not set the applications will default to using the '/tmp' directory, which is not desirable. SLURM will set TMPDIR to the same value as SLURM_TMPDIR unless TMPDIR has already been set in which case it will be ignored. Check your job script(s) and shell initialization files like .bashrc and .bash_profile to make sure you do not have TMPDIR set.