Where to Write Temporary Files
If you run a program that needs to write temporary files, that is files that should be/are erased by the program at the end of the execution, DO NOT write them in /tmp.
To know the path of the temporary disk space local to each node, look for TmpFS in the SLURM configuration accessible through scontrol show conf. You can use grep to limit the output to what you are looking for:
Code Block (bash)
login@maestro-submit ~ $ scontrol show conf | grep TmpFs
TmpFS=/local/scratch/tmp
If your program needs to write temporary files, your must:
- set the environment variable
TMPDIRto the value indicated afterTmpFS=.Example:
Code Block (bash)
login@maestro-submit ~ $ TMPDIR=/local/scratch/tmp ; export TMPDIR
- inform SLURM on how much disk space your program's temporary files will take by using
--gres=diskoption as described in the textbook (chapter 5, page 27) so that SLURM won't send your job on a node with less than that space available. For example, if you think that your program myprogram will need up to 50 Gb of disk space for its temporary file, you will type:
Code Block (bash)
login@maestro-submit ~ $ srun --gres=disk:50000 myprogram
WARNING You/your programs are responsible for the deletion of those temporary files since SLURM can't guess which job has generated which file.